pmh47 / dirt

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

Cmake error #36

Closed tai61031 closed 5 years ago

tai61031 commented 5 years ago

cmake ../csrc/ -D_OPENGL_LIB_PATH=/usr/lib/nvidia-410 -- The CXX compiler identification is GNU 5.4.0 -- The CUDA compiler identification is NVIDIA 9.0.176 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working CUDA compiler: /usr/bin/nvcc -- Check for working CUDA compiler: /usr/bin/nvcc -- works -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Found OpenGL: /usr/lib/nvidia-410/libOpenGL.so found components: OpenGL EGL -- Configuring done CMake Warning at CMakeLists.txt:42 (add_library): Cannot generate a safe runtime search path for target rasterise because files in some directories may conflict with libraries in implicit directories:

runtime library [libEGL.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /usr/lib/nvidia-410

Some of these libraries may not be found correctly.

-- Generating done

pmh47 commented 5 years ago

Note that this is a warning not an error; sometimes DIRT will still work when it happens.

The warning means you have two versions of OpenGL, system and nvidia, and they aren't "tied together" by GLVND. To avoid the warning, you need to tell cmake not to look in /usr/lib/x86_64-linux at all when searching for OpenGL libraries, which can't be done (AFAIK) without modifying FindOpenGL itself.

If it does crash at runtime (because system libEGL is picked up at runtime instead of nvidia's), you can try with LD_PRELOAD=/usr/lib/nvidia-410/libEGL.so python square_test.py.

If that fails, please run

import dirt.rasterise_ops
import subprocess
subprocess.call(['ldd', dirt.rasterise_ops._lib_path + '/librasterise.so'])

and paste the output here.

tai61031 commented 5 years ago

This warning will cause the core dumped error when running the testing code i just solved this by cmake ../csrc/ -D_OPENGL_LIB_PATH=/usr/lib/nvidia-410 -DCMAKE_LIBRARY_PATH=/usr/lib/nvidia-410

thank you!