Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"CMakeCUDACompilerId.cu" failed. #923

Open
paulgnz opened this issue Sep 2, 2022 · 9 comments
Open

"CMakeCUDACompilerId.cu" failed. #923

paulgnz opened this issue Sep 2, 2022 · 9 comments

Comments

@paulgnz
Copy link

paulgnz commented Sep 2, 2022

I get this error when trying to cmake

------ System -----

Intel i9, RTX 3070
Windows 10
nvcc --version = V10.2.89
python --version = Python 3.10.2

Developer Command Prompt for VS 2019

Tried uninstalling everything, installing from scratch etc

------ Error -----

C:\ngp>cd instant-ngp

C:\ngp\instant-ngp>cmake . -B build
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:739 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.

Compiler:

Build flags:

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

The output was:

1

Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/2/2022 10:00:34 PM.

Project
"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
on node 1 (default targets).

PrepareForBuild:

Creating directory "Debug\".
Creating directory "Debug\CompilerIdCUDA.tlog\".

InitializeBuildStatus:

Creating "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

AddCudaCompileDeps:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" /I. /FIcuda_runtime.h /c C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CMakeCUDACompilerId.cu

Project
"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(1) is building
"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(1:2) on node 1 (CudaBuildCore target(s)).

CudaBuildCore:

Compiling CUDA source file CMakeCUDACompilerId.cu...
cmd.exe /C "C:\Users\Big Red\AppData\Local\Temp\tmp57729dd2ac15416dbec043081fdf7ebf.cmd"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"  -G   --keep-dir x64\Debug -maxrregcount=0  --machine 64 --compile -cudart static -v -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc142.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CMakeCUDACompilerId.cu"

C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"  -G   --keep-dir x64\Debug -maxrregcount=0  --machine 64 --compile -cudart static -v -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc142.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CMakeCUDACompilerId.cu"

