pmh47 / dirt

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

Unable to compile #118

Open BukuBukuChagma opened 8 months ago

BukuBukuChagma commented 8 months ago

When I run cmake ../crsc

Heres the output ;

CMake Error at /home/zen/anaconda3/envs/tf/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:751 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

  Compiler: /home/zen/anaconda3/envs/tf/bin/nvcc

  Build flags:

  Id flags: --keep;--keep-dir;tmp -v

  The output was:

  1

  #$ _NVVM_BRANCH_=nvvm

  #$ _SPACE_=

  #$ _CUDART_=cudart

  #$ _HERE_=/home/zen/anaconda3/envs/tf/bin

  #$ _THERE_=/home/zen/anaconda3/envs/tf/bin

  #$ _TARGET_SIZE_=

  #$ _TARGET_DIR_=

  #$ _TARGET_SIZE_=64

  #$ TOP=/home/zen/anaconda3/envs/tf/bin/..

  #$ NVVMIR_LIBRARY_DIR=/home/zen/anaconda3/envs/tf/bin/../nvvm/libdevice

  #$
  LD_LIBRARY_PATH=/home/zen/anaconda3/envs/tf/bin/../lib::/home/zen/anaconda3/envs/tf/lib/

  #$
  PATH=/home/zen/anaconda3/envs/tf/bin/../nvvm/bin:/home/zen/anaconda3/envs/tf/bin:/home/zen/anaconda3/envs/tf/bin:/home/zen/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

  #$ INCLUDES="-I/home/zen/anaconda3/envs/tf/bin/../include"

  #$ LIBRARIES= "-L/home/zen/anaconda3/envs/tf/bin/../lib/stubs"
  "-L/home/zen/anaconda3/envs/tf/bin/../lib"

  #$ CUDAFE_FLAGS=

  #$ PTXAS_FLAGS=

  #$ rm tmp/a_dlink.reg.c

  #$ gcc -D__CUDA_ARCH__=520 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS
  -D__CUDACC__ -D__NVCC__ "-I/home/zen/anaconda3/envs/tf/bin/../include"
  -D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=3
  -D__CUDACC_VER_BUILD__=58 -D__CUDA_API_VER_MAJOR__=11
  -D__CUDA_API_VER_MINOR__=3 -include "cuda_runtime.h" -m64
  "CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii"

  <command-line>: fatal error: cuda_runtime.h: No such file or directory

  compilation terminated.

  # --error 0x1 --

Call Stack (most recent call first):
  /home/zen/anaconda3/envs/tf/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /home/zen/anaconda3/envs/tf/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
  /home/zen/anaconda3/envs/tf/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!

I don't know what I'm doing wrong. Any help would be appreciated.

manuelbirlo commented 5 months ago

It seems that the cuda_runtime.h file is not being found, which is a part of the CUDA Toolkit and required for compiling CUDA applications. I assume that either the CUDA Toolkit is not installed correctly, or CMake cannot find cuda_runtime.h. You can check with 'nvcc --version' whether your CUDA Toolkit is correctly installed. Also make sure that your LD_LIBRARY_PATH environment variable includes the path to the CUDA Toolkit libraries: export PATH=/usr/local/cuda/bin:${PATH} export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}