pmh47 / dirt

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

Error when pip install . #78

Open WMCh opened 4 years ago

WMCh commented 4 years ago

Hi, when I run command pip install ., the error information is as below:

Building wheels for collected packages: dirt
  Building wheel for dirt (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-j0o7f_v0/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-j0o7f_v0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-q6nao4wf
       cwd: /tmp/pip-req-build-j0o7f_v0/
  Complete output (49 lines):
  running bdist_wheel
  running build
  -- The CXX compiler identification is GNU 5.4.0
  -- The CUDA compiler identification is NVIDIA 9.0.176
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Detecting CUDA compiler ABI info
  -- Detecting CUDA compiler ABI info - done
  -- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
  -- Detecting CUDA compile features
  -- Detecting CUDA compile features - done
  CMake Error at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
    Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY)
  Call Stack (most recent call first):
    /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
    /usr/local/share/cmake-3.18/Modules/FindOpenGL.cmake:427 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    CMakeLists.txt:5 (find_package)

  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-req-build-j0o7f_v0/build/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-req-build-j0o7f_v0/setup.py", line 50, in <module>
      'Programming Language :: Python :: 3.7',
    File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.6/dist-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-req-build-j0o7f_v0/setup.py", line 24, in run
      build_csrc()
    File "/tmp/pip-req-build-j0o7f_v0/setup.py", line 18, in build_csrc
      subprocess.check_call(['cmake', os.path.join(base_path, 'csrc')], cwd=build_path)
    File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-j0o7f_v0/csrc']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for dirt
  Running setup.py clean for dirt
Failed to build dirt
Installing collected packages: dirt
    Running setup.py install for dirt ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-j0o7f_v0/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-j0o7f_v0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rgqpzfh2/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/dirt
         cwd: /tmp/pip-req-build-j0o7f_v0/
    Complete output (39 lines):
    running install
    running build
    CMake Error at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
      Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY)
    Call Stack (most recent call first):
      /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
      /usr/local/share/cmake-3.18/Modules/FindOpenGL.cmake:427 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
      CMakeLists.txt:5 (find_package)

    -- Configuring incomplete, errors occurred!
    See also "/tmp/pip-req-build-j0o7f_v0/build/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-j0o7f_v0/setup.py", line 50, in <module>
        'Programming Language :: Python :: 3.7',
      File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
        self.run_command('build')
      File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-j0o7f_v0/setup.py", line 24, in run
        build_csrc()
      File "/tmp/pip-req-build-j0o7f_v0/setup.py", line 18, in build_csrc
        subprocess.check_call(['cmake', os.path.join(base_path, 'csrc')], cwd=build_path)
      File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-j0o7f_v0/csrc']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-j0o7f_v0/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-j0o7f_v0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rgqpzfh2/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/dirt Check the logs for full command output.

I have referenced to other issues and made some effort, but it doesn't work. The output of ls -l /usr/lib/*/*GL* is:

