NVlabs / instant-ngp

Instant neural graphics primitives: lightning fast NeRF and more

Home Page:https://nvlabs.github.io/instant-ngp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shoud it need to set `CUDA_NVCC_EXECUTABLE` manually?

somisawa opened this issue · comments

Environment: Ubuntu 20.04
GPU: RTX 3090
CUDA: v11.6

When I ran the commandcmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.6/bin/nvcc, my GPU was not detected and it returns;

-- Automatic GPU detection failed. Building for common architectures.
-- Targeting GPU architectures: 30;35;50;52+PTX
CMake Warning at dependencies/tiny-cuda-nn/CMakeLists.txt:105 (message):
  Fully fused MLPs do not support GPU architectures of 70 or less.  Falling
  back to CUTLASS MLPs.  Remove GPU architectures 70 and lower to allow
  maximum performance

I fixed this by setting CUDA_NVCC_EXECUTABLE mannually like cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.6/bin/nvcc -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-11.6/bin/nvcc
because in path/to/NVIDIA-OptiX-SDK-7.4.0-linux64-x86_64/SDK/CMake/FindCUDA/select_compute_arch.cmake,

execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${cufile}"
                WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out
                ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

dont work due to CUDA_NVCC_EXECUTABLE is empty in my case. Unfortunately, there are few resources about CUDA_NVCC_EXECUTABLE on web and I'd like to know what you expected in ordinal case. Is it my own environmental problem around CUDA?

Thanks!

Plus, by also setting CUDA_VERSION mannually, repo finally works with RTX 3090!

I would think some environmental variables related to cuda, which is needed for this package, is not set in the ordinal installation way of cuda.

Next, I will try to make Dockerfile to accumulate my knowledge.

commented

I had this problem because the system gcc/g++ was version 11 but cuda requires version <=10.