tiny-cuda-nn icon indicating copy to clipboard operation
tiny-cuda-nn copied to clipboard

Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.

Open Zakaria1405 opened this issue 1 year ago • 3 comments

could someone help me understandind the problem: The GPU that i'm using is NVIDIA GeForce 3050. Cuda version 12.03 Compiler: Ubuntu 18.04 cmake version: 3.27

cmake . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -- The CXX compiler identification is GNU 7.5.0 CMake Error at /home/pgnerf23/anaconda3/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:753 (message): Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.

Compiler: /usr/bin/nvcc

Build flags:

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

The output was:

255

#$ SPACE=

#$ CUDART=cudart

#$ HERE=/usr/lib/nvidia-cuda-toolkit/bin

#$ THERE=/usr/lib/nvidia-cuda-toolkit/bin

#$ TARGET_SIZE=

#$ TARGET_DIR=

#$ TARGET_SIZE=64

#$ NVVMIR_LIBRARY_DIR=/usr/lib/nvidia-cuda-toolkit/libdevice

#$ PATH=/usr/lib/nvidia-cuda-toolkit/bin:/home/pgnerf23/anaconda3/bin:/home/pgnerf23/anaconda3/condabin:/home/pgnerf23/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

#$ LIBRARIES= -L/usr/lib/x86_64-linux-gnu/stubs

#$ rm tmp/a_dlink.reg.c

#$ gcc -std=c++14 -D__CUDA_ARCH__=300 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__ -D"CUDACC_VER_BUILD=85" -D"CUDACC_VER_MINOR=1" -D"CUDACC_VER_MAJOR=9" -include "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" > "tmp/CMakeCUDACompilerId.cpp1.ii"

#$ cicc --c++14 --gnu_version=70500 --allow_managed -arch compute_30 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "CMakeCUDACompilerId.fatbin.c" -tused -nvvmir-library "/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "tmp/CMakeCUDACompilerId.module_id" --orig_src_file_name "CMakeCUDACompilerId.cu" --gen_c_file_name "tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name "tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name "tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o "tmp/CMakeCUDACompilerId.ptx"

#$ ptxas -arch=sm_30 -m64 "tmp/CMakeCUDACompilerId.ptx" -o "tmp/CMakeCUDACompilerId.sm_30.cubin"

ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name'

--error 0xff --

Call Stack (most recent call first): /home/pgnerf23/anaconda3/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD) /home/pgnerf23/anaconda3/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test) /home/pgnerf23/anaconda3/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID) CMakeLists.txt:25 (project)

-- Configuring incomplete, errors occurred!

Zakaria1405 avatar Nov 06 '23 12:11 Zakaria1405

I have the same problem

ZkzMMDC avatar Nov 07 '23 08:11 ZkzMMDC

I solved the problem by installing the gcc-11 and giving this command: CC=/usr/bin/gcc-11 python setup.py install

i noticed that the path to the gcc is using an old version which is under the gcc-8

the Command fixed the error but i‘m still searching how to change the gcc path for all instances

Zakaria1405 avatar Nov 07 '23 08:11 Zakaria1405

My environment is gcc-9. I solved the problem by using the command: cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.8/bin/nvcc

however the next step:cmake --build build --config RelWithDebInfo -j have the problem: /home/zkz/tiny-cuda-nn/dependencies/cutlass/include/cute/util/type_traits.hpp(62): error: namespace "std" has no member "conjunction"

/home/zkz/tiny-cuda-nn/dependencies/cutlass/include/cute/util/type_traits.hpp(63): error: namespace "std" has no member "conjunction_v"

and so on

I don't know what's wrong? Do you have some idea?

ZkzMMDC avatar Nov 07 '23 08:11 ZkzMMDC