Skip to content

Cannot compile on Windows with CUDA #90

Description

@QubaB

I am not able compile NGsolve on windows with CUDA. I am obtaining error:

C:\ngsolve-netgen\build-CUDA\ngsolve\ngscuda>“C:\Programs\NVIDIA_CUDA\13_3/bin\nvcc.exe” --use-local-env -ccbin “C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64” -x cu -rdc=true  -I"C:\ngsolve-netgen\src\ngscuda" -I"C:\ngsolve-netgen\src\solve" -I"C:\ngsolve-netgen\src\parallel" -I"C:\ngsolve-netgen\src\multigrid" -I"C:\ngsolve-netgen\src\bem" -I"C:\ngsolve-netgen\src\comp" -I"C:\ngsolve-netgen\src\linalg" -I"C:\ngsolve-netgen\src\fem" -I"C:\ngsolve-netgen\src\basiclinalg" -I"C:\ngsolve-netgen\src\ngstd" -I"C:\ngsolve-netgen\src\include" -I"C:\ngsolve-netgen\build-CUDA\ngsolve" -IC:\python313\Include -I"C:\install-CUDA\include\include" -I"C:\install-CUDA\include" -IC:\Programs\NVIDIA_CUDA\13_3\include -IC:\Programs\NVIDIA_CUDA\13_3\include\cccl -I"C:\Program Files (x86)\Intel\oneAPI\mkl\2024.0\include" -IC:\Programs\NVIDIA_CUDA\13_3\include     --keep-dir ngscudalib\x64\RelWithDebInfo  -maxrregcount=0     --machine 64 --compile -cudart static -std=c++17 --expt-relaxed-constexpr --extended-lambda --diag-suppress=611 --diag-suppress=20011 --diag-suppress=20012 --diag-suppress=20013 --diag-suppress=20014 --diag-suppress=20015 -rdc=true /bigobj /arch:AVX512 /std:c++17 /wd4068 -Xcompiler=“/EHsc -Zi -Ob1”   -D_WINDOWS -DNDEBUG -DMAX_SYS_DIM=3 -DNGS_EXPORTS -DCUDA -DNETGEN_PYTHON -DNG_PYTHON -DPYBIND11_SIMPLE_GIL_MANAGEMENT -D_WIN32_WINNT=0x1000 -DWNT -DWNT_WINDOW -DNOMINMAX -DMSVC_EXPRESS -D_CRT_SECURE_NO_WARNINGS -DHAVE_STRUCT_TIMESPEC -DWIN32 -DHAVE_NETGEN_SOURCES -DUSE_TIMEOFDAY -DTCL -DLAPACK -DUSE_PARDISO -DNGS_PYTHON -DUSE_UMFPACK -D"CMAKE_INTDIR="RelWithDebInfo"" -Dngscudalib_EXPORTS -D_WINDLL -D_MBCS -DWIN32 -D_WINDOWS -DNDEBUG -DMAX_SYS_DIM=3 -DNGS_EXPORTS -DCUDA -DNETGEN_PYTHON -DNG_PYTHON -DPYBIND11_SIMPLE_GIL_MANAGEMENT -D_WIN32_WINNT=0x1000-DWNT -DWNT_WINDOW -DNOMINMAX -DMSVC_EXPRESS -D_CRT_SECURE_NO_WARNINGS -DHAVE_STRUCT_TIMESPEC -DHAVE_NETGEN_SOURCES -DUSE_TIMEOFDAY -DTCL -DLAPACK -DUSE_PARDISO -DNGS_PYTHON -DUSE_UMFPACK -D"CMAKE_INTDIR="RelWithDebInfo"" -Dngscudalib_EXPORTS -Xcompiler “/EHsc /W1 /nologo /O2 /FS /Zi  /MD /GR” -Xcompiler “/Fdngscudalib.dir\RelWithDebInfo\vc143.pdb” -o ngscudalib.dir\RelWithDebInfo\cuda_profiler.obj “C:\ngsolve-netgen\src\ngscuda\cuda_profiler.cu”

nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

I think problem is with:

/bigobj /arch:AVX512 /std:c++17 /wd4068

which are C++ parameter not nvcc.

If I manually change this part of command line to

-Xcompiler"/bigobj /arch:AVX512 /std:c++17 /wd4068"

then compilation finishes.

I am not enough skilled to change ngscuda\CMakeLists.txt to properly generate command line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions