Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packaging/windows/internal/vc_env_helper.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if "%VSDEVCMD_ARGS%" == "" (
if "%CU_VERSION%" == "xpu" call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"

set DISTUTILS_USE_SDK=1
set CL=%CL% /Zc:preprocessor

set args=%1
shift
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ def get_macros_and_flags():
if sys.platform == "win32":
define_macros += [("torchvision_EXPORTS", None)]
extra_compile_args["cxx"].append("/MP")
extra_compile_args["cxx"].append("/Zc:preprocessor")
if "nvcc" in extra_compile_args:
extra_compile_args["nvcc"].append("-Xcompiler")
extra_compile_args["nvcc"].append("/Zc:preprocessor")
extra_compile_args["nvcc"].append("-DCCCL_IGNORE_MSVC_TRADITIONAL_PREPROCESSOR_WARNING")
Comment on lines +132 to +135
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect this broke Windows ROCm builds: ROCm/TheRock#4463 as soon as we picked up this commit from the 'nightly' branch of this repository (e51b6cc)

2026-04-10T08:02:02.3608593Z FAILED: [code=1] B:/src/vision/build/temp.win-amd64-cpython-313/Release/torchvision/csrc/ops/hip/ps_roi_align_kernel.obj 
2026-04-10T08:02:02.3613939Z C:\home\runner\_work\_tool\Python\3.13.13\x64\Lib\site-packages\_rocm_sdk_devel\bin\hipcc.exe  -std=c++20 -Xcompiler -D__HIP_PLATFORM_AMD__=1 -Xcompiler -DUSE_ROCM=1 -Xcompiler -DHIPBLAS_V2 -Xcompiler -fms-runtime-lib=dll -DWITH_HIP -Dtorchvision_EXPORTS -IB:\src\vision\torchvision\csrc -IC:\home\runner\_work\_tool\Python\3.13.13\x64\Lib\site-packages\torch\include -IC:\home\runner\_work\_tool\Python\3.13.13\x64\Lib\site-packages\torch\include\torch\csrc\api\include -IC:\home\runner\_work\_tool\Python\3.13.13\x64\Lib\site-packages\torch\include\THH -IC:\home\runner\_work\_tool\Python\3.13.13\x64\Lib\site-packages\_rocm_sdk_devel\include -IC:\home\runner\_work\_tool\Python\3.13.13\x64\include -IC:\home\runner\_work\_tool\Python\3.13.13\x64\Include -IC:\Program\Files\Microsoft\Visual\Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include -IC:\Program\Files\Microsoft\Visual\Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\include -IC:\Program\Files\Microsoft\Visual\Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program\Files\(x86)\Windows\Kits\10\include\10.0.26100.0\ucrt -IC:\Program\Files\(x86)\Windows\Kits\10\\include\10.0.26100.0\\um -IC:\Program\Files\(x86)\Windows\Kits\10\\include\10.0.26100.0\\shared -IC:\Program\Files\(x86)\Windows\Kits\10\\include\10.0.26100.0\\winrt -IC:\Program\Files\(x86)\Windows\Kits\10\\include\10.0.26100.0\\cppwinrt -IC:\Program\Files\(x86)\Windows\Kits\NETFXSDK\4.8\include\um -c B:\src\vision\torchvision\csrc\ops\hip\ps_roi_align_kernel.hip -o B:\src\vision\build\temp.win-amd64-cpython-313\Release\torchvision\csrc\ops\hip\ps_roi_align_kernel.obj -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -DHIP_ENABLE_WARP_SYNC_BUILTINS=1 -fms-extensions -Wno-ignored-attributes -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -fms-runtime-lib=dll -Xcompiler /Zc:preprocessor -DCCCL_IGNORE_MSVC_TRADITIONAL_PREPROCESSOR_WARNING -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C --offload-arch=gfx1030 --offload-arch=gfx1031 --offload-arch=gfx1032 --offload-arch=gfx1034 -fno-gpu-rdc
2026-04-10T08:02:02.3619214Z clang: error: no such file or directory: '/Zc:preprocessor'

Seems like we're swapping out nvcc for hipcc which does not understand the MSVC style flag?

if sysconfig.get_config_var("Py_GIL_DISABLED"):
extra_compile_args["cxx"].append("-DPy_GIL_DISABLED")

Expand Down
Loading