pmh47 / dirt

DIRT: a fast differentiable renderer for TensorFlow
MIT License
312 stars 63 forks source link

librasterise.so: undefined symbol: cuCtxSetCurrent #102

Closed shreyashampali closed 3 years ago

shreyashampali commented 3 years ago

Hi @pmh47 , Thanks for your code. I am trying to install dirt with tensorflow 1.13, python 3.7, gcc 7.5, cuda 10.0 and cmake 3.10.2

I was able to build the code and install as you mentioned in your readme. Here's how ldd /media/shreyas/ssd2/Networks/dirt/dirt/librasterise.so looks like:

linux-vdso.so.1 (0x00007ffe09f0a000) libEGL.so.1 => /usr/lib/x86_64-linux-gnu/libEGL.so.1 (0x00007f780d58a000) libOpenGL.so.0 => /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007f780d35c000) libtensorflow_framework.so => /home/shreyas/anaconda3/envs/TF1.13/lib/python3.7/site-packages/tensorflow/libtensorflow_framework.so (0x00007f7117e7d000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f780d154000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f780cf35000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f780cd31000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f780c9a8000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f780c60a000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f780c3f2000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f780c001000) /lib64/ld-linux-x86-64.so.2 (0x00007f780da9b000) libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f780bd4b000)

Unfortunately, the test script square_tests.py fails with the following error:

WARNING: failed to load librasterise.so; rasterisation functions will be unavailable: /media/shreyas/ssd2/Networks/dirt/dirt/librasterise.so: undefined symbol: cuCtxSetCurrent 2021-04-25 23:15:42.698100: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): , Traceback (most recent call last): File "tests/square_test.py", line 61, in main() File "tests/square_test.py", line 47, in main dirt_pixels = get_dirt_pixels().eval() File "tests/square_test.py", line 35, in get_dirt_pixels height=canvas_height, width=canvas_width, channels=1 File "/media/shreyas/ssd2/Networks/dirt/dirt/rasterise_ops.py", line 48, in rasterise return rasterise_batch(background[None], vertices[None], vertex_colors[None], faces[None], height, width, channels, name)[0] File "/media/shreyas/ssd2/Networks/dirt/dirt/rasterise_ops.py", line 81, in rasterise_batch return _rasterise_module.rasterise( AttributeError: 'NoneType' object has no attribute 'rasterise'

I tried many suggestions on similar issues but couldnt get it to work. Would you have any ideas how to fix this? Thanks in advance!

shreyashampali commented 3 years ago

The problem was with the tensorflow installation. Basically, tensforflow-gpu wasn't installed correctly. Reinstalled TF-gpu and it worked!