lrwxrwxrwx 1 root root      23 May 25 15:00 /usr/lib/i386-linux-gnu/libEGL_nvidia.so.0 -> libEGL_nvidia.so.418.56
-rwxr-xr-x 1 root root  991356 Oct 11  2019 /usr/lib/i386-linux-gnu/libEGL_nvidia.so.418.56
lrwxrwxrwx 1 root root      29 May 25 15:00 /usr/lib/i386-linux-gnu/libGLESv1_CM_nvidia.so.1 -> libGLESv1_CM_nvidia.so.418.56
-rwxr-xr-x 1 root root   48112 Oct 11  2019 /usr/lib/i386-linux-gnu/libGLESv1_CM_nvidia.so.418.56
lrwxrwxrwx 1 root root      26 May 25 15:00 /usr/lib/i386-linux-gnu/libGLESv2_nvidia.so.2 -> libGLESv2_nvidia.so.418.56
-rwxr-xr-x 1 root root   87820 Oct 11  2019 /usr/lib/i386-linux-gnu/libGLESv2_nvidia.so.418.56
lrwxrwxrwx 1 root root      23 May 25 15:00 /usr/lib/i386-linux-gnu/libGLX_indirect.so.0 -> libGLX_nvidia.so.418.56
lrwxrwxrwx 1 root root      23 May 25 15:00 /usr/lib/i386-linux-gnu/libGLX_nvidia.so.0 -> libGLX_nvidia.so.418.56
-rwxr-xr-x 1 root root 1140572 Oct 11  2019 /usr/lib/i386-linux-gnu/libGLX_nvidia.so.418.56
lrwxrwxrwx 1 root root      18 Jun 15  2018 /usr/lib/x86_64-linux-gnu/libEGL.so -> mesa-egl/libEGL.so
lrwxrwxrwx 1 root root      23 May 25 15:00 /usr/lib/x86_64-linux-gnu/libEGL_nvidia.so.0 -> libEGL_nvidia.so.418.56
-rwxr-xr-x 1 root root 1210304 Oct 11  2019 /usr/lib/x86_64-linux-gnu/libEGL_nvidia.so.418.56
lrwxrwxrwx 1 root root      13 Jun 15  2018 /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so
lrwxrwxrwx 1 root root      29 May 25 15:00 /usr/lib/x86_64-linux-gnu/libGLESv1_CM_nvidia.so.1 -> libGLESv1_CM_nvidia.so.418.56
-rwxr-xr-x 1 root root   60832 Oct 11  2019 /usr/lib/x86_64-linux-gnu/libGLESv1_CM_nvidia.so.418.56
lrwxrwxrwx 1 root root      21 Jun 15  2018 /usr/lib/x86_64-linux-gnu/libGLESv2.so -> mesa-egl/libGLESv2.so
lrwxrwxrwx 1 root root      26 May 25 15:00 /usr/lib/x86_64-linux-gnu/libGLESv2_nvidia.so.2 -> libGLESv2_nvidia.so.418.56
-rwxr-xr-x 1 root root  110784 Oct 11  2019 /usr/lib/x86_64-linux-gnu/libGLESv2_nvidia.so.418.56
-rw-r--r-- 1 root root  911218 Oct 24  2015 /usr/lib/x86_64-linux-gnu/libGLU.a
lrwxrwxrwx 1 root root      15 Oct 24  2015 /usr/lib/x86_64-linux-gnu/libGLU.so -> libGLU.so.1.3.1
lrwxrwxrwx 1 root root      15 Oct 24  2015 /usr/lib/x86_64-linux-gnu/libGLU.so.1 -> libGLU.so.1.3.1
-rw-r--r-- 1 root root  453352 Oct 24  2015 /usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
lrwxrwxrwx 1 root root      23 May 25 15:00 /usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0 -> libGLX_nvidia.so.418.56
lrwxrwxrwx 1 root root      23 May 25 15:00 /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0 -> libGLX_nvidia.so.418.56
-rwxr-xr-x 1 root root 1275632 Oct 11  2019 /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.418.56

Is there any advice? Thank you very much!

pmh47 commented 4 years ago

libOpenGL.so is missing. Thus, your nvidia driver/opengl installation is broken. You need to reinstall the driver, or see if libOpenGL.so has perhaps been put in a non-standard location (just searching the whole system for *GL* is simplest). What linux distro are you using?

WMCh commented 4 years ago

libOpenGL.so is missing. Thus, your nvidia driver/opengl installation is broken. You need to reinstall the driver, or see if libOpenGL.so has perhaps been put in a non-standard location (just searching the whole system for *GL* is simplest). What linux distro are you using?

I appreciate your reply. I've searched the whole system for the libOpenGL.so and it turns out to be missing. However, the command nvidia-smi works (it shows my driver version is 418.56) and other tensorflow codes run well. Does it mean that my nvidia driver is OK? I installed the OpenGL with the apt-get command as the Internet told me. In addition, my linux distro is Ubuntu 16.04.

pmh47 commented 4 years ago

libOpenGL.so is included in the nvidia driver installation, so something has gone wrong, even if cuda stuff works. It is quite easy to 'lose' the GL libraries as they can be overwritten by other packages like mesa (installing OpenGL/etc. through apt can actually make the situation worse, as this can overwrite the nvidia version). If you can reinstall the driver, that should fix the problem.

MengHao666 commented 4 years ago

nsorflow codes run well. Does it

have you solved the problem?

WMCh commented 4 years ago

nsorflow codes run well. Does it

have you solved the problem?

It seemed that my NVIDIA driver was broken as @pmh47 said. The problem was fixed when I changed another docker image. Maybe you can try to reinstall the driver.