Skip to content

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

Closed
SuperDistance wants to merge 1 commit into
Niko1221:mainfrom
SuperDistance:pr/mac-build-v045
Closed

SuperDistance wants to merge 1 commit into
Niko1221:mainfrom
SuperDistance:pr/mac-build-v045

Conversation

@SuperDistance

Copy link
Copy Markdown
Contributor

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, fcf93bd, 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 e6ad6c8 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.

…s shared sources)

The Metal build compiles the shared host sources with metal/include/metal_compat first on the include path, and
three changes in 0.1.45 call CUDA names its shim does not provide, so src/core/verify.cpp and
src/core/peer_experts.cpp stop there:

- verify.cpp make_stream (the concurrent read, Niko1221#2326; its last commit fcf93bd was not ported): the stream
  priority calls get the Metal guard mtp.cpp already has for the same calls (default priority).
- verify.cpp device_is_sm75 (Niko1221#2222): cudaDevAttrComputeCapabilityMajor/Minor; Metal has no Turing card, so it
  answers false, as on HIP.
- peer_experts.cpp (Niko1221#2666's peer-copy probe): cudaMemcpyPeer and cudaDeviceDisablePeerAccess go into the shim, as
  e6ad6c8 added them to the HIP one. One GPU: the copy is the peer async copy and a sync; disabling answers
  unsupported, as enabling does.

CUDA and HIP see no change: CUDA's preprocessed verify.cpp and peer_experts.cpp are identical before and after.
@Niko1221

Copy link
Copy Markdown
Owner

Thanks for the pull request.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Rebase on main if it no longer applies, and re-run your checks on 0.2.0-beta.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the pull request template: the problem and result, and the validation (what you ran, on which revision, what you saw).
  4. Comment /reopen. A check runs and either reopens the pull request or lists what is still missing.

The rules are in CONTRIBUTING.md.

@Niko1221 Niko1221 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants