Run CUDA on Apple Silicon.
CuMetal compiles your CUDA kernels to Metal without rewriting them.

brew install lulzx/tap/cumetal

CUDA C++ and PTX source

Compile CUDA ahead of time.

$ cumetalc kernel.cu -o kernel

Supported CUDA C++ and PTX become Metal Shading Language, which Apple’s own tools build into a metallib. The metallib is embedded in your executable, so the app compiles nothing when it first launches.

How it’s built

  1. 01 No JIT at launch. The compiled Metal library ships inside the binary. On the direct CUDA C++ path, no PTX is JIT-compiled when the app first runs.
  2. 02 Typed IR end to end. CUDA C++ goes through a typed CuMetal IR. PTX import resolves every value from its SSA definition, with checked types.
  3. 03 Memory access is proved. Memory is lowered only where range and alignment proofs hold. Where a proof fails, the access keeps its barrier.
  4. 04 Public APIs only. CuMetal calls only public, documented Metal APIs.

Workloads tested.

Each demo’s gate checks its numerical or domain output and confirms the work ran on the Apple GPU. A clean exit alone does not pass.

How to run every demo ↗
  1. 01vectorAdd to path tracer ↗ Apollo The place to start. One command runs vector addition, a reduction, SGEMM and a path tracer in turn.
  2. 022.03 TFLOP/s, M4 Pro ↗ Matmul vs MPS A tuned CUDA SGEMM kernel compared against MPS and Accelerate.
  3. 03renderCUDA + binning ↗ 3D Gaussian Splatting Inria’s tile-based Gaussian rasterizer, with tile sorting and blending on the GPU.
  4. 04~200,000 particles ↗ SPH dam break A weakly compressible fluid. Neighbour search, physics and rasterizer are all CUDA kernels.
  5. 055.2e-6 vs PyTorch ↗ Tiny diffusion A DDPM trained on MNIST, sampled by hand-written CUDA kernels over 1,000 denoising steps.
  6. 06afiro LP ↗ HiGHS / cuPDLP-C Linear programming on CPU and Apple GPU, gated on matching status, objective and residuals.
  7. 0724,040 atoms, 6.8e-5 ↗ GROMACS 2025.4 Runs unmodified, with nonbonded and listed forces, the PME step with 3D FFT, and constraints on the GPU.
  8. 085.53e-9 after 200 steps ↗ AMReX 25.09 Block-structured AMR through its unmodified CUDA backend, compared plotfile to plotfile.
  9. 0932,000 atoms, 100 steps ↗ LAMMPS / Kokkos Unmodified Lennard-Jones benchmark with full and half neighbour lists, against CPU double precision.

Limitations.

CuMetal is experimental. It supports tested subsets of CUDA and its libraries, so expect gaps when you port existing code.

Warp width is fixed at 32. FP64 is emulated. SASS binaries don’t run. Multi-GPU, peer access and graphics interop are unsupported; cooperative grids, dynamic launch, graphs and textures are partial.

Read the known gaps ↗

Get started on Apple Silicon, macOS 14+

  1. 01 installbrew install lulzx/tap/cumetal
  2. 02 checkcumetal doctor
  3. 03 runcumetalc kernel.cu -o kernel && ./kernel
Apache 2.0 / Legal notice
Build from source Contribute GitHub