pmh47 / dirt

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

none of 2 egl devices matches the active cuda device #60

Closed ffiioonnaa closed 4 years ago

ffiioonnaa commented 4 years ago

Hi: Thanks for your excellent work! After 'pip install . ' I encountered an error: none of 2 egl devices matches the active cuda device. I 've seen other issues about this error ,but it seems the CMakeCache.txt has changed, and I'am not sure how to change it. Can you help me see what the problem is? My configuration: Ubuntu 18.04 pthyon3.6 tensorflow1.13.1 CUDA10.0 nvidia driver 430

2020-04-07 22:11:01.303225: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2020-04-07 22:11:01.412846: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-04-07 22:11:01.413572: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x1c92240 executing computations on platform CUDA. Devices: 2020-04-07 22:11:01.413591: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): GeForce RTX 2070 SUPER, Compute Capability 7.5 2020-04-07 22:11:01.433204: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3192000000 Hz 2020-04-07 22:11:01.433877: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x1ccd090 executing computations on platform Host. Devices: 2020-04-07 22:11:01.433896: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): , 2020-04-07 22:11:01.434043: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties: name: GeForce RTX 2070 SUPER major: 7 minor: 5 memoryClockRate(GHz): 1.815 pciBusID: 0000:01:00.0 totalMemory: 7.79GiB freeMemory: 7.41GiB 2020-04-07 22:11:01.434055: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2020-04-07 22:11:01.434522: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-04-07 22:11:01.434531: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 2020-04-07 22:11:01.434535: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N 2020-04-07 22:11:01.434609: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7211 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2070 SUPER, pci bus id: 0000:01:00.0, compute capability: 7.5) 2020-04-07 22:11:01.527928: F /home/zhao/render/dirt-master/csrc/gl_common.h:65] none of 2 egl devices matches the active cuda device

ldd dirt/librasterise.so

linux-vdso.so.1 (0x00007fff0e183000) /usr/lib/x86_64-linux-gnu/libGLEW.so (0x00007f265c730000) libEGL.so.1 => /usr/lib/x86_64-linux-gnu/libEGL.so.1 (0x00007f265c51c000) libOpenGL.so.0 => /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007f265c2ee000) libtensorflow_framework.so => not found librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f265c0e6000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f265bec7000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f265bcc3000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f265b93a000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f265b59c000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f265b384000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f265af93000) /lib64/ld-linux-x86-64.so.2 (0x00007f265ccd6000) libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f265ad07000) libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f265aa51000) libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f265a820000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f265a4e8000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f265a2c0000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f265a0bc000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f2659eb6000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f2659ca1000)

and I find nvidia-430 folder in /usr/src rather than /usr/lib. ls -l /usr/lib//GL*

lrwxrwxrwx 1 root root 20 2月 19 13:09 /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0 -> libEGL_mesa.so.0.0.0 -rw-r--r-- 1 root root 259480 2月 19 13:09 /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0.0.0 lrwxrwxrwx 1 root root 15 5月 10 2019 /usr/lib/x86_64-linux-gnu/libEGL.so -> libEGL.so.1.0.0 lrwxrwxrwx 1 root root 15 10月 13 23:09 /usr/lib/x86_64-linux-gnu/libEGL.so.1 -> libEGL.so.1.0.0 -rw-r--r-- 1 root root 80448 5月 10 2019 /usr/lib/x86_64-linux-gnu/libEGL.so.1.0.0 lrwxrwxrwx 1 root root 22 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLdispatch.so -> libGLdispatch.so.0.0.0 lrwxrwxrwx 1 root root 22 10月 13 23:09 /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 -> libGLdispatch.so.0.0.0 -rw-r--r-- 1 root root 612792 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0.0.0 lrwxrwxrwx 1 root root 21 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLESv1_CM.so -> libGLESv1_CM.so.1.0.0 lrwxrwxrwx 1 root root 21 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.0.0 -rw-r--r-- 1 root root 43328 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1.0.0 lrwxrwxrwx 1 root root 18 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLESv2.so -> libGLESv2.so.2.0.0 lrwxrwxrwx 1 root root 18 10月 13 23:09 /usr/lib/x86_64-linux-gnu/libGLESv2.so.2 -> libGLESv2.so.2.0.0 -rw-r--r-- 1 root root 72000 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLESv2.so.2.0.0 lrwxrwxrwx 1 root root 16 8月 25 2017 /usr/lib/x86_64-linux-gnu/libGLEW.so -> libGLEW.so.2.0.0 lrwxrwxrwx 1 root root 16 8月 25 2017 /usr/lib/x86_64-linux-gnu/libGLEW.so.2.0 -> libGLEW.so.2.0.0 -rw-r--r-- 1 root root 587816 8月 25 2017 /usr/lib/x86_64-linux-gnu/libGLEW.so.2.0.0 lrwxrwxrwx 1 root root 14 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGL.so -> libGL.so.1.0.0 lrwxrwxrwx 1 root root 14 10月 13 23:09 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.1.0.0 -rw-r--r-- 1 root root 567624 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0 -rw-r--r-- 1 root root 926218 5月 22 2016 /usr/lib/x86_64-linux-gnu/libGLU.a lrwxrwxrwx 1 root root 15 5月 22 2016 /usr/lib/x86_64-linux-gnu/libGLU.so -> libGLU.so.1.3.1 lrwxrwxrwx 1 root root 15 10月 13 23:09 /usr/lib/x86_64-linux-gnu/libGLU.so.1 -> libGLU.so.1.3.1 -rw-r--r-- 1 root root 453352 5月 22 2016 /usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1 lrwxrwxrwx 1 root root 16 2月 19 13:09 /usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0 -> libGLX_mesa.so.0 lrwxrwxrwx 1 root root 20 2月 19 13:09 /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0 -> libGLX_mesa.so.0.0.0 -rw-r--r-- 1 root root 488344 2月 19 13:09 /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0.0.0 lrwxrwxrwx 1 root root 15 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLX.so -> libGLX.so.0.0.0 lrwxrwxrwx 1 root root 15 10月 13 23:09 /usr/lib/x86_64-linux-gnu/libGLX.so.0 -> libGLX.so.0.0.0 -rw-r--r-- 1 root root 68144 5月 10 2019 /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0 lrwxrwxrwx 1 root root 18 5月 10 2019 /usr/lib/x86_64-linux-gnu/libOpenGL.so -> libOpenGL.so.0.0.0 lrwxrwxrwx 1 root root 18 5月 10 2019 /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 -> libOpenGL.so.0.0.0 -rw-r--r-- 1 root root 186688 5月 10 2019 /usr/lib/x86_64-linux-gnu/libOpenGL.so.0.0.0 -rw-r--r-- 1 root root 1031876 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGLExtensions.a -rw-r--r-- 1 root root 1135 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGLExtensions.prl -rw-r--r-- 1 root root 1151 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.prl lrwxrwxrwx 1 root root 21 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so -> libQt5OpenGL.so.5.9.5 lrwxrwxrwx 1 root root 21 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 -> libQt5OpenGL.so.5.9.5 lrwxrwxrwx 1 root root 21 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5.9 -> libQt5OpenGL.so.5.9.5 -rw-r--r-- 1 root root 353760 2月 7 23:41 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5.9.5 lrwxrwxrwx 1 root root 20 5月 24 2016 /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 -> libQtOpenGL.so.4.8.7 lrwxrwxrwx 1 root root 20 5月 24 2016 /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4.8 -> libQtOpenGL.so.4.8.7 -rw-r--r-- 1 root root 1052024 5月 24 2016 /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4.8.7 lrwxrwxrwx 1 root root 35 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkGUISupportQtOpenGL-6.3.so -> libvtkGUISupportQtOpenGL-6.3.so.6.3 lrwxrwxrwx 1 root root 37 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkGUISupportQtOpenGL-6.3.so.6.3 -> libvtkGUISupportQtOpenGL-6.3.so.6.3.0 -rw-r--r-- 1 root root 85416 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkGUISupportQtOpenGL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 39 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGL-6.3.so -> libvtkRenderingContextOpenGL-6.3.so.6.3 lrwxrwxrwx 1 root root 41 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGL-6.3.so.6.3 -> libvtkRenderingContextOpenGL-6.3.so.6.3.0 -rw-r--r-- 1 root root 200312 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 48 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGLPython27D-6.3.so -> libvtkRenderingContextOpenGLPython27D-6.3.so.6.3 lrwxrwxrwx 1 root root 50 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGLPython27D-6.3.so.6.3 -> libvtkRenderingContextOpenGLPython27D-6.3.so.6.3.0 -rw-r--r-- 1 root root 14840 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGLPython27D-6.3.so.6.3.0 lrwxrwxrwx 1 root root 42 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGLTCL-6.3.so -> libvtkRenderingContextOpenGLTCL-6.3.so.6.3 lrwxrwxrwx 1 root root 44 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGLTCL-6.3.so.6.3 -> libvtkRenderingContextOpenGLTCL-6.3.so.6.3.0 -rw-r--r-- 1 root root 14648 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingContextOpenGLTCL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 31 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGL2PS-6.3.so -> libvtkRenderingGL2PS-6.3.so.6.3 lrwxrwxrwx 1 root root 33 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGL2PS-6.3.so.6.3 -> libvtkRenderingGL2PS-6.3.so.6.3.0 -rw-r--r-- 1 root root 113840 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGL2PS-6.3.so.6.3.0 lrwxrwxrwx 1 root root 40 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGL2PSPython27D-6.3.so -> libvtkRenderingGL2PSPython27D-6.3.so.6.3 lrwxrwxrwx 1 root root 42 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGL2PSPython27D-6.3.so.6.3 -> libvtkRenderingGL2PSPython27D-6.3.so.6.3.0 -rw-r--r-- 1 root root 23264 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGL2PSPython27D-6.3.so.6.3.0 lrwxrwxrwx 1 root root 35 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGLtoPSTCL-6.3.so -> libvtkRenderingGLtoPSTCL-6.3.so.6.3 lrwxrwxrwx 1 root root 37 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGLtoPSTCL-6.3.so.6.3 -> libvtkRenderingGLtoPSTCL-6.3.so.6.3.0 -rw-r--r-- 1 root root 18752 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingGLtoPSTCL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 32 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGL-6.3.so -> libvtkRenderingOpenGL-6.3.so.6.3 lrwxrwxrwx 1 root root 34 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGL-6.3.so.6.3 -> libvtkRenderingOpenGL-6.3.so.6.3.0 -rw-r--r-- 1 root root 2734512 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 41 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGLPython27D-6.3.so -> libvtkRenderingOpenGLPython27D-6.3.so.6.3 lrwxrwxrwx 1 root root 43 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGLPython27D-6.3.so.6.3 -> libvtkRenderingOpenGLPython27D-6.3.so.6.3.0 -rw-r--r-- 1 root root 1005760 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGLPython27D-6.3.so.6.3.0 lrwxrwxrwx 1 root root 35 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGLTCL-6.3.so -> libvtkRenderingOpenGLTCL-6.3.so.6.3 lrwxrwxrwx 1 root root 37 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGLTCL-6.3.so.6.3 -> libvtkRenderingOpenGLTCL-6.3.so.6.3.0 -rw-r--r-- 1 root root 727128 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingOpenGLTCL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 38 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGL-6.3.so -> libvtkRenderingVolumeOpenGL-6.3.so.6.3 lrwxrwxrwx 1 root root 40 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGL-6.3.so.6.3 -> libvtkRenderingVolumeOpenGL-6.3.so.6.3.0 -rw-r--r-- 1 root root 685800 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGL-6.3.so.6.3.0 lrwxrwxrwx 1 root root 47 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGLPython27D-6.3.so -> libvtkRenderingVolumeOpenGLPython27D-6.3.so.6.3 lrwxrwxrwx 1 root root 49 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGLPython27D-6.3.so.6.3 -> libvtkRenderingVolumeOpenGLPython27D-6.3.so.6.3.0 -rw-r--r-- 1 root root 129792 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGLPython27D-6.3.so.6.3.0 lrwxrwxrwx 1 root root 41 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGLTCL-6.3.so -> libvtkRenderingVolumeOpenGLTCL-6.3.so.6.3 lrwxrwxrwx 1 root root 43 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGLTCL-6.3.so.6.3 -> libvtkRenderingVolumeOpenGLTCL-6.3.so.6.3.0 -rw-r--r-- 1 root root 92944 12月 18 2017 /usr/lib/x86_64-linux-gnu/libvtkRenderingVolumeOpenGLTCL-6.3.so.6.3.0

Thanks again. I will be appreciated for your reply as soon as possible, thank you very much!

pmh47 commented 4 years ago

It looks like the Nvidia OpenGL libraries are missing -- there should be files like libEGL_nvidia.so.0 in /usr/lib/x86_64-linux-gnu. I think if you reinstall the nvidia driver using the Ubuntu package version, not the nvidia runfile, then it will fix this. Otherwise, see if the libraries are somewhere non-standard, by doing find / -name *GL*nvidia* -- which will search the whole system for them.

ffiioonnaa commented 4 years ago

It works! Thanks for replying so quickly!

ffiioonnaa commented 4 years ago

And another question, I want to render a batch of meshes after reconstruct them, and then to calculate the loss with the rendered images, can dirt do that? and the mesh has several part not just one manifold. thanks.

pmh47 commented 4 years ago

Yes, DIRT will render a batch of meshes with rasterise_batch, then you calculate the loss in the usual way (e.g. mean square difference) on the resulting images in tensorflow. DIRT will ensure the correct gradient backpropagates through the rendering. Yes, non-manifold meshes are ok. If you have other problems/questions, please open a new ticket!