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

MAKE_CUDA_ARCHITECTURES must be non-empty if set.

Open narviii opened this issue 2 years ago • 17 comments

Getting this error when trying to compile it on Ubuntu. Cuda is installed ( v 11.3), did everything according to the readme. What might be wrong?

Full error text:

CMake Error at /usr/share/cmake-3.24/Modules/CMakeDetermineCUDACompiler.cmake:277 (message): CMAKE_CUDA_ARCHITECTURES must be non-empty if set. Call Stack (most recent call first): CMakeLists.txt:11 (project)

-- Configuring incomplete, errors occurred! See also "/home/narvi/apps/instant-ngp/build/CMakeFiles/CMakeOutput.log". See also "/home/narvi/apps/instant-ngp/build/CMakeFiles/CMakeError.log".

narviii avatar Dec 28 '22 07:12 narviii

Can you try again after updating to the latest commit?

git pull origin master
git submodule update --recursive

Tom94 avatar Dec 30 '22 14:12 Tom94

Same error:(

CMake Error at /usr/share/cmake-3.24/Modules/CMakeDetermineCUDACompiler.cmake:277 (message):
  CMAKE_CUDA_ARCHITECTURES must be non-empty if set.
Call Stack (most recent call first):
  CMakeLists.txt:11 (project)


-- Configuring incomplete, errors occurred!
See also "/home/narvi/apps/instant-ngp/build/CMakeFiles/CMakeOutput.log".
See also "/home/narvi/apps/instant-ngp/build/CMakeFiles/CMakeError.log".
(base) narvi@narviBUBUNTU:~/apps/instant-ngp$ 

narviii avatar Dec 31 '22 02:12 narviii

same

XinyueZ avatar Jan 13 '23 07:01 XinyueZ

Also have this same exact error after running make . -B build

I have all prereqs installed.

Ubuntu version:

Distributor ID:	Ubuntu
Description:	Ubuntu 22.10
Release:	22.10
Codename:	kinetic

gcc version: gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0

cmake: cmake version 3.24.2

nvidia-smi:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.13    Driver Version: 525.60.13    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:09:00.0  On |                  N/A |
|  0%   47C    P5    22W / 240W |   1596MiB /  8192MiB |     29%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

tywenk avatar Jan 29 '23 04:01 tywenk

I had to delete the previous build, add the cuda paths in my bashrc, rebuild it and it worked.

tom-bu avatar Feb 17 '23 02:02 tom-bu

I had to delete the previous build, add the cuda paths in my bashrc, rebuild it and it worked.

work, thk~

Luoyingfeng8 avatar Mar 03 '23 08:03 Luoyingfeng8

@tom-bu Can you please say exactly what you added to .bashrc?

ghost avatar Mar 05 '23 14:03 ghost

I have encountered this problem before when I was installing COLMAP. To solve it: rm -r /path/to/instant-ngp/build to delete previous build files vim /path/to/instant-ngp/CMakeList.txt add set(CMAKE_CUDA_ARCHITECTURES "native") under the project()code block save txt and recompile for more information

difficulToName avatar Mar 30 '23 02:03 difficulToName

two steps to solve the problem:

  1. delete the build folder
  2. run: cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.1/bin/nvcc -DTCNN_CUDA_ARCHITECTURES=61

Fernweh-yang avatar Apr 30 '23 02:04 Fernweh-yang

@tom-bu Can you please say exactly what you added to .bashrc?

Add your nvcc executable to PATH. In my environment, it is export PATH=$PATH:/usr/local/cuda/bin.

xpmemeda avatar Jul 11 '23 08:07 xpmemeda

Using Anaconda/Linux:

I solved my problem as below:

rm -rf build 

conda install -c nvidia cuda-toolkit

cmake . -B build -DCMAKE_CUDA_COMPILER=$(which nvcc)

amughrabi avatar Aug 21 '23 15:08 amughrabi

Using Anaconda/Linux:

I solved my problem as below:

rm -rf build 

conda install -c nvidia cuda-toolkit

cmake . -B build -DCMAKE_CUDA_COMPILER=$(which nvcc)

You are my HERO. You are the best. Thank You Thank You. I'm crying ;;;;;;((((( THX THX

nocnestudio avatar Dec 15 '23 21:12 nocnestudio

Sorry for the basic question, but when I run the cmake command it tells me I need a build directory and I need the CMakeList.txt file in it. Am I correct to assume that after deleting the build directory, I need to use mkdir again and then move CMakeList.txt into that directory?

sundeco avatar Dec 22 '23 17:12 sundeco

@tom-bu Can you please say exactly what you added to .bashrc?您能具体说明一下您添加到 .bashrc 中的内容吗?

export PATH="/usr/local/cuda/bin:$PATH" export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

Nuclear6 avatar Dec 27 '23 12:12 Nuclear6

I deleted the build directory, then it worked.

shink avatar Apr 30 '24 07:04 shink

I had to delete the previous build, add the cuda paths in my bashrc, rebuild it and it worked.

This works, thanks so much.

d-bharadwaj avatar May 30 '24 20:05 d-bharadwaj

If you compile multiple libraries at the same time, you need to delete the build inside onnxruntime directory. Because in my case, when I deleted build out of onnxruntime directory, nothing changed.

iamstarlee avatar Jul 13 '24 06:07 iamstarlee