[GH-ISSUE #544] HIP build on Windows fails with VS 2026 Build Tools (MSVC STL 14.51) #220

Open
opened 2026-10-29 21:22:50 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @wonder-sound on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/544


HIP build on Windows fails with VS 2026 Build Tools (MSVC STL 14.51): "device function 'isgreater' cannot overload host device function"

Summary

START-MAYA.bat --backend hip --gpu 0 --setup on a Ryzen AI Max+ 395 / Radeon 8060S (gfx1151) machine fails CMake's HIP compiler test when the only Visual Studio is VS 2026 Build Tools (MSVC toolset 14.51.36231). ROCm 7.2's HIP math headers declare isgreater, isless, isunordered etc. as __device__-only, while the newer MSVC STL <cmath> declares them host+device (_CLANG_BUILTIN2) under clang, which HIP rejects as an illegal overload. Even the trivial testHIPCompiler.hip cannot compile.

Environment

  • GPU: AMD Radeon 8060S (Ryzen AI Max+ 395, gfx1151), 128 GB unified memory, Variable Graphics Memory 118 GB
  • OS: Windows 11 (native, not WSL2)
  • ROCm / HIP SDK: AMD HIP SDK 7.2 (C:\Program Files\AMD\ROCm\7.2)
  • Visual Studio: Build Tools 2026 ("Microsoft Visual Studio\18\BuildTools", MSVC 14.51.36231) — no VS 2022 installed
  • Python: 3.14.7 (all Python packages in step 3 installed fine; unrelated to this failure)
  • Page file 127 GB — setup's --check and setup checks all passed before the build

Error (from maya-setup.log)

-- Check for working HIP compiler: C:/Program Files/AMD/ROCm/7.2/bin/clang++.exe - broken
[1/2] "C:\Program Files\AMD\ROCm\7.2\bin\clang++.exe" --offload-arch=gfx1151 \
      -o CMakeFiles\cmTC_5c9d1.dir\testHIPCompiler.hip.obj -c ...\testHIPCompiler.hip
C:\Program Files\AMD\ROCm\7.2\lib\clang\21\include\__clang_cuda_math_forward_declares.h:92:17:
error: __device__ function 'isgreater' cannot overload __host__ __device__ function 'isgreater'
   92 | __DEVICE__ bool isgreater(double, double);
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\include\cmath:688:17:
note: previous declaration is here
  688 | _CLANG_BUILTIN2(isgreater)
... (same for isgreaterequal, isless, islessequal, islessgreater, isunordered,
     also in __clang_hip_cmath.h) ...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated when compiling for gfx1151.
ninja: build stopped: subcommand failed.
CMake Error at .venv/.../CMakeTestHIPCompiler.cmake:71 (message):
  The HIP compiler ... is not able to compile a simple test program.
cmake/hip_backend.cmake:79 (enable_language)
[X] the HIP engine build failed

Notes / suggested handling

  • #249 taught setup to accept VS 2026 for HIP ("ROCm's clang takes any VS"), but with HIP SDK 7.2's clang 21 headers this combination fails at the compiler probe — VS 2026's STL is newer than anything ROCm 7.2 shipped against.
  • Workaround found: install VS 2022 Build Tools alongside (setup prefers a VS 2022 instance); delete build-hip and re-run setup. (Just confirm it now works.)
  • Ideas: detect MSVC STL >= VS 2026 / _MSC_VER >= 195x on the HIP path and warn with "install VS 2022 Build Tools", or add the necessary header shim (e.g. suppress/extend the __DEVICE__ forward declares when the STL already declares host+device builtins), or validate the ROCm SDK wheels path against VS 2026.

Full maya-setup.log and maya-report.txt attached.
maya-setup.log
maya-report.txt

Originally created by @wonder-sound on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/544 --- HIP build on Windows fails with VS 2026 Build Tools (MSVC STL 14.51): "__device__ function 'isgreater' cannot overload __host__ __device__ function" --- ## Summary `START-MAYA.bat --backend hip --gpu 0 --setup` on a Ryzen AI Max+ 395 / Radeon 8060S (gfx1151) machine fails CMake's HIP compiler test when the only Visual Studio is **VS 2026 Build Tools (MSVC toolset 14.51.36231)**. ROCm 7.2's HIP math headers declare `isgreater`, `isless`, `isunordered` etc. as `__device__`-only, while the newer MSVC STL `<cmath>` declares them host+device (`_CLANG_BUILTIN2`) under clang, which HIP rejects as an illegal overload. Even the trivial `testHIPCompiler.hip` cannot compile. ## Environment - GPU: AMD Radeon 8060S (Ryzen AI Max+ 395, gfx1151), 128 GB unified memory, Variable Graphics Memory 118 GB - OS: Windows 11 (native, not WSL2) - ROCm / HIP SDK: AMD HIP SDK 7.2 (`C:\Program Files\AMD\ROCm\7.2`) - Visual Studio: Build Tools 2026 ("Microsoft Visual Studio\18\BuildTools", MSVC 14.51.36231) — no VS 2022 installed - Python: 3.14.7 (all Python packages in step 3 installed fine; unrelated to this failure) - Page file 127 GB — setup's `--check` and setup checks all passed before the build ## Error (from maya-setup.log) ``` -- Check for working HIP compiler: C:/Program Files/AMD/ROCm/7.2/bin/clang++.exe - broken [1/2] "C:\Program Files\AMD\ROCm\7.2\bin\clang++.exe" --offload-arch=gfx1151 \ -o CMakeFiles\cmTC_5c9d1.dir\testHIPCompiler.hip.obj -c ...\testHIPCompiler.hip C:\Program Files\AMD\ROCm\7.2\lib\clang\21\include\__clang_cuda_math_forward_declares.h:92:17: error: __device__ function 'isgreater' cannot overload __host__ __device__ function 'isgreater' 92 | __DEVICE__ bool isgreater(double, double); C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\include\cmath:688:17: note: previous declaration is here 688 | _CLANG_BUILTIN2(isgreater) ... (same for isgreaterequal, isless, islessequal, islessgreater, isunordered, also in __clang_hip_cmath.h) ... fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated when compiling for gfx1151. ninja: build stopped: subcommand failed. CMake Error at .venv/.../CMakeTestHIPCompiler.cmake:71 (message): The HIP compiler ... is not able to compile a simple test program. cmake/hip_backend.cmake:79 (enable_language) [X] the HIP engine build failed ``` ## Notes / suggested handling - #249 taught setup to accept VS 2026 for HIP ("ROCm's clang takes any VS"), but with HIP SDK 7.2's clang 21 headers this combination fails at the compiler probe — VS 2026's STL is newer than anything ROCm 7.2 shipped against. - Workaround found: install VS 2022 Build Tools alongside (setup prefers a VS 2022 instance); delete `build-hip` and re-run setup. (Just confirm it now works.) - Ideas: detect MSVC STL >= VS 2026 / `_MSC_VER >= 195x` on the HIP path and warn with "install VS 2022 Build Tools", or add the necessary header shim (e.g. suppress/extend the `__DEVICE__` forward declares when the STL already declares host+device builtins), or validate the ROCm SDK wheels path against VS 2026. Full `maya-setup.log` and `maya-report.txt` attached. [maya-setup.log](https://github.com/user-attachments/files/34016403/maya-setup.log) [maya-report.txt](https://github.com/user-attachments/files/34016404/maya-report.txt)
Author
Owner

@mw00 commented on GitHub (Oct 27, 2026):

Thank you for the exact error and the workaround. v1.1.34's setup says this up front. When the only Visual Studio is 2026 it warns that ROCm 7.2's compiler can stop on the newer C++ library's math headers, and a failed HIP build now names the fix: install the VS 2022 Build Tools beside it, delete build-hip, and run the setup again. The setup already prefers 2022. Making ROCm 7.2's headers and VS 2026's library work together is for a later ROCm or a header fix. Keeping this open until one of them lands.

Released in v1.1.34: https://github.com/mw00/project-maya/releases/tag/v1.1.34

<!-- gh-comment-id:6456004305 --> @mw00 commented on GitHub (Oct 27, 2026): Thank you for the exact error and the workaround. v1.1.34's setup says this up front. When the only Visual Studio is 2026 it warns that ROCm 7.2's compiler can stop on the newer C++ library's math headers, and a failed HIP build now names the fix: install the VS 2022 Build Tools beside it, delete `build-hip`, and run the setup again. The setup already prefers 2022. Making ROCm 7.2's headers and VS 2026's library work together is for a later ROCm or a header fix. Keeping this open until one of them lands. Released in **v1.1.34**: https://github.com/mw00/project-maya/releases/tag/v1.1.34
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#220
No description provided.