uci-rendering / psdr-cuda

Path-space differentiable renderer
BSD 3-Clause "New" or "Revised" License
155 stars 11 forks source link

psdr_cuda -> ImportError: libenoki-cuda.so: cannot open shared object file: No such file or directory #28

Closed FROL256 closed 2 years ago

FROL256 commented 2 years ago
  1. System: Linux Mint 20.3, gcc-8 (gcc-9 does not work with CUDA)
  2. I have build enoki and psdr-cuda using gcc8.
  3. i have installed pybind11 from repo: pip3 install pybind11
  4. The python ver. is 3.8
    -- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.10") 
    -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so
    -- pybind11 v2.4.dev4

Then i have put all ".so" files in the examples folder and run:

python3 run_test.py 
Traceback (most recent call last):
  File "run_test.py", line 8, in <module>
    import psdr_cuda
ImportError: libenoki-cuda.so: cannot open shared object file: No such file or directory

I have tried to put libenoki-cuda.so and libenoki-autodiff.so in different folders, but this is does not helps. Could you please make me an advice what could be wrong loading these .so ?

this my "ls" output:

config.py  data  enoki  libenoki-autodiff.so  libenoki-cuda.so  psdr_cuda.so  psdr_test.py  ptx  __pycache__  run_test.py  utils

and this "ls -R":

.:
config.py  data  enoki  libenoki-autodiff.so  libenoki-cuda.so  psdr_cuda.so  psdr_test.py  ptx  __pycache__  run_test.py  utils

./data:
envmaps  objects  scenes  textures

./data/envmaps:
ballroom_1k.exr

./data/objects:
bunny  cbox  tree

./data/objects/bunny:
bunny_low.obj  bunny.obj

./data/objects/cbox:
ceil.obj  emitter.obj  floor.obj  wall_back.obj  wall_left.obj  wall_right.obj

./data/objects/tree:
emitter.obj  plane.obj  tree0.obj

./data/scenes:
bunny_env_2.xml  bunny_env.xml  bunny.xml  cbox_bunny_mutiemitter.xml  cbox_bunny.xml  tree.xml

./data/textures:
test_texture.exr

./enoki:
enoki  libenoki-autodiff.so  libenoki-cuda.so

./enoki/enoki:
core.cpython-38-x86_64-linux-gnu.so  cuda_autodiff.cpython-38-x86_64-linux-gnu.so  cuda.cpython-38-x86_64-linux-gnu.so  dynamic.cpython-38-x86_64-linux-gnu.so  __init__.py  libenoki-autodiff.so  libenoki-cuda.so  scalar.cpython-38-x86_64-linux-gnu.so

./ptx:
ptx_generated_psdr_cuda.cu.ptx

./__pycache__:
config.cpython-38.pyc  run_test.cpython-38.pyc

./utils:
adam.py  differential.py  __init__.py  scene_data.py

Thanks!

LiuLinyun commented 2 years ago

You can try to add codes below in run_test.py before importing psdr_cuda and enoki to set python lib env:

# set path lib path
sys.path.append("/xxx/psdr-cuda/build/lib") # your psdr-cuda cmake build lib path
sys.path.append("/xxx/enoki/build") # your enoki build path

# then import psdr_cuda and enoki
import psdr_cuda
import enoki as ek
from enoki.cuda_autodiff import Float32 as FloatD, Matrix4f as Matrix4fD, Vector3f as Vector3fD

May will help you!

FROL256 commented 2 years ago

Thank you very much for you answer! Probably this should work but for me

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/.../psdr-cuda/example

helped)