For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Hardware compatibility
This page lists the GPUs you can program with Mojo and MAX and the software each one requires. It covers writing and running your own GPU code, such as kernels and custom ops. For the GPUs supported for serving models, see the MAX system requirements.
NVIDIA GPUs
You can program NVIDIA data center, consumer, and Jetson GPUs from Turing
(sm_75) through Blackwell.
Software requirements
To program NVIDIA GPUs, you need the following software:
-
NVIDIA GPU driver 580 or later (CUDA 13.0 or later).
Check your driver version with
nvidia-smi. To update, see the NVIDIA driver docs. With an older driver, the runtime raises an error that names the required and detected versions. -
Older drivers: If you're using an NVIDIA driver older than 580 (common on some cloud providers), set the
MODULAR_NVPTX_COMPILER_PATHenvironment variable to point to a systemptxasbinary from a CUDA Toolkit installation:export MODULAR_NVPTX_COMPILER_PATH=/usr/local/cuda/bin/ptxasThis bypasses the bundled compiler's driver version check and enables Mojo to compile GPU code with your existing driver.
Hardware compatibility
The following table lists the compatible NVIDIA GPUs and the arch target for each one.
By default, Mojo compiles GPU code for the first GPU it detects on the machine
that runs the compiler. To compile for a different GPU, such as when you
cross-compile on a machine that doesn't have that GPU, pass its arch target to
mojo build --target-accelerator. For details, see Accelerator
targets.
| Architecture | Arch target | GPUs |
|---|---|---|
| Blackwell | sm_100 | B200, B100 |
| Blackwell | sm_103 | B300 |
| Blackwell | sm_110 | Jetson Thor |
| Blackwell | sm_120 | RTX 50XX series |
| Blackwell | sm_121 | DGX Spark |
| Hopper | sm_90 | H100, H200 |
| Ada Lovelace | sm_89 | L4, L40, RTX 40XX series |
| Ampere | sm_80 | A100 |
| Ampere | sm_86 | A10, A1000, RTX 30XX series |
| Ampere | sm_87 | Jetson Orin, Orin Nano |
| Turing | sm_75 | T4, RTX 20XX series |
Notes
- Turing (
sm_75) is the oldest architecture that works out of the box. Your own kernels and custom ops run on it, but MAX's built-in matmul requires Ampere (sm_80) or later, so models that use it fail. Tensor-core code paths also needsm_80or later. - Pre-Turing GPUs (such as Pascal-generation GTX 10XX and Tesla P100) don't work
out of the box. To use Mojo on these GPUs, set the
MODULAR_NVPTX_COMPILER_PATHenvironment variable to point to a systemptxasbinary compatible with your hardware and driver version. - A device fault, such as an illegal memory access or a failed assertion in a kernel, raises an error and leaves the CUDA context unusable. Restart the process before you launch more GPU work.
AMD GPUs
You can program AMD Instinct data center GPUs from CDNA2 onward and Radeon GPUs from RDNA2 onward.
Software requirements
To program AMD GPUs, you need the following software:
-
AMD GPU driver 6.3.3 or later (MI355X requires ROCm 7.0 or later)
- For data center GPUs (Instinct series), see the Ubuntu native install guide.
- For Radeon GPUs on Ubuntu, see the Linux install guide for Radeon software.
- For Radeon GPUs on WSL, see the WSL install guide for Radeon software.
Hardware compatibility
The following table lists the compatible AMD GPUs and the arch target for each one.
By default, Mojo compiles GPU code for the first GPU it detects on the machine
that runs the compiler. To compile for a different GPU, such as when you
cross-compile on a machine that doesn't have that GPU, pass its arch target to
mojo build --target-accelerator. For details, see Accelerator
targets.
| Architecture | Arch target | GPUs |
|---|---|---|
| CDNA4 | gfx950 | MI355X |
| CDNA3 | gfx942 | MI300X, MI325X |
| CDNA2 | gfx90a | MI250X |
| RDNA4 | gfx1201 | Radeon RX 9070 |
| RDNA4 | gfx1200 | Radeon RX 9060 |
| RDNA3.5 | gfx1150 | Radeon 880M, 890M |
| RDNA3.5 | gfx1151 | Radeon 8060S |
| RDNA3.5 | gfx1152 | Radeon 860M |
| RDNA3 | gfx1100 | Radeon RX 7900 |
| RDNA3 | gfx1101 | Radeon RX 7800, RX 7700 |
| RDNA3 | gfx1102 | Radeon RX 7600 |
| RDNA3 | gfx1103 | Radeon 780M |
| RDNA2 | gfx1030 | Radeon RX 6900 |
| RDNA2 | gfx1033 | Van Gogh (Steam Deck) |
Apple silicon GPUs
You can program the GPUs in Apple silicon M1 through M5 chips.
Software requirements
To program Apple silicon GPUs, you need the following software:
-
macOS Sequoia (15) or later.
-
Xcode 16 or later.
-
You may need to install the Metal toolchain after upgrading macOS or Xcode:
xcodebuild -downloadComponent MetalToolchain
Hardware compatibility
The following table lists the compatible Apple silicon chips and the arch targets for each one. Each chip has a second arch target for Metal 4, which requires macOS 26 or later.
By default, Mojo compiles GPU code for the first GPU it detects on the machine
that runs the compiler. To compile for a different GPU, such as when you
cross-compile on a machine that doesn't have that GPU, pass its arch target to
mojo build --target-accelerator. For details, see Accelerator
targets.
| Chip | Arch target | Metal 4 arch target |
|---|---|---|
| M5 | apple-m5 | apple-m5-metal4 |
| M4 | apple-m4 | apple-m4-metal4 |
| M3 | apple-m3 | apple-m3-metal4 |
| M2 | apple-m2 | apple-m2-metal4 |
| M1 | apple-m1 | apple-m1-metal4 |
On M1, general GPU programming and many basic models work, but some kernels that work on later Apple silicon fail.
Troubleshooting GPU detection
If Mojo doesn't find your GPU, use this section to see how Mojo detects GPUs, verify GPU access, and fix common issues.
What Mojo looks for
When Mojo needs a GPU, the runtime attempts to load vendor-specific driver libraries in this order:
- NVIDIA (CUDA): loads
libcuda.so.1andlibnvidia-ml.so.1 - AMD (HIP): loads
libamdhip64.so - Apple (Metal): uses the Metal framework (built into macOS)
If Mojo can't load any of these libraries, it falls back to CPU execution.
Verifying GPU access
To check that Mojo can find and use your GPU, run a minimal GPU program:
from max.gpu.host import DeviceContext
def main() raises:
var ctx = DeviceContext()
print("GPU:", ctx.name())mojo check_gpu.mojoIf Mojo finds a GPU, the program prints its name. Otherwise, it raises an error that explains what it tried.
Common issues
GPU not detected despite nvidia-smi showing a GPU:
- Verify that the NVIDIA driver version is 580 or later (
nvidia-smishows the version in the top-right corner). If your driver is older, setMODULAR_NVPTX_COMPILER_PATHas described in the NVIDIA software requirements section above. - Ensure
libcuda.so.1is on your library path. On most systems, the NVIDIA driver installer places it in/usr/lib/x86_64-linux-gnu/or/usr/lib64/. - If using a container, make sure you're passing GPU access through (for
example,
docker run --gpus all). - Set
MLRT_CUDA_DEBUG=1to get detailed logging of the CUDA detection process.
AMD GPU not detected:
- Verify that you have ROCm/HIP installed and that
libamdhip64.sois available. - Check your ROCm version by running
apt show rocm-libs 2>/dev/null | grep Versionorrocm-smi --showdriverversion. - Ensure your user is in the
renderandvideogroups:sudo usermod -aG render,video $USER(then log out and back in).
Apple GPU not detected or Metal toolchain errors:
-
If compiling GPU code fails with an error like the following, install the Metal toolchain with
xcodebuild -downloadComponent MetalToolchain:error: Metal Compiler failed to compile metallib. Please submit a bug report.You may need to do this again after you upgrade macOS or Xcode.
-
Ensure you're on macOS Sequoia (15) or later. To see your macOS version, run
sw_vers -productVersion. -
Make sure the Xcode Command Line Tools are installed. To install them, run
xcode-select --install.
Pre-Turing NVIDIA GPU errors:
- Set
MODULAR_NVPTX_COMPILER_PATHto a compatible systemptxasbinary. For example:export MODULAR_NVPTX_COMPILER_PATH=/usr/local/cuda/bin/ptxas.
WSL: GPU not detected or driver mismatch:
- Make sure you follow the WSL-specific installation instructions for your GPU vendor, not the native Linux instructions.
- For NVIDIA on WSL, install the GPU driver on the Windows host, not inside WSL. WSL automatically makes the host driver available.
- For AMD on WSL, see the WSL install guide for Radeon software.