dmurtin
dmurtin

Reputation: 41

No CMAKE_CUDA_COMPILER could be found

I am trying to generate a build system for CMake, but it throws an error at me, that I havent managed to fix for days. I have installed VC 2017 and CUDA latest release.

In my directory I created build directory and ran:

cmake ..

After that it started creating it but it didn't find the CUDA compiler

C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build>cmake ..

-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.16.27027.1
-- The CUDA compiler identification is unknown
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (project):

>  No CMAKE_CUDA_COMPILER could be found.

>-- Configuring incomplete, errors occurred!
See also "C:/Users/lenovo/Documents/Fax/4/Lasersko skeniranje/Projekat/Open3D-PointNet2-Semantic3D/tf_ops/build/CMakeFiles/CMakeOutput.log".

The log file says:

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

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

Build started 07-Mar-19 14:14:03.
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\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\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I. /FIcuda_runtime.h /c "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu" 
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1) is building "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1:2) on node 1 (CudaBuildCore target(s)).
CudaBuildCore:
  Compiling CUDA source file CMakeCUDACompilerId.cu...
  cmd.exe /C "C:\Users\lenovo\AppData\Local\Temp\tmp5b923de4e22e4f04be6ba6f85d34ca98.cmd"
  "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"

  C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu" 
  nvcc fatal   : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target(s)) -- FAILED.
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default target) (1) ->
"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target) (1:2) ->
(CudaBuildCore target) -> 
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.74


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

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

Build started 07-Mar-19 14:14:06.
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\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\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I. /FIcuda_runtime.h /c "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu" 
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1) is building "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1:2) on node 1 (CudaBuildCore target(s)).
CudaBuildCore:
  Compiling CUDA source file CMakeCUDACompilerId.cu...
  cmd.exe /C "C:\Users\lenovo\AppData\Local\Temp\tmp6a6113e32a54449682bdc11103da68f9.cmd"
  "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"

  C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu" 
  nvcc fatal   : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target(s)) -- FAILED.
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default target) (1) ->
"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target) (1:2) ->
(CudaBuildCore target) -> 
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.65

Any idea? I cant seem to resolve the issue... I am running Win10

Upvotes: 4

Views: 26620

Answers (4)

KleberBueno
KleberBueno

Reputation: 65

I know this is an old question, but I faced same problem and maybe, the solution I took could help anyone else. Actually, I always install CUDA as custom installation since I don't want samples and doc to be installed. At first time I installed I forgot to tick Visual Studio integration option. That made for some reason CUDA compiler not be visible. After I reinstalled CUDA ticking the option it worked.

Upvotes: 0

Alexis Wilke
Alexis Wilke

Reputation: 20725

It looks like you are expected to specify the full path to nvcc by hand. I don't like the idea, though.

You do that this way:

cmake -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda/bin/nvcc ...other cmake options...

That will compile things as expected, except it doesn't automatically add the include folder. I'm still looking at how to handle that second part without including the FindCUDA.cmake file.

Upvotes: 7

user1757226
user1757226

Reputation: 342

Try cmake -G "Microsoft Visual Studio 15 2017 Win64" ..

Upvotes: 2

Robin Thoni
Robin Thoni

Reputation: 1721

According to the logs, the problem is nvcc fatal : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier when compiling CMakeCUDACompilerId.cu, which is used internally by CMake to make sure the compiler is working.

For some reasons, CMake decided to compile the file in 32 bits, which is not supported anymore. As CMake version was not specified, I would suggest updating CMake.

Upvotes: 2

Related Questions