mrknorman / gravyflow

TensorFlow tools to facilitate machine learning for gravitational-wave data analysis.
Apache License 2.0
0 stars 1 forks source link

pytest gravyflow test is failing with the following error #7

Open VasSkliris opened 5 months ago

VasSkliris commented 5 months ago

(mly-base-test) [vasileios.skliris@ldas-pcdev12 ~]$ pytest gravyflow =============================================================================== test session starts ================================================================================ platform linux -- Python 3.10.13, pytest-8.2.1, pluggy-1.5.0 rootdir: /home/vasileios.skliris/gravyflow plugins: ligo.skymap-1.0.7 collected 0 items / 2 errors

====================================================================================== ERRORS ====================================================================================== _ ERROR collecting gravyflow/cuphenom/python/test_cuphenom.py __ gravyflow/gravyflow/cuphenom/python/test_cuphenom.py:11: in from .cuphenom import imrphenomd gravyflow/gravyflow/cuphenom/python/cuphenom.py:16: in lib = CDLL(f'{current_dir}/libphenom.so') .conda/envs/mly-base-test/lib/python3.10/ctypes/init.py:374: in init self._handle = _dlopen(self.name, mode) E OSError: libcurand.so.10: cannot open shared object file: No such file or directory ____ ERROR collecting gravyflow/tests _____ .conda/envs/mly-base-test/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level)

:1050: in _gcd_import ??? :1027: in _find_and_load ??? :992: in _find_and_load_unlocked ??? :241: in _call_with_frames_removed ??? :1050: in _gcd_import ??? :1027: in _find_and_load ??? :992: in _find_and_load_unlocked ??? :241: in _call_with_frames_removed ??? :1050: in _gcd_import ??? :1027: in _find_and_load ??? :1006: in _find_and_load_unlocked ??? :688: in _load_unlocked ??? :883: in exec_module ??? :241: in _call_with_frames_removed ??? gravyflow/gravyflow/__init__.py:13: in from .cuphenom.python.cuphenom import imrphenomd gravyflow/gravyflow/cuphenom/python/cuphenom.py:16: in lib = CDLL(f'{current_dir}/libphenom.so') .conda/envs/mly-base-test/lib/python3.10/ctypes/__init__.py:374: in __init__ self._handle = _dlopen(self._name, mode) E OSError: libcurand.so.10: cannot open shared object file: No such file or directory ============================================================================= short test summary info ============================================================================== ERROR gravyflow/gravyflow/cuphenom/python/test_cuphenom.py - OSError: libcurand.so.10: cannot open shared object file: No such file or directory ERROR gravyflow/gravyflow/tests - OSError: libcurand.so.10: cannot open shared object file: No such file or directory !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ================================================================================ 2 errors in 0.68s =================================================================================
mrknorman commented 5 months ago

Hi Vassilis, this is because cuPhenom has not been compiled. It's a little clunky, but you have to compile cuPhenom first before you can run the library, I think there are instructions for this in the readme? I don't know if there is an easier way to use compiled C binaries in Python libraries, or have it automatically compile when you install it, I'm not sure.

mrknorman commented 5 months ago

Also I hope the tests run okay apart from this, they are a bit touch and go and see to break whenever I leave them alone for a while.

VasSkliris commented 5 months ago

I did compiled it and it retuerned this:

nvcc ./src/cuphenom_functions.c ./src/cuda_functions.cu -shared -fPIC -lcurand -lcufft -I./include -I./io_tools/include -I./py_tools/include -I./cuda_tools/include -I/usr/include/gsl -Wall -Wextra -Wconversion -Wno-unused-function -Xcompiler "-Wno-unused-function -Wall -Wextra" -arch=native -use-fast-math -O3 -Xcompiler "-march=native -Ofast" -forward-unknown-to-host-compiler -lcrypt -lpthread -ldl -lutil -lrt -lm -L/usr/lib -lgsl -lgslcblas -o ./python/libphenom.so

so I assumed it did compiled it

mrknorman commented 5 months ago

Hmm, that is what happens when you compile. It must either have failed to compile for some reason or placed the output in the wrong place, there should be a shared object file ".so" called "libphenom.so" in this location "./gravyflow/gravyflow/cuphenom/python/libphenom.so". Is that there? Its possible that it's in the wrong place.

VasSkliris commented 5 months ago

It is there yes, also just to clarify I run pytest from inside gravyflow repo or outside? When I run from the inside I get this:

`(mly-base-test) [vasileios.skliris@ldas-pcdev12 gravyflow]$ pytest gravyflow ImportError while loading conftest '/home/vasileios.skliris/gravyflow/gravyflow/tests/conftest.py'. gravyflow/init.py:13: in from .cuphenom.python.cuphenom import imrphenomd gravyflow/cuphenom/python/cuphenom.py:16: in lib = CDLL(f'{current_dir}/libphenom.so') ../.conda/envs/mly-base-test/lib/python3.10/ctypes/init.py:374: in init self._handle = _dlopen(self._name, mode) E OSError: libcurand.so.10: cannot open shared object file: No such file or directory

`

mrknorman commented 5 months ago

I am unsure then, there may be a bug in how I get the shared library object location, is it urgent that this is fixed? I will probably have to look at it in context. You should be able to run pytest from inside the gravyflow directory by simply running pytest, or from outside the directory by running pytest gravyflow.

VasSkliris commented 5 months ago

No no urgency, puting time to go through the notebooks. I will try building an isolated env where i install the package just to be sure