MSVC 2015 + CUDA build fails: "nvlink fatal : Could not open input file 'C:\Program'"
From what I can see, this is because:
- CUDA is by default installed to a path with spaces.
- We add a dummy path to the
vtkm::cuda
location here. - The spaces in the path confuse the compiler, even though they're quoted in the link line. I tried using different ways of escaping the spaces, but none seems to work.
The full link line is:
C:\PROGRA~1\NVIDIA~2\CUDA\v9.2\bin\nvcc.exe -D_WINDOWS -Xcompiler="/W3 /GR /EHsc" --generate-code=arch=compute_50,code=sm_50 -Xcompiler="/wd4702 /wd4505" -Xcudafe="--diag_suppress=1394 --diag_suppress=766 --display_error_number" -Xcompiler="-MDd -Zi -Ob0 -Od /RTC1" -Wno-deprecated-gpu-targets -shared -dlink vtkm\cont\CMakeFiles\vtkm_cont.dir\ArrayHandle.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\AssignerMultiBlock.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\BoundsCompute.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\BoundsGlobalCompute.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\CellSet.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\CellSetStructured.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\DataSet.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\DataSetBuilderExplicit.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\DataSetBuilderRectilinear.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\DataSetBuilderUniform.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\DynamicArrayHandle.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\EnvironmentTracker.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\ErrorBadDevice.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\Field.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\FieldRangeCompute.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\FieldRangeGlobalCompute.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\internal\ArrayHandleBasicImpl.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\internal\ArrayManagerExecutionShareWithControl.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\internal\SimplePolymorphicContainer.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\MultiBlock.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\PresetColorTables.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\RuntimeDeviceTracker.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\StorageBasic.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\TryExecute.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\ArrayRangeCompute.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\CellSetExplicit.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\ColorTable.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\CoordinateSystem.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\serial\internal\ArrayManagerExecutionSerial.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\serial\internal\DeviceAdapterAlgorithmSerial.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\serial\internal\DeviceAdapterRuntimeDetectorSerial.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\serial\internal\ExecutionArrayInterfaceBasicSerial.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\tbb\internal\DeviceAdapterRuntimeDetectorTBB.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\tbb\internal\ArrayManagerExecutionTBB.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\tbb\internal\DeviceAdapterAlgorithmTBB.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\tbb\internal\ExecutionArrayInterfaceBasicTBB.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\tbb\internal\ParallelSortTBB.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\openmp\internal\DeviceAdapterRuntimeDetectorOpenMP.cxx.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\cuda\internal\ArrayManagerExecutionCuda.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\cuda\internal\CudaAllocator.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\cuda\internal\DeviceAdapterAlgorithmCuda.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\cuda\internal\DeviceAdapterRuntimeDetectorCuda.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\cuda\internal\DeviceAdapterTimerImplementationCuda.cu.obj vtkm\cont\CMakeFiles\vtkm_cont.dir\cuda\internal\ExecutionArrayInterfaceBasicCuda.cu.obj -o vtkm\cont\CMakeFiles\vtkm_cont.dir\cmake_device_link.obj -LIBPATH:C:\PROGRA~1\NVIDIA~2\CUDA\v9.2\lib\x64 -Xnvlink C:\Users\Allie\src\tbb2017_20170604oss\lib\intel64\vc14\tbb_debug.lib -Xnvlink "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\..\lib\x64\cudadevrt.lib" cudadevrt.lib cudart_static.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib -Xcompiler=-Fdvtkm\cont\CMakeFiles\vtkm_cont.dir\,-FS
The "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\..\lib\x64\cudadevrt.lib"
bit seems to be the trouble maker. Removing it and manually running the above command succeeds.
But, if I remove the indicated line from VTKmDeviceAdapters.cmake
, the project doesn't configure.
Has anyone else run into this before and know of a workaround/fix, other than reinstalling cuda to a new location without spaces in the path?