Skip to content

CUDA can't be enabled for current MSVC versions #219

@Flashtim

Description

@Flashtim

I have been trying to build Viskores on a couple of different Windows 11 machines using MSVC with the Viskores_ENABLE_CUDA option set to true.
While I can generate project files for Visual Studio 2022 with no errors or warnings in Cmake, Viskores fails to be compiled (2693 errors) due to issues with CUDA/Thrust.

These errors mostly repeat for a whole lot of files:

  • ""thrust::detail" is ambiguous"
  • "a template argument list is not allowed in a declaration of a primary template"
  • "class or struct definition is missing"
  • "make_projection_symbol: no fundamental base class"
  • "'cudafe++' died with status 0xC0000409"

Further, there are issues with CUDA targets, e.g:

"The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc.exe" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64" -x cu -IC:\Viskores\source\viskores\thirdparty\optionparser -IC:\Viskores\source\viskores\thirdparty\diy -IC:\Viskores\source\viskores\thirdparty\lcl\viskoreslcl -IC:\Viskores\source\viskores\thirdparty\loguru -IC:\Viskores\source -IC:\Viskores\build\include -IC:\Viskores\source\viskores\thirdparty\diy\viskoresdiy\include -IC:\Viskores\build\viskores\thirdparty\diy\viskoresdiy\include\viskoresdiy\mpi -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static --generate-code=arch=compute_89,code=sm_89 -std=c++17 -Xcudafe=--diag_suppress=1394,--diag_suppress=766 -Xcudafe=--display_error_number --expt-relaxed-constexpr -Xcompiler="/EHsc -Zi -Ob0 -wd4702,-wd4505 /Gy /bigobj" -g -D_WINDOWS -DVISKORESDIY_NO_THREADS -DVISKORESDIY_MPI_AS_LIB -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D"CMAKE_INTDIR="Debug"" -Dviskores_cont_EXPORTS -D_WINDLL -D_MBCS -DWIN32 -D_WINDOWS -DVISKORESDIY_NO_THREADS -DVISKORESDIY_MPI_AS_LIB -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D"CMAKE_INTDIR="Debug"" -Dviskores_cont_EXPORTS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -Xcompiler "/Fdviskores_cont.dir\Debug\vc143.pdb" -o viskores_cont.dir\Debug\ArrayCopyUnknown.obj "C:\Viskores\source\viskores\cont\internal\ArrayCopyUnknown.cxx"" exited with code 9."

This is true for all CUDA Toolkit versions above 12.4 up to the latest 13.0.2.
My guess is, that this is related to this issue:
NVIDIA/cccl#1493

And when using CUDA Toolkit 13.x, additionally, this issue appears:
https://forums.developer.nvidia.com/t/cuda-13-0-missing-thrust-folder/342958

Until now, I switched using GCC within WSL, but I think it would be good to have this resolved.
By the way, the same issue appear when activating Viskores within VTK.
Let me know, if I can provide any more information that might help.
Thanks


CMake 4.1.2 (Only the Viskores_ENABLE_CUDA Option was changed from default)
CMake Build for Visual Studio 17 2022
Viskores 1.1.0-RC1.0 (Bit I've tested this for RC2 and older version as well)
Windows 11
MSVC | Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35220 for x64
CUDA Toolkit 12.4 | Cuda compilation tools, release 12.4, V12.4.131

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions