Further information:
(liftcover) [friguzzi@login02 fbk237]$ cat testgpu.pl
main :-
trace,
py_module_exists(numpy),
py_module_exists(cupy).
:- initialization(main).
(liftcover) [friguzzi@login02 fbk237]$ $HOME/bin/swipl testgpu.pl
Call: (25) janus:py_module_exists(numpy) ? creep
Call: (26) error:must_be(atom, numpy) ? skip
Exit: (26) error:must_be(atom, numpy) ? creep
Call: (26) janus:py_call(sys:modules:'__contains__'(numpy), @(true)) ? creep
Call: (28) janus:py_initialize ? creep
Call: (29) getenv('VIRTUAL_ENV', _4266) ? skip
Exit: (29) getenv('VIRTUAL_ENV', '/leonardo_work/IscrC_NSGP/liftcover') ? creep
Call: (29) prolog_to_os_filename(_5888, '/leonardo_work/IscrC_NSGP/liftcover') ? skip
Exit: (29) prolog_to_os_filename('/leonardo_work/IscrC_NSGP/liftcover', '/leonardo_work/IscrC_NSGP/liftcover') ? creep
Call: (29) atom_concat('/leonardo_work/IscrC_NSGP/liftcover', '/pyvenv.cfg', _7510) ? skip
Exit: (29) atom_concat('/leonardo_work/IscrC_NSGP/liftcover', '/pyvenv.cfg', '/leonardo_work/IscrC_NSGP/liftcover/pyvenv.cfg') ? creep
Call: (29) access_file('/leonardo_work/IscrC_NSGP/liftcover/pyvenv.cfg', read) ? skip
Exit: (29) access_file('/leonardo_work/IscrC_NSGP/liftcover/pyvenv.cfg', read) ? creep
Call: (29) current_prolog_flag(executable, _10760) ? skip
Exit: (29) current_prolog_flag(executable, '/leonardo/home/userexternal/friguzzi/lib/swipl/bin/x86_64-linux/swipl') ? creep
Call: (29) current_prolog_flag(py_argv, _12382) ? skip
Exit: (29) current_prolog_flag(py_argv, []) ? creep
Call: (29) janus:py_initialize('/leonardo/home/userexternal/friguzzi/lib/swipl/bin/x86_64-linux/swipl', ['-I'], []) ? creep
Call: (30) janus:py_initialize_('/leonardo/home/userexternal/friguzzi/lib/swipl/bin/x86_64-linux/swipl', ['-I'], []) ? creep
Exit: (30) janus:py_initialize_('/leonardo/home/userexternal/friguzzi/lib/swipl/bin/x86_64-linux/swipl', ['-I'], []) ? creep
Call: (30) absolute_file_name(library('python/janus.py'), _16492, [access(read)]) ? skip
Exit: (30) absolute_file_name(library('python/janus.py'), '/leonardo/home/userexternal/friguzzi/lib/swipl/library/ext/swipy/python/janus.py', [access(read)]) ? creep
Call: (30) file_directory_name('/leonardo/home/userexternal/friguzzi/lib/swipl/library/ext/swipy/python/janus.py', _18672) ? skip
Exit: (30) file_directory_name('/leonardo/home/userexternal/friguzzi/lib/swipl/library/ext/swipy/python/janus.py', '/leonardo/home/userexternal/friguzzi/lib/swipl/library/ext/swipy/python') ? creep
Call: (30) janus:py_add_lib_dir('/leonardo/home/userexternal/friguzzi/lib/swipl/library/ext/swipy/python', first) ? skip
Exit: (30) janus:py_add_lib_dir('/leonardo/home/userexternal/friguzzi/lib/swipl/library/ext/swipy/python', first) ? creep
Call: (30) janus:py_connect_io ? skip
Exit: (30) janus:py_connect_io ? creep
Call: (30) janus:repl_add_cwd ? creep
Call: (31) current_prolog_flag(break_level, _27424) ? creep
Fail: (31) current_prolog_flag(break_level, _27424) ? creep
Fail: (30) janus:repl_add_cwd ? creep
Fail: (29) janus:py_initialize('/leonardo/home/userexternal/friguzzi/lib/swipl/bin/x86_64-linux/swipl', ['-I'], []) ? creep
Fail: (28) janus:py_initialize ? creep
Fail: (26) janus:py_call(sys:modules:'__contains__'(numpy), @(true)) ? creep
Redo: (25) janus:py_module_exists(numpy) ? creep
Call: (26) janus:py_call(importlib:util:find_spec(numpy), _33148) ? creep
Exit: (26) janus:py_call(importlib:util:find_spec(numpy), @(none)) ? creep
Call: (26) @(none)\== @(none) ? creep
Fail: (26) @(none)\== @(none) ? creep
Fail: (25) janus:py_module_exists(numpy) ? creep
^ Redo: (13) setup_call_cleanup(system:with_mutex('$load_file', '$mt_start_load'('/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl', <clause>(0xd19a90), [expand(false)])), system:'$mt_do_load'(<clause>(0xd19a90), 'testgpu.pl', '/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl', user, [expand(false)]), system:'$mt_end_load'(<clause>(0xd19a90))) ? creep
Call: (26) push_msg(initialization_failure(user:main, '/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl':7), _38076) ? skip
main :-
Exit: (26) push_msg(initialization_failure(user:main, '/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl':7), []) ? creep
Call: (33) prolog:message_prefix_hook(thread, _39834) ? skip
Fail: (33) prolog:message_prefix_hook(thread, _39834) ? creep
Warning: /leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl:7: Initialization goal failed
Call: (25) pop_msg([]) ? creep
Exit: (25) pop_msg([]) ? creep
^ Exit: (18) setup_call_cleanup(system:'$start_run_initialization'([expand(false)], false), system:'$run_initialization_2'('/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl'), system:'$end_run_initialization'(false)) ? creep
^ Exit: (13) setup_call_cleanup(system:with_mutex('$load_file', '$mt_start_load'('/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl', <clause>(0xd19a90), [expand(false)])), system:'$mt_do_load'(<clause>(0xd19a90), 'testgpu.pl', '/leonardo_work/IscrC_NSGP/kg/fbk237/testgpu.pl', user, [expand(false)]), system:'$mt_end_load'(<clause>(0xd19a90))) ? creep
Call: (14) push_msg(load_file_errors('testgpu.pl', 0, 1), _45226) ? skip
Exit: (14) push_msg(load_file_errors('testgpu.pl', 0, 1), []) ? creep
Call: (13) pop_msg([]) ? creep
Exit: (13) pop_msg([]) ? creep
Call: (9) push_msg(welcome, _48536) ? skip
Exit: (9) push_msg(welcome, []) ? creep
Call: (19) prolog:version_msg(_50330) ? skip
Fail: (19) prolog:version_msg(_50330) ? creep
Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.22-26-g4eb8604da)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
Call: (8) pop_msg([]) ? creep
Exit: (8) pop_msg([]) ? creep
?-
% halt