NVlabs / instant-ngp

Instant neural graphics primitives: lightning fast NeRF and more
https://nvlabs.github.io/instant-ngp
Other
16.01k stars 1.93k forks source link

Errors while attempting cmake #1067

Open TemporalLabsLLC-SOL opened 1 year ago

TemporalLabsLLC-SOL commented 1 year ago

C:\ngp\instant-ngp>cmake . -B build

RETURNED

CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/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

MSBuild version 17.4.0+18d5aef85 for .NET Framework

Build started 11/11/2022 9:24:22 AM.

Project "C:\ngp\instant-ngp\build\CMakeFiles\3.24.202208181-MSVC_2\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\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D__CUDACC_VER_MAJOR__=11 /D__CUDACC_VER_MINOR__=8 /D_MBCS /Iinclude /Ibin /Iinclude /I. /FIcuda_runtime.h /c C:\ngp\instant-ngp\build\CMakeFiles\3.24.202208181-MSVC_2\CompilerIdCUDA\CMakeCUDACompilerId.cu

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.8.targets(606,9): error : The CUDA Toolkit v11.8 directory '' does not exist. Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir property to resolve this error. [C:\ngp\instant-ngp\build\CMakeFiles\3.24.202208181-MSVC_2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

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

Build FAILED.

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

(ValidateCudaBuild target) ->

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.8.targets(606,9): error : The CUDA Toolkit v11.8 directory '' does not exist.  Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir property to resolve this error. [C:\ngp\instant-ngp\build\CMakeFiles\3.24.202208181-MSVC_2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

  0 Warning(s)
  1 Error(s)

Time Elapsed 00:00:01.66

Call Stack (most recent call first): C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD) C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test) C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/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".

I think it's because nvcc isn't pulling outside of if I am in the cuda directory. I have added it to paths but may have the wrong environment variable or something.

copying the nvcc.exe into the folder was a long shot and a no-go

TemporalLabsLLC-SOL commented 1 year ago

Screenshot_20221111_093715

ogradyso commented 1 year ago

Based on your output it looks like CUDA was not installed. About 1/3 of the way up from the bottom of your screenshot it says it couldn't find CUDA on your system. Can you verify your CUDA install? You can run: nvcc --version on your CMD or bash terminal and it should give you some system info about your CUDA install. The repo says you can run it with CUDA 10.2 + but I have only run it will 11.6 and 11.8 without any problems.