Tricky to get CUDA/CUDNN working
I found I had to include more on the command line for 64-bit, but was unable to get past some Visual Studio/CUDA integration.
e.g.
cmake -DCMAKE_PREFIX_PATH=c:\libtorch
-DCUDA_TOOLKIT_ROOT_DIR=“c:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0”
-DCMAKE_GENERATOR_PLATFORM=x64
-DCMAKE_BUILD_TYPE=Release …
– Caffe2: CUDA detected: 9.0
– Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/bin/nvcc.exe
– Caffe2: CUDA toolkit directory: c:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0
CMake Error at C:/libtorch/share/cmake/Caffe2/public/cuda.cmake:53 (message):
Caffe2: Couldn’t determine version from header: Change Dir:
C:/Users/t/ktorch/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual
Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe cmTC_853c8.vcxproj
/p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 /v:m
Microsoft ® Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright © Microsoft Corporation. All rights reserved.
Microsoft ® C/C++ Optimizing Compiler Version 19.16.27027.1 for x64
Copyright © Microsoft Corporation. All rights reserved.
detect_cuda_version.cc
cl /c /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" /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_853c8.dir\Debug\\" /Fd"cmTC_853c8.dir\Debug\vc141.pdb" /Gd /TP /errorReport:queue C:\Users\t\ktorch\build\detect_cuda_version.cc
cmTC_853c8.dir\Debug\detect_cuda_version.obj : fatal error LNK1112: module
machine type ‘x64’ conflicts with target machine type ‘x86’
[C:\Users\t\ktorch\build\CMakeFiles\CMakeTmp\cmTC_853c8.vcxproj]
Call Stack (most recent call first):
C:/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
C:/libtorch/share/cmake/Torch/TorchConfig.cmake:39 (find_package)
CMakeLists.txt:4 (find_package)
– Configuring incomplete, errors occurred!
See also “C:/Users/t/ktorch/build/CMakeFiles/CMakeOutput.log”.
See also “C:/Users/t/ktorch/build/CMakeFiles/CMakeError.log”.