[PR #2984] [CLOSED] fix(Mac): 0.1.45 does not compile on Metal (three CUDA-only calls in shared host files) #4379

Closed
opened 2026-11-07 15:35:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2984
Author: @SuperDistance
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: pr/mac-build-v045


📝 Commits (1)

  • 722bb54 metal: the Mac build compiles again (three CUDA-only calls in 0.1.45's shared sources)

📊 Changes

2 files changed (+9 additions, -3 deletions)

View changed files

📝 metal/include/metal_compat/cuda_runtime.h (+6 -0)
📝 src/core/verify.cpp (+3 -3)

📄 Description

Summary

0.1.45's Mac build should stop in two shared host files: three changes in this release call CUDA names that metal/include/metal_compat/cuda_runtime.h does not provide. This adds the Metal side of each, the way the code already does it elsewhere. CUDA and HIP are unchanged.

What changed

where came with fix
src/core/verify.cpp, make_stream #2326 (its last commit, fcf93bde, was not ported; @qiuzan2001 found it) && !defined(STRATA_GPU_METAL), as mtp.cpp guards the same two calls (default priority)
src/core/verify.cpp, device_is_sm75 #2222 Metal answers false, as HIP does (no Turing card, no compute capability)
metal/include/metal_compat/cuda_runtime.h #2666's peer-copy probe (peer_experts.cpp) cudaMemcpyPeer (the peer async copy and a sync; one GPU) and cudaDeviceDisablePeerAccess (unsupported, as enabling is), as e6ad6c81 added them to the HIP shim

How I checked

There is no Mac here, so I compiled the Mac build's shared host sources the way metal/CMakeLists.txt does (metal/include/metal_compat and metal/include first, STRATA_GPU_METAL=1, STRATA_NATIVE_EXPERTS=1, C++20), syntax only, with g++ 13 on Linux:

  • 0.1.45: 32 of the 34 files are clean; two fail with these 7 errors:
    src/core/verify.cpp:285: 'cudaDevAttrComputeCapabilityMajor' was not declared in this scope
    src/core/verify.cpp:286: 'cudaDevAttrComputeCapabilityMinor' was not declared in this scope
    src/core/verify.cpp:859: 'cudaDeviceGetStreamPriorityRange' was not declared in this scope
    src/core/verify.cpp:860: 'cudaStreamCreateWithPriority' was not declared in this scope
    src/core/peer_experts.cpp:72: 'cudaMemcpyPeer' was not declared in this scope
    src/core/peer_experts.cpp:157: 'cudaDeviceDisablePeerAccess' was not declared in this scope
    src/core/peer_experts.cpp:158: 'cudaDeviceDisablePeerAccess' was not declared in this scope
    
  • This branch: all 34 files are clean.
  • CUDA: the preprocessed verify.cpp and peer_experts.cpp are identical before and after (CUDA 13.0 headers).
  • HIP: both changed lines in verify.cpp take the branch they took before, and the shim is only on the Metal include path.

Not checked: a real Mac build and link (Apple clang, the metal-cpp side, the Metal kernels in metal/src/engine, which this does not touch), and running it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2984 **Author:** [@SuperDistance](https://github.com/SuperDistance) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/mac-build-v045` --- ### 📝 Commits (1) - [`722bb54`](https://github.com/Niko1221/Strata/commit/722bb54a9fdd7031bfb172f8e161180af41b4b8e) metal: the Mac build compiles again (three CUDA-only calls in 0.1.45's shared sources) ### 📊 Changes **2 files changed** (+9 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `metal/include/metal_compat/cuda_runtime.h` (+6 -0) 📝 `src/core/verify.cpp` (+3 -3) </details> ### 📄 Description ## Summary 0.1.45's Mac build should stop in two shared host files: three changes in this release call CUDA names that `metal/include/metal_compat/cuda_runtime.h` does not provide. This adds the Metal side of each, the way the code already does it elsewhere. CUDA and HIP are unchanged. ## What changed | where | came with | fix | | --- | --- | --- | | `src/core/verify.cpp`, `make_stream` | #2326 (its last commit, fcf93bde, was not ported; @qiuzan2001 found it) | `&& !defined(STRATA_GPU_METAL)`, as `mtp.cpp` guards the same two calls (default priority) | | `src/core/verify.cpp`, `device_is_sm75` | #2222 | Metal answers false, as HIP does (no Turing card, no compute capability) | | `metal/include/metal_compat/cuda_runtime.h` | #2666's peer-copy probe (`peer_experts.cpp`) | `cudaMemcpyPeer` (the peer async copy and a sync; one GPU) and `cudaDeviceDisablePeerAccess` (unsupported, as enabling is), as e6ad6c81 added them to the HIP shim | ## How I checked There is no Mac here, so I compiled the Mac build's shared host sources the way `metal/CMakeLists.txt` does (`metal/include/metal_compat` and `metal/include` first, `STRATA_GPU_METAL=1`, `STRATA_NATIVE_EXPERTS=1`, C++20), syntax only, with g++ 13 on Linux: - **0.1.45:** 32 of the 34 files are clean; two fail with these 7 errors: ``` src/core/verify.cpp:285: 'cudaDevAttrComputeCapabilityMajor' was not declared in this scope src/core/verify.cpp:286: 'cudaDevAttrComputeCapabilityMinor' was not declared in this scope src/core/verify.cpp:859: 'cudaDeviceGetStreamPriorityRange' was not declared in this scope src/core/verify.cpp:860: 'cudaStreamCreateWithPriority' was not declared in this scope src/core/peer_experts.cpp:72: 'cudaMemcpyPeer' was not declared in this scope src/core/peer_experts.cpp:157: 'cudaDeviceDisablePeerAccess' was not declared in this scope src/core/peer_experts.cpp:158: 'cudaDeviceDisablePeerAccess' was not declared in this scope ``` - **This branch:** all 34 files are clean. - **CUDA:** the preprocessed `verify.cpp` and `peer_experts.cpp` are identical before and after (CUDA 13.0 headers). - **HIP:** both changed lines in `verify.cpp` take the branch they took before, and the shim is only on the Metal include path. Not checked: a real Mac build and link (Apple clang, the metal-cpp side, the Metal kernels in `metal/src/engine`, which this does not touch), and running it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:17 +07:00
Sign in to join this conversation.
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
Niko1221/Strata#4379
No description provided.