I’m trying to compile the latest dev version of my cuda_voxelizer project: GitHub - Forceflow/cuda_voxelizer at dev
In Release mode (x64), the compilation succeeds, and my compiled result behaves like I expect it to, getting correct results from my tests (voxelizing polygon structures).
In Debug mode (x64), the compilation fails because NVCC crashes.
Build started...
1>------ Build started: Project: cuda_voxelizer, Configuration: Debug x64 ------
1>Compiling CUDA source file ..\..\src/voxelize.cu...
1>Compiling CUDA source file ..\..\src\voxelize_solid.cu...
1>
1>D:\dev\cuda_voxelizer\msvc\vs2022>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static --source-in-ptx -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/Fdx64\Debug\vc143.pdb" -o D:\dev\cuda_voxelizer\msvc\vs2022\x64\Debug\voxelize.cu.obj "D:\dev\cuda_voxelizer\src\voxelize.cu"
1>
1>D:\dev\cuda_voxelizer\msvc\vs2022>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static --source-in-ptx -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/Fdx64\Debug\vc143.pdb" -o D:\dev\cuda_voxelizer\msvc\vs2022\x64\Debug\voxelize_solid.cu.obj "D:\dev\cuda_voxelizer\src\voxelize_solid.cu"
1>voxelize.cu
1>CUDACOMPILE : nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION)
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.1.targets(799,9): error MSB3722: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static --source-in-ptx -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/Fdx64\Debug\vc143.pdb" -o D:\dev\cuda_voxelizer\msvc\vs2022\x64\Debug\voxelize.cu.obj "D:\dev\cuda_voxelizer\src\voxelize.cu"" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "cuda_voxelizer.vcxproj" -- FAILED.
1>voxelize_solid.cu
1>CUDACOMPILE : nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION)
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.1.targets(799,9): error MSB3722: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static --source-in-ptx -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/Fdx64\Debug\vc143.pdb" -o D:\dev\cuda_voxelizer\msvc\vs2022\x64\Debug\voxelize_solid.cu.obj "D:\dev\cuda_voxelizer\src\voxelize_solid.cu"" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "cuda_voxelizer.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 1:39 PM and took 03,031 seconds ==========
As far as I can tell, my code doesn’t do anything out of the ordinary. The only external library I’m using in the kernels is the helper_cuda_math files from the official CUDA Samples. This is an example of a .cu file that fails to compile in DEBUG.
Update: Removing the –source-in-ptx option from the debug options resolves the issue, but makes my debug builds useless, afaik.
It’s hard to narrow down what the offending line is, because I’m getting no feedback. When I comment out nearly everything in the .cu files, the project continues, but uncommenting doesn’t narrow it down, seems random.
This has been happening on every release of the 12.x CUDA branch.
I can compile the CUDA Samples in Release and Debug Mode just fine, so I doubt anything is wrong with my CUDA install. I’ve got a relatively new card (4070 Ti). Can’t remember this happening on my older card (RTX 2070 Super).
Already tried:
- Starting over with a totally new Visual Studio CUDA project, and adding my sources again, but I bump into the same problem.
- Clean install of graphics drivers
- New CUDA install
My environment:
Windows 10
Cuda 12.1
RTX 4070 TI, latest drivers
VS2022, latest updates
Any ideas?