Skip to content

Add /Zc:preprocessor for CUDA 13.2 on MSVC.#183

Merged
simogasp merged 1 commit intoalicevision:developfrom
BillyONeal:fix-msvc-cuda-13-2
Apr 30, 2026
Merged

Add /Zc:preprocessor for CUDA 13.2 on MSVC.#183
simogasp merged 1 commit intoalicevision:developfrom
BillyONeal:fix-msvc-cuda-13-2

Conversation

@BillyONeal
Copy link
Copy Markdown
Contributor

@BillyONeal BillyONeal commented Apr 29, 2026

This change was prepared with assistance from GPT 5.4.

Checklist

Related: microsoft/vcpkg#51210

  • I have read the contribution guidelines.
    The guidelines there suggest creating an issue but that seems to be about adding a new feature or major change and I don't think this qualifies so I haven't created one.
  • I have updated the documentation, if applicable.
    (Not applicable)
  • I have ensured that the change is tested somewhere.
    It works on my machine™️
  • I have followed the prevailing code style (for history readability and limit conflicts for maintenance).
    GPT 5.4 actually failed at this and I had to fix it 😅. I observe that this file has some indents using tabs and others using spaces. It seems like tabs are most of the time. I would reindent them all to use 8 spaces but that would have made the patch much larger, so I'm initially only submitting this 3 line change.
    screenshot with visible whitespace showing some tabs

Description

Hopefully resolves the following build error:

Run Build Command(s): D:\downloads\tools\ninja-1.13.2-windows\ninja.exe -v -v -j33 install
[1/32] C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\bin\nvcc.exe -forward-unknown-to-host-compiler -Dpopsift_EXPORTS -ID:\b\popsift\src\v0.10.0-4df863d942.clean\src -ID:\b\popsift\x64-windows-dbg\src\generated -ID:\b\popsift\x64-windows-dbg\src\generated\popsift -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include" -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include\cccl" -D_WINDOWS -Xcompiler=" /EHsc" -Xcompiler=" -Zi -Ob0 -Od /RTC1" -std=c++17 -arch=all-major -Xcompiler=-MDd -MD -MT src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -MF src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj.d -x cu -rdc=true -c D:\b\popsift\src\v0.10.0-4df863d942.clean\src\popsift\s_filtergrid.cu -o src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -Xcompiler=-Fdsrc\CMakeFiles\popsift.dir\,-FS
FAILED: [code=2] src/CMakeFiles/popsift.dir/popsift/s_filtergrid.cu.obj
C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\bin\nvcc.exe -forward-unknown-to-host-compiler -Dpopsift_EXPORTS -ID:\b\popsift\src\v0.10.0-4df863d942.clean\src -ID:\b\popsift\x64-windows-dbg\src\generated -ID:\b\popsift\x64-windows-dbg\src\generated\popsift -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include" -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include\cccl" -D_WINDOWS -Xcompiler=" /EHsc" -Xcompiler=" -Zi -Ob0 -Od /RTC1" -std=c++17 -arch=all-major -Xcompiler=-MDd -MD -MT src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -MF src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj.d -x cu -rdc=true -c D:\b\popsift\src\v0.10.0-4df863d942.clean\src\popsift\s_filtergrid.cu -o src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -Xcompiler=-Fdsrc\CMakeFiles\popsift.dir\,-FS
C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\include\cccl\cuda/std/__cccl/preprocessor.h(23): fatal error C1189: #error:  MSVC/cl.exe with traditional preprocessor is used. This may lead to unexpected compilation errors. Please switch to the standard conforming preprocessor by passing `/Zc:preprocessor` to cl.exe. You can define CCCL_IGNORE_MSVC_TRADITIONAL_PREPROCESSOR_WARNING to suppress this warning.
s_filtergrid.cu

Features list

Not applicable.

Implementation remarks

Not applicable. (Other than what's already mentioned in the checklist)

Hopefully resolves the following build error:

```
Run Build Command(s): D:\downloads\tools\ninja-1.13.2-windows\ninja.exe -v -v -j33 install
[1/32] C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\bin\nvcc.exe -forward-unknown-to-host-compiler -Dpopsift_EXPORTS -ID:\b\popsift\src\v0.10.0-4df863d942.clean\src -ID:\b\popsift\x64-windows-dbg\src\generated -ID:\b\popsift\x64-windows-dbg\src\generated\popsift -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include" -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include\cccl" -D_WINDOWS -Xcompiler=" /EHsc" -Xcompiler=" -Zi -Ob0 -Od /RTC1" -std=c++17 -arch=all-major -Xcompiler=-MDd -MD -MT src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -MF src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj.d -x cu -rdc=true -c D:\b\popsift\src\v0.10.0-4df863d942.clean\src\popsift\s_filtergrid.cu -o src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -Xcompiler=-Fdsrc\CMakeFiles\popsift.dir\,-FS
FAILED: [code=2] src/CMakeFiles/popsift.dir/popsift/s_filtergrid.cu.obj
C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\bin\nvcc.exe -forward-unknown-to-host-compiler -Dpopsift_EXPORTS -ID:\b\popsift\src\v0.10.0-4df863d942.clean\src -ID:\b\popsift\x64-windows-dbg\src\generated -ID:\b\popsift\x64-windows-dbg\src\generated\popsift -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include" -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include\cccl" -D_WINDOWS -Xcompiler=" /EHsc" -Xcompiler=" -Zi -Ob0 -Od /RTC1" -std=c++17 -arch=all-major -Xcompiler=-MDd -MD -MT src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -MF src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj.d -x cu -rdc=true -c D:\b\popsift\src\v0.10.0-4df863d942.clean\src\popsift\s_filtergrid.cu -o src\CMakeFiles\popsift.dir\popsift\s_filtergrid.cu.obj -Xcompiler=-Fdsrc\CMakeFiles\popsift.dir\,-FS
C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\include\cccl\cuda/std/__cccl/preprocessor.h(23): fatal error C1189: #error:  MSVC/cl.exe with traditional preprocessor is used. This may lead to unexpected compilation errors. Please switch to the standard conforming preprocessor by passing `/Zc:preprocessor` to cl.exe. You can define CCCL_IGNORE_MSVC_TRADITIONAL_PREPROCESSOR_WARNING to suppress this warning.
s_filtergrid.cu
```

This change was prepared with assistance from GPT 5.4.

Related: microsoft/vcpkg#51210
Copy link
Copy Markdown
Member

@simogasp simogasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simogasp
Copy link
Copy Markdown
Member

simogasp commented Apr 30, 2026

Thanks for the PRs!
I can make another minor version if you need this on vcpkg.

@simogasp simogasp merged commit f9b94fe into alicevision:develop Apr 30, 2026
5 checks passed
simogasp pushed a commit that referenced this pull request Apr 30, 2026
…ngs.

I noticed this while filling out the checklist for #183
@BillyONeal
Copy link
Copy Markdown
Contributor Author

I can make another minor version if you need this on vcpkg.

It's a short patch so not something we need a release for. But your non-vcpkg MSVC customers might want it fixed when they update to CUDA 13.2 themselves.

@BillyONeal BillyONeal deleted the fix-msvc-cuda-13-2 branch April 30, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants