NVIDIA / gvdb-voxels

Sparse volume compute and rendering on NVIDIA GPUs
Other
673 stars 144 forks source link

CMake Error: No CUDA toolset found. #87

Closed inhahe closed 4 years ago

inhahe commented 4 years ago

Maybe this is a problem on my end, I'm not expert enough to know, but I've installed other CUDA projects and cmake was able to find CUDA. Here's the full error:


:\gvdb>cmake CMakeLists.txt CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake:367 (message): No CUDA toolset found. Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake:32 (CMAKE_DETERMINE_COMPILER_ID_BUILD) C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineCUDACompiler.cmake:72 (CMAKE_DETERMINE_COMPILER_ID) source/gvdb_library/CMakeLists.txt:10 (project)

-- Configuring incomplete, errors occurred! See also "C:/gvdb/CMakeFiles/CMakeOutput.log".


Here's CMakeOutput.log:


The system is: Windows - 10.0.18362 - AMD64 Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. Compiler:
Build flags: Id flags:

The output was: 0 Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/30/2020 3:08:09 AM. Project "C:\gvdb\CMakeFiles\3.17.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets). PrepareForBuild: Creating directory "Debug\". Creating directory "Debug\CompilerIdC.tlog\". InitializeBuildStatus: Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. ClCompile: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:classic /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\" /Fd"Debug\vc141.pdb" /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c CMakeCCompilerId.c Link: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj CompilerIdC.vcxproj -> C:\gvdb\CMakeFiles\3.17.2\CompilerIdC.\CompilerIdC.exe PostBuildEvent: for %%i in (cl.exe) do @echo CMAKE_C_COMPILER=%%~$PATH:i :VCEnd CMAKE_C_COMPILER=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64\cl.exe FinalizeBuildStatus: Deleting file "Debug\CompilerIdC.tlog\unsuccessfulbuild". Touching "Debug\CompilerIdC.tlog\CompilerIdC.lastbuildstate". Done Building Project "C:\gvdb\CMakeFiles\3.17.2\CompilerIdC\CompilerIdC.vcxproj" (default targets).

Build succeeded. 0 Warning(s) 0 Error(s)

Time Elapsed 00:00:01.22

Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.exe"

Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.vcxproj"

The C compiler identification is MSVC, found in "C:/gvdb/CMakeFiles/3.17.2/CompilerIdC/CompilerIdC.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. Compiler:
Build flags: Id flags:

The output was: 0 Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/30/2020 3:08:11 AM. Project "C:\gvdb\CMakeFiles\3.17.2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets). PrepareForBuild: Creating directory "Debug\". Creating directory "Debug\CompilerIdCXX.tlog\". InitializeBuildStatus: Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. ClCompile: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:classic /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\" /Fd"Debug\vc141.pdb" /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp CMakeCXXCompilerId.cpp Link: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj CompilerIdCXX.vcxproj -> C:\gvdb\CMakeFiles\3.17.2\CompilerIdCXX.\CompilerIdCXX.exe PostBuildEvent: for %%i in (cl.exe) do @echo CMAKE_CXX_COMPILER=%%~$PATH:i :VCEnd CMAKE_CXX_COMPILER=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64\cl.exe FinalizeBuildStatus: Deleting file "Debug\CompilerIdCXX.tlog\unsuccessfulbuild". Touching "Debug\CompilerIdCXX.tlog\CompilerIdCXX.lastbuildstate". Done Building Project "C:\gvdb\CMakeFiles\3.17.2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets).

Build succeeded. 0 Warning(s) 0 Error(s)

Time Elapsed 00:00:00.61

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CompilerIdCXX.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CompilerIdCXX.vcxproj"

The CXX compiler identification is MSVC, found in "C:/gvdb/CMakeFiles/3.17.2/CompilerIdCXX/CompilerIdCXX.exe"

Determining if the C compiler works passed with the following output: Change Dir: C:/gvdb/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe cmTC_95f2c.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 /v:m && Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27040 for x64

Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_95f2c.dir\Debug\" /Fd"cmTC_95f2c.dir\Debug\vc141.pdb" /Gd /TC /errorReport:queue C:\gvdb\CMakeFiles\CMakeTmp\testCCompiler.c

testCCompiler.c

cmTC_95f2c.vcxproj -> C:\gvdb\CMakeFiles\CMakeTmp\Debug\cmTC_95f2c.exe

Detecting C compiler ABI info compiled with the following output: Change Dir: C:/gvdb/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe cmTC_8f9d0.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 /v:m && Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27040 for x64

Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_8f9d0.dir\Debug\" /Fd"cmTC_8f9d0.dir\Debug\vc141.pdb" /Gd /TC /errorReport:queue "C:\Program Files\CMake\share\cmake-3.17\Modules\CMakeCCompilerABI.c"

CMakeCCompilerABI.c

cmTC_8f9d0.vcxproj -> C:\gvdb\CMakeFiles\CMakeTmp\Debug\cmTC_8f9d0.exe

Determining if the CXX compiler works passed with the following output: Change Dir: C:/gvdb/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe cmTC_ead57.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 /v:m && Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27040 for x64

Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_ead57.dir\Debug\" /Fd"cmTC_ead57.dir\Debug\vc141.pdb" /Gd /TP /errorReport:queue C:\gvdb\CMakeFiles\CMakeTmp\testCXXCompiler.cxx

testCXXCompiler.cxx

cmTC_ead57.vcxproj -> C:\gvdb\CMakeFiles\CMakeTmp\Debug\cmTC_ead57.exe

Detecting CXX compiler ABI info compiled with the following output: Change Dir: C:/gvdb/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe cmTC_40517.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 /v:m && Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27040 for x64

Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_40517.dir\Debug\" /Fd"cmTC_40517.dir\Debug\vc141.pdb" /Gd /TP /errorReport:queue "C:\Program Files\CMake\share\cmake-3.17\Modules\CMakeCXXCompilerABI.cpp"

CMakeCXXCompilerABI.cpp

cmTC_40517.vcxproj -> C:\gvdb\CMakeFiles\CMakeTmp\Debug\cmTC_40517.exe


I have the following CUDA versions installed:

Directory of C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA

05/28/2020 08:57 PM

. 05/28/2020 08:57 PM .. 05/12/2020 08:27 PM v10.1 05/12/2020 06:04 PM v10.2 05/24/2020 04:54 AM v7.0 05/26/2020 06:34 PM v7.5 05/28/2020 08:58 PM v8.0 05/23/2020 11:31 PM v9.1

NBickford-NV commented 4 years ago

Hmm, I'm wondering if maybe the older versions of CUDA are tripping up CMake somehow. Just out of curiosity, if you create a new CMakeLists.txt file in an empty folder containing only the following three lines (which are hopefully the essential parts of the GVDB CMake script for the top-level file that builds everything), does CMake have a similar error when configuring?

cmake_minimum_required(VERSION 3.10)
project(gvdb_all)
project(gvdb LANGUAGES CUDA CXX C)

Here's what this prints out on my machine with 10.2 installed, generating with Visual Studio 2017 - I'll hopefully see if I can install the other versions shortly and see if I can reproduce this error, although there could be other things going on:

[...]\cmake_build>cmake .. -G "Visual Studio 15 2017 Win64"
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.16.27039.0
-- The CXX compiler identification is MSVC 19.16.27039.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is NVIDIA 10.2.89
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin/nvcc.exe
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin/nvcc.exe -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/techi/Documents/GitHub/gvdb-cmake-test/cmake_build

It's also interesting to note that looking at the CMakeOutput.log generated here, the section where it compiles CUDA code should start just after the end of the text you posted, and should start off like this:

Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" succeeded.
Compiler:  
Build flags: 
Id flags:  -v;--keep;--keep-dir;tmp

The output was:
0
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
NBickford-NV commented 4 years ago

Hmm, I installed CMake 3.17.2 and all of the listed CUDA versions in order of modification on your system, but it looks like CMake still manages to find CUDA 10.2 on my system on both the test script above and GVDB's top-level CMakeLists. If the CMake script above fails as well, maybe it would make sense to try reinstalling CUDA 10.2 and/or CMake?

inhahe commented 4 years ago

I replaced \gvdb\source\gvdb_library\CMakeLists.txt with those three lines, and I still got the error.

So I reinstalled CUDA 10.2 and ran the original CMakeLists.txt again, and I didn't get the error anymore. Then I successfully built the library in VS 2019.

But then I tried building gFluidSurface, and it didn't work because OptiX files are missing (even though I installed OptiX):

-- OptiX Lib: C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0/lib64 -- OptiX Bin: C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0/bin64 -- OptiX Include: C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0/include OptiX NOT FOUND. Could not find at least one of optix.7.0.0.dll or optixu.7.0.0.dll in C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0/bin64. OptiX NOT FOUND. Could not find at least one of optix.7.0.0.lib or optixu.7.0.0.lib in C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0/lib64.


C:\gvdb\source\gFluidSurface>dir "\ProgramData\NVIDIA Corporation\OptiX SDK 7.0.0" Volume in drive C is Windows Volume Serial Number is D899-4FC2

Directory of C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.0.0

06/02/2020 11:20 PM

. 06/02/2020 11:20 PM .. 06/02/2020 11:20 PM doc 06/02/2020 11:20 PM include 06/02/2020 11:20 PM SDK 06/02/2020 11:20 PM 83,061 Uninstall.exe 1 File(s) 83,061 bytes 5 Dir(s) 152,205,303,808 bytes free


I don't have bin64 or lib64. Am I supposed to build something? I found CMakeLists.txt in C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.0.0\SDK, ran that and then built OptiX-Samples.sln which is the only .sln file I saw. I built it in VS but it didn't make a lib64 or bin64 directory..

NBickford-NV commented 4 years ago

Ah, that's fantastic to hear!

For OptiX, we have that documented, although there's probably not enough emphasis on it - you'll need to install OptiX 6.5, as we haven't ported the samples to use OptiX 7 yet (which includes some major API improvements, but is also relatively different from OptiX 6). (FYI, porting the samples to OptiX 7 is a thing I'm actively looking at, but the samples will continue to use OptiX 6 for a while. Luckily, GVDB itself shouldn't depend on the version of OptiX you're using - only the GVDB OptiX samples do.)

In particular, I think OptiX 7 also changed the naming scheme for files, which is why the CMake files for the OptiX samples require version 6.5.

inhahe commented 4 years ago

I installed OptiX 6.5.0. It still tried to use 7.0.0., so I specified the 6.5.0 directory using cmake -D. I got an error.. it seems to think that the OptiX version string is 0.0.0 so it searches for the wrong filenames.


C:\gvdb\source\gFluidSurface>cmake -D OPTIX_ROOT_DIR="c:/ProgramData/NVIDIA Corporation/OptiX SDK 6.5.0" CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.

-- --> Find Sample Utils -- Using OpenGL -- Using PNG -- Using TGA -- Using GLEW -- Using NVGUI -- Using OPTIX_UTILS -- --> Using Sample Utils. C:/gvdb/source/sample_utils

-- Finding OptiX... -- searchList: -- OptiX version string: : 0.0.0 -- OptiX Lib: /lib64 -- OptiX Bin: /bin64 -- OptiX Include: /include OptiX NOT FOUND. Could not find at least one of optix.0.0.0.dll or optixu.0.0.0.dll in /bin64. OptiX NOT FOUND. Could not find at least one of optix.0.0.0.lib or optixu.0.0.0.lib in /lib64. CMake Error at C:/gvdb/source/sample_utils/FindOptix.cmake:163 (message):

    OPTIX not found. Please specify OPTIX_ROOT_DIR
    containing the include, lib64, bin64 folders.
    Not found at OPTIX_ROOT_DIR:

Call Stack (most recent call first): CMakeLists.txt:40 (find_package)

-- Configuring incomplete, errors occurred!

NBickford-NV commented 4 years ago

Ah, yep, this is a bug! I should have just fixed it, if you pull the latest version of the repository (or implement the changes in this commit: https://github.com/NVIDIA/gvdb-voxels/commit/40dd71eaabcabec206261c8a0a4d094ec7a5bbe5). This should allow you to specify the OptiX directory by setting OPTIX_ROOT_DIR to the OptiX directory - it'll now determine the version number automatically when you do that. It'll also look for versions < 7.0 (due to sample compatibility) now, so you hopefully won't have to specify OPTIX_ROOT_DIR. Another fix (that you can do without having to pull the repository again) would be to set OPTIX_VERSION to "6.5.0" as well.

NBickford-NV commented 4 years ago

Hi inhahe - is it OK if I close this issue if the build works with OptiX 6.5 for you? I should be looking into porting some of the samples to OptiX 7 soon.

NBickford-NV commented 4 years ago

Closing, since I think this has been fixed by the commit in the penultimate comment more than a month ago. Please let me know if this is still producing an error, and re-open the issue!