Closed codeling closed 6 years ago
The first issue seems to have resolved itself after I restarted CMake. Probably an issue with Nvidia SDK path not being contained in PATH environment variable (which it is now).
Still seeing the second problem though. As I'm pretty sure I've built it on another system not so long ago (albeit with CUDA 8.0), I will check what version I used there (edit: that was version 81b5fd7b ; unfortunately also with that version, I get the same issue on this new machine with CUDA 9.0).
Which MSVC version are you using? I got the same error when attempting to use the VS17 compiler, but no error when using the VS15 compiler with the VS17 generator. CUDA 9 claims to support the VS17 compiler (http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#system-requirements), but I have not yet successfully compiled a CUDA-project with it.
I use VS 2017. I didn't know one can select VS15 as compiler when using VS17 generator. I'm not really planning on doing that (since I've built everything else with VS17 too), but out of curiosity, how does one go about doing that in CMake? Are you referring to the "Windows SDK Version" setting in the VS project settings?
but I have not yet successfully compiled a CUDA-project with it.
I have successfully compiled the astra toolbox with Cuda 9.0 and Visual Studio 2017.
Using the generator and toolset commandline argument of cmake ("optional toolset" in GUI), i.e. -G "Visual Studio 15 2017 Win64" and -T "v140" should use the VS17 generator with the VS15 compiler. A list of the available toolset names can usually be found by opening some existing project in the desired VS version, then go to project properties->"Configuration Properties"->"General"->"Platform Toolset"
I have successfully compiled the astra toolbox with Cuda 9.0 and Visual Studio 2017.
Interesting! I have some suspicion that the difference may be in the nvcc compiler flags, but I can only guess, as the only error message I have been able to get is: "Error generating". Therefore, if you can provide the working nvcc command line (using VS17 compiler as host), it might give a hint.
Here's the command lines:
RTK:
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/bin/nvcc.exe" -M -DCUDACC C:/Tools/rtk/src-git/code/rtkCudaCropImageFilter.cu -o C:/Tools/rtk/bin-f7d11fef-cuda/code/CMakeFiles/cuda_compile_1.dir//cuda_compile_1_generated_rtkCudaCropImageFilter.cu.obj.NVCC-depend -ccbin "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/bin" -m64 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DITK_IO_FACTORY_REGISTER_MANAGER -Xcompiler ,\"/DWIN32\",\"/D_WINDOWS\",\"/W3\",\"/GR\",\"/EHsc\",\"/bigobj\",\"/MDd\",\"/Zi\",\"/Ob0\",\"/Od\",\"/RTC1\" -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -DNVCC -IC:/Tools/rtk/src-git "-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/include" -IC:/Tools/itk/src-4.12.2/Modules/Core/Common/include -IC:/Tools/itk/bin-4.12.2/Modules/Core/Common -IC:/Tools/rtk/bin-f7d11fef-cuda
Astra:
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_60,code=\"compute_60,compute_60\" --use-local-env --cl-version 2017 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64" -x cu -Ilib\include -Iinclude\ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -lineinfo --keep-dir x64\Debug_CUDA -maxrregcount=0 --machine 64 --compile -cudart static -DASTRA_CUDA -DSSE2 -DDLL_EXPORTS -D_CRT_SECURE_NO_WARNINGS -D_WINDLL -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o C:\Tools\astra\astra-toolbox-1.8.3\bin\x64\Debug_CUDA\obj\algo.cu.obj "C:\Tools\astra\astra-toolbox-1.8.3\cuda\2d\algo.cu"
One noteable difference is the slashes vs. backslashes, but as I'm a complete CUDA newbie, I don't have any other suspicions so far what could be wrong in the RTK command line.
I checked and the backslashes should not be a problem. Can you try to copy paste the command line in a terminal and give us the output? I have the feeling we don't get the error message we need. Thanks, Simon
Can you try to copy paste the command line in a terminal and give us the output? I have the feeling we don't get the error message we need.
I have tried that, to no avail yet: nvcc just doesn't give any error message. In fact, by default it gives no output at all, it just fails with a return code of 1. I tried adding the "--verbose" parameter to the command line, but that just outputs a call to vcvars64.bat before exiting:
H:\>call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/../VC/Auxiliary/Build/vcvars64.bat"
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.4.5
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
#$ ALLUSERSPROFILE=C:\ProgramData
...
"..." indicates that the output contains a list of all environment variables, which I don't want to include here because they contain sensitive information. Suffice it to say, only those variables are written, and nothing after them. Is there any other option I should try? With a quick glance at the nvcc command line options I couldn't find another useful option yet.
The command from ASTRA runs fine (exit code 0) on the command prompt. To note here is that it depends on the working directory being the astra source root folder, as it specifies the include paths relatively; and when running it from a native x64 VS command prompt I had to adapt the "HostX86" part to "Hostx64", otherwise I would get a "nvcc fatal : Compiler 'cl.exe' in PATH different than the one specified with -ccbin" (as Visual Studio 2017 is not a native 64 bit binary and thus uses cross-compilation).
This last part, the modification of HostX86 gave me an idea - I compared the ccbin path, and indeed it seems wrong for RTK: for my VS 2017, the correct cl.exe bin path is "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\Hostx64\x64" (or HostX86 from VS) - and with that, the command works!
But can I specify that path via CMake somehow, or should it determine that automatically?
TL;DR: For VS2017, set CUDA_HOST_COMPILER
to "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe".
This adapts the directory used for the "ccbin" argument to nvcc , and the CUDA compilation works! Not sure if this is an RTK or a CMake issue (though I would guess CMake), that this isn't automatically set to the proper location for VS 2017 (the default value is "$(VCInstallDir)bin", which is not correct for VS 2017). In RTK, I would propose at least a check for whether CUDA_HOST_COMPILER points to an existing file/directory. This might be useful to help identify such an issue more easily in the future.
One other issue I noticed again (since in the meantime I had removed the NVIDA SDK directory from PATH) is the "cudart64_[xy].dll missing" error message during CMake configure which I mentioned in my first post. In my opinion, RTK shouldn't depend on that dll being in the PATH.
The compilation runs through, but in linking, I am now getting 82 linker errors (several "already defined" and 28 unresolved externals):
6>cuda_compile_1_generated_rtkCudaDisplacedDetectorImageFilter.cu.obj : error LNK2005: "struct texture<float,1,0> tex_geometry" (?tex_geometry@@3U?$texture@M$00$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaFDKWeightProjectionFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaParkerShortScanImageFilter.cu.obj : error LNK2005: "struct texture<float,1,0> tex_geometry" (?tex_geometry@@3U?$texture@M$00$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaFDKWeightProjectionFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_projSize" (?c_projSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_matrices" (?c_matrices@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_projSize" (?c_projSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_volSize" (?c_volSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,242,0> tex_proj" (?tex_proj@@3U?$texture@M$0PC@$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_proj_3D" (?tex_proj_3D@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaForwardWarpImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_xdvf" (?tex_xdvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaForwardWarpImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_ydvf" (?tex_ydvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaForwardWarpImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_zdvf" (?tex_zdvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_projSize" (?c_projSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "struct float3 c_boxMin" (?c_boxMin@@3Ufloat3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "struct float3 c_boxMax" (?c_boxMax@@3Ufloat3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "struct float3 c_spacing" (?c_spacing@@3Ufloat3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_volSize" (?c_volSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "float c_tStep" (?c_tStep@@3MA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "float c_radius" (?c_radius@@3MA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_translatedProjectionIndexTransformMatrices" (?c_translatedProjectionIndexTransformMatrices@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_translatedVolumeTransformMatrices" (?c_translatedVolumeTransformMatrices@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_sourcePos" (?c_sourcePos@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaConstantVolumeSource.cu.obj : error LNK2005: "struct int3 c_Size" (?c_Size@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaTotalVariationDenoisingBPDQImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaConstantVolumeSeriesSource.cu.obj : error LNK2005: "struct int4 c_Size" (?c_Size@@3Uint4@@A) already defined in cuda_compile_1_generated_rtkCudaLastDimensionTVDenoisingImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaConjugateGradientImageFilter_3f.cu.obj : error LNK2005: "struct int3 c_Size" (?c_Size@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaTotalVariationDenoisingBPDQImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaConjugateGradientImageFilter_4f.cu.obj : error LNK2005: "struct int4 c_Size" (?c_Size@@3Uint4@@A) already defined in cuda_compile_1_generated_rtkCudaLastDimensionTVDenoisingImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaAverageOutOfROIImageFilter.cu.obj : error LNK2005: "struct int4 c_Size" (?c_Size@@3Uint4@@A) already defined in cuda_compile_1_generated_rtkCudaLastDimensionTVDenoisingImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_projSize" (?c_projSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct float3 c_boxMin" (?c_boxMin@@3Ufloat3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct float3 c_boxMax" (?c_boxMax@@3Ufloat3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct float3 c_spacing" (?c_spacing@@3Ufloat3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_volSize" (?c_volSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "float c_tStep" (?c_tStep@@3MA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "float * c_matrices" (?c_matrices@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "float * c_sourcePos" (?c_sourcePos@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "float * c_PPInputToIndexInputMatrix" (?c_PPInputToIndexInputMatrix@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_xdvf" (?tex_xdvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_ydvf" (?tex_ydvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_zdvf" (?tex_zdvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_vol" (?tex_vol@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_matrices" (?c_matrices@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_volIndexToProjPP" (?c_volIndexToProjPP@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_projPPToProjIndex" (?c_projPPToProjIndex@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_projSize" (?c_projSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct int3 c_volSize" (?c_volSize@@3Uint3@@A) already defined in cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_IndexInputToIndexDVFMatrix" (?c_IndexInputToIndexDVFMatrix@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_PPInputToIndexInputMatrix" (?c_PPInputToIndexInputMatrix@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "float * c_IndexInputToPPInputMatrix" (?c_IndexInputToPPInputMatrix@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,242,0> tex_proj" (?tex_proj@@3U?$texture@M$0PC@$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_proj_3D" (?tex_proj_3D@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_xdvf" (?tex_xdvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_ydvf" (?tex_ydvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2005: "struct texture<float,3,0> tex_zdvf" (?tex_zdvf@@3U?$texture@M$02$0A@@@A) already defined in cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj
6>cuda_compile_1_generated_rtkCudaPolynomialGainCorrectionImageFilter.cu.obj : error LNK2005: "float * cst_coef" (?cst_coef@@3PAMA) already defined in cuda_compile_1_generated_rtkCudaLagCorrectionImageFilter.cu.obj
6> Creating library C:/Tools/rtk/bin-f7d11fef-cuda/bin/Debug/rtkcuda.lib and object C:/Tools/rtk/bin-f7d11fef-cuda/bin/Debug/rtkcuda.exp
6>cuda_compile_1_generated_rtkCudaCropImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_69_tmpxft_00005418_00000000_11_rtkCudaCropImageFilter_compute_35_cpp1_ii_515789cd referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaUtilities.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_63_tmpxft_000022a0_00000000_11_rtkCudaUtilities_compute_35_cpp1_ii_b69d1b14 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaFDKBackProjectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_82_tmpxft_00004544_00000000_11_rtkCudaFDKBackProjectionImageFilter_compute_35_cpp1_ii_tex_proj referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaFFTConvolutionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_79_tmpxft_00001dac_00000000_11_rtkCudaFFTConvolutionImageFilter_compute_35_cpp1_ii_9c182c55 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaFDKWeightProjectionFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_79_tmpxft_00002b1c_00000000_11_rtkCudaFDKWeightProjectionFilter_compute_35_cpp1_ii_c51fdc97 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaDisplacedDetectorImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_82_tmpxft_000037e4_00000000_11_rtkCudaDisplacedDetectorImageFilter_compute_35_cpp1_ii_c51fdc97 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaParkerShortScanImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_80_tmpxft_000028c8_00000000_11_rtkCudaParkerShortScanImageFilter_compute_35_cpp1_ii_c51fdc97 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaForwardProjectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_82_tmpxft_00003c10_00000000_11_rtkCudaForwardProjectionImageFilter_compute_35_cpp1_ii_tex_vol referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaBackProjectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_79_tmpxft_00003a18_00000000_11_rtkCudaBackProjectionImageFilter_compute_35_cpp1_ii_tex_proj referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaSplatImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_70_tmpxft_00005370_00000000_11_rtkCudaSplatImageFilter_compute_35_cpp1_ii_d3ff9271 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaInterpolateImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_76_tmpxft_00001f54_00000000_11_rtkCudaInterpolateImageFilter_compute_35_cpp1_ii_76e26310 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaWarpImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_69_tmpxft_000002c8_00000000_11_rtkCudaWarpImageFilter_compute_35_cpp1_ii_ba80da1b referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaForwardWarpImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_76_tmpxft_00001750_00000000_11_rtkCudaForwardWarpImageFilter_compute_35_cpp1_ii_67d37d13 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaRayCastBackProjectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_86_tmpxft_00004e28_00000000_11_rtkCudaRayCastBackProjectionImageFilter_compute_35_cpp1_ii_0467ca5e referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaTotalVariationDenoisingBPDQImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_92_tmpxft_00004204_00000000_11_rtkCudaTotalVariationDenoisingBPDQImageFilter_compute_35_cpp1_ii_4048bcd5 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaLastDimensionTVDenoisingImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_89_tmpxft_00005358_00000000_11_rtkCudaLastDimensionTVDenoisingImageFilter_compute_35_cpp1_ii_289d223f referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaConstantVolumeSource.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_74_tmpxft_000038f0_00000000_11_rtkCudaConstantVolumeSource_compute_35_cpp1_ii_c536cb90 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaConstantVolumeSeriesSource.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_80_tmpxft_000052e0_00000000_11_rtkCudaConstantVolumeSeriesSource_compute_35_cpp1_ii_7ae40660 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaConjugateGradientImageFilter_3f.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_85_tmpxft_00003eb4_00000000_11_rtkCudaConjugateGradientImageFilter_3f_compute_35_cpp1_ii_1a248c52 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaConjugateGradientImageFilter_4f.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_85_tmpxft_000019c8_00000000_11_rtkCudaConjugateGradientImageFilter_4f_compute_35_cpp1_ii_10e1854b referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaAverageOutOfROIImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_80_tmpxft_00003d6c_00000000_11_rtkCudaAverageOutOfROIImageFilter_compute_35_cpp1_ii_408956c6 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaLaplacianImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_74_tmpxft_00005670_00000000_11_rtkCudaLaplacianImageFilter_compute_35_cpp1_ii_346de7bb referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaFirstOrderKernels.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_71_tmpxft_00000fa8_00000000_11_rtkCudaFirstOrderKernels_compute_35_cpp1_ii_89f5718f referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaWarpForwardProjectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_86_tmpxft_00002730_00000000_11_rtkCudaWarpForwardProjectionImageFilter_compute_35_cpp1_ii_tex_xdvf referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaWarpBackProjectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_83_tmpxft_00003e18_00000000_11_rtkCudaWarpBackProjectionImageFilter_compute_35_cpp1_ii_tex_proj referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaCyclicDeformationImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_82_tmpxft_00001910_00000000_11_rtkCudaCyclicDeformationImageFilter_compute_35_cpp1_ii_2d8e72c6 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaLagCorrectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_78_tmpxft_000043bc_00000000_11_rtkCudaLagCorrectionImageFilter_compute_35_cpp1_ii_8ade7d4b referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>cuda_compile_1_generated_rtkCudaPolynomialGainCorrectionImageFilter.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_89_tmpxft_000055b8_00000000_11_rtkCudaPolynomialGainCorrectionImageFilter_compute_35_cpp1_ii_86b30986 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
6>C:\Tools\rtk\bin-f7d11fef-cuda\bin\Debug\rtkcuda.dll : fatal error LNK1120: 28 unresolved externals
Shall I open a new issue with this?
[Edit, I wrote too soon, ignore the satement that was here].
I didn't get any errors during linking when using: [...]/MSVC/14.11.25503/bin/HostX64/x64/cl.exe
Edit: Disregard; I started from scratch (new build directory, also updating to 9281310d); using the Hostx64 path, those linker errors are gone.
So we can close this issue?
Yes, closing it.
In summary:
CUDA_HOST_COMPILER
in CMake to "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx64/x64/cl.exe".Thanks!
Trying to build RTK (latest git master, commit f7d11fef) with CUDA under Windows 10 with Visual Studio 2017, ITK 4.12.2 (with ITKVTKGlue, if that matters, to VTK 8.0.1), and CUDA 9.0, I get the following error message when enabling RTK_USE_CUDA and setting the CUDA_TOOLKIT_ROOT_DIR:
The toolkit is installed in the default folder (C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0). Has anybody else seen that problem? Could you point me to where I need to check for being able to provide more details?
The configure actually runs through; though if I then try to compile the solution, I get another error message:
Note: See last post for a workaround for these issues!