C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA
10.2.targets(764,9): error MSB3721: The command ""C:\Program Files\NVIDIA
GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe"
-gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env -ccbin
"C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -G
--keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static
-v -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc142.pdb /FS /Zi
/RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj
"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CMakeCUDACompilerId.cu""
exited with code 1.
[C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

Done Building Project
"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(CudaBuildCore target(s)) -- FAILED.

Done Building Project
"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(default targets) -- FAILED.

Build FAILED.

"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(default target) (1) ->

"C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(CudaBuildCore target) (1:2) ->

(CudaBuildCore target) ->

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.2.targets(764,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"  -G   --keep-dir x64\Debug -maxrregcount=0  --machine 64 --compile -cudart static -v -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc142.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\ngp\instant-ngp\build\CMakeFiles\3.24.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj]



  0 Warning(s)
  1 Error(s)

Time Elapsed 00:00:01.52

Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:11 (project)

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

C:\ngp\instant-ngp>

@Pangolin112
Copy link

I also met this problem, still wondering what the problem is.

@nepfaff
Copy link

nepfaff commented Sep 26, 2022

Adding -D CMAKE_CUDA_COMPILER=$(which nvcc) to cmake fixed this for me:
cmake . -D TCNN_CUDA_ARCHITECTURES=86 -D CMAKE_CUDA_COMPILER=$(which nvcc) -B build

@Pangolin112
Copy link

_6A{5LZVAYA_S{ZRSRZKF}9
This way for my device(win11, cuda 11.7, 3070Ti[laptop]) the compiler can be found, but the error remains the same.

@MichalSzczekocki
Copy link

Adding -D CMAKE_CUDA_COMPILER=$(which nvcc) to cmake fixed this for me: cmake . -D TCNN_CUDA_ARCHITECTURES=86 -D CMAKE_CUDA_COMPILER=$(which nvcc) -B build

Hi. I'm also trying to fix it as they're dependencies that have to be resolved. I had the same problem as @Pangolin112 but after using command you recommended I got this error.

-- The CUDA compiler identification is NVIDIA 10.2.89
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- No release type specified. Setting to 'Release'.
-- Automatic GPU detection failed. Building for common architectures.
-- Obtained target architecture from CMake variable TCNN_CUDA_ARCHITECTURES=86
CMake Warning at dependencies/tiny-cuda-nn/CMakeLists.txt:118 (message):
CUDA version 10.2 is too low for architecture 86. Targeting architecture
75 instead.

-- Targeting GPU architectures: 75
-- Module support is disabled.
-- Version: 9.1.1
-- Build type: Release
CMake Error at dependencies/tiny-cuda-nn/dependencies/fmt/CMakeLists.txt:234 (target_compile_features):
target_compile_features no known features for CXX compiler

"GNU"

version 8.4.0.

-- Found Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so (found version "1.3.204") missing components: glslc glslangValidator
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using X11 for window creation
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found GLEW: /usr/include (found version "2.2.0")
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- OptiX headers (optix.h and friends) not found.
CMake Warning at CMakeLists.txt:194 (message):
OptiX was not found. Neural graphics primitives will still compile and run
correctly. However, SDF training in 'raystab' and 'pathescape' modes will
be significantly slower.

-- Found Python: /usr/bin/python3.10 (found suitable version "3.10.6", minimum required is "3.7") found components: Interpreter Development Development.Module Development.Embed
-- pybind11 v2.10.1
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring incomplete, errors occurred!
See also "/home/michaels/CLionProjects/instant-ngp/build/CMakeFiles/CMakeOutput.log".
See also "/home/michaels/CLionProjects/instant-ngp/build/CMakeFiles/CMakeError.log".

But after deleting the build directory and typing the command once again it seems it has built successfully:

michaels@michaels-320S:~/CLionProjects/instant-ngp$ cmake . -D TCNN_CUDA_ARCHITECTURES=86 -D CMAKE_CUDA_COMPILER=$(which nvcc) -B build
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The CUDA compiler identification is NVIDIA 10.2.89
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- No release type specified. Setting to 'Release'.
-- Automatic GPU detection failed. Building for common architectures.
-- Obtained target architecture from CMake variable TCNN_CUDA_ARCHITECTURES=86
CMake Warning at dependencies/tiny-cuda-nn/CMakeLists.txt:118 (message):
CUDA version 10.2 is too low for architecture 86. Targeting architecture
75 instead.

-- Targeting GPU architectures: 75
-- Module support is disabled.
-- Version: 9.1.1
-- Build type: Release
-- Found Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so (found version "1.3.204") missing components: glslc glslangValidator
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using X11 for window creation
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found GLEW: /usr/include (found version "2.2.0")
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- OptiX headers (optix.h and friends) not found.
CMake Warning at CMakeLists.txt:194 (message):
OptiX was not found. Neural graphics primitives will still compile and run
correctly. However, SDF training in 'raystab' and 'pathescape' modes will
be significantly slower.

-- Found Python: /usr/bin/python3.10 (found suitable version "3.10.6", minimum required is "3.7") found components: Interpreter Development Development.Module Development.Embed
-- pybind11 v2.10.1
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/michaels/CLionProjects/instant-ngp/build

@rulke
Copy link

rulke commented Dec 14, 2022

Adding to cmake fixed this for me:-D CMAKE_CUDA_COMPILER=$(which nvcc) cmake . -D TCNN_CUDA_ARCHITECTURES=86 -D CMAKE_CUDA_COMPILER=$(which nvcc) -B build

amazing

@MikePelton
Copy link

Some confusion in the comments here as to whether this is Windows or Linux the OP is interested in; for those who fell into this hole trying to build under Windows I found setting an environment variable

set CUDATOOLKITDIR = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1

..fixed it for me - this was with CMake 3.25.3 and CUDA 12.1 - change your setting of the variable according to your version of the CUDA Toolkit.

@Uniformed9
Copy link

_6A{5LZVAYA_S{ZRSRZKF}9 This way for my device(win11, cuda 11.7, 3070Ti[laptop]) the compiler can be found, but the error remains the same.

I ran into the same problem.Have you solved it?

@YuehChuan
Copy link

@Uniformed9 @MichalSzczekocki
@Pangolin112 @paulgnz

Check here!
https://github.com/YuehChuan/cudaVStemplate

The main issue is IDE.
Visual Studio 2022 supports CUDA 11.6 above.

@arithy
Copy link

arithy commented Sep 23, 2023

This issue can be caused by too long a value in the environment variable PATH.
In my case, it was resolved by removing unnecessary entries from PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants