instant-ngp icon indicating copy to clipboard operation
instant-ngp copied to clipboard

Failed to detect a default CUDA architecture.

Open Derick317 opened this issue 2 years ago • 2 comments

When I am running:

$ cmake . -B build
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- The CUDA compiler identification is unknown
CMake Error at /usr/local/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:633 (message):
  Failed to detect a default CUDA architecture.

  Compiler output:

Call Stack (most recent call first):
  CMakeLists.txt:11 (PROJECT)

-- Configuring incomplete, errors occurred!
See also "xxx/instant-NeRF/instant-ngp/build/CMakeFiles/CMakeOutput.log".
See also "xxx/instant-NeRF/instant-ngp/build/CMakeFiles/CMakeError.log".

Then I used:

$ cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.5/bin/nvcc
CMake Error at /usr/local/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:311 (message):
  CMAKE_CUDA_ARCHITECTURES must be valid if set.
Call Stack (most recent call first):
  CMakeLists.txt:11 (PROJECT)

-- Configuring incomplete, errors occurred!
See also "xxx/instant-NeRF/instant-ngp/build/CMakeFiles/CMakeOutput.log".
See also "xxx/instant-NeRF/instant-ngp/build/CMakeFiles/CMakeError.log".

Then I set the TCNN_CUDA_ARCHITECTURES enivonment variable:

$ cmake . -TCNN_CUDA_ARCHITECTURES=61 -B build
CMake Error at CMakeLists.txt:11 (PROJECT):
  Generator

    Unix Makefiles

  does not support toolset specification, but toolset

    CNN_CUDA_ARCHITECTURES=61

  was specified.


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CUDA_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "xxx/instant-ngp/build/CMakeFiles/CMakeOutput.log".

My system is Ubuntu 20.04.1, the version of CMake is 3.23.2.

Derick317 avatar Jun 21 '22 14:06 Derick317

You incorrectly set the TCNN_CUDA_ARCHITECTURES environment variable (needs a "D" before the variable name) try this instead: cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.5/bin/nvcc -DTCNN_CUDA_ARCHITECTURES=61 .

javieryu avatar Jul 09 '22 13:07 javieryu

I was able to resolve this error by lowering the version of cmake to 3.22.6. When using snap, the following method worked. My system is 18.04.6 LTS, the version of CMake is 3.22.6.

snap remove cmake
snap info cmake
sudo snap install cmake --channel=3.22/stable --classic
export CUDACXX=/usr/local/cuda-11.6/bin/nvcc
cmake . -B build

flow-dev avatar Jul 30 '22 14:07 flow-dev