IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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_PATH environment variable to point to a system ptxas binary from a CUDA Toolkit installation:

    export MODULAR_NVPTX_COMPILER_PATH=/usr/local/cuda/bin/ptxas

    This 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.

ArchitectureArch targetGPUs
Blackwellsm_100B200, B100
Blackwellsm_103B300
Blackwellsm_110Jetson Thor
Blackwellsm_120RTX 50XX series
Blackwellsm_121DGX Spark
Hoppersm_90H100, H200
Ada Lovelacesm_89L4, L40, RTX 40XX series
Amperesm_80A100
Amperesm_86A10, A1000, RTX 30XX series
Amperesm_87Jetson Orin, Orin Nano
Turingsm_75T4, 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 need sm_80 or 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_PATH environment variable to point to a system ptxas binary 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:

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.

ArchitectureArch targetGPUs
CDNA4gfx950MI355X
CDNA3gfx942MI300X, MI325X
CDNA2gfx90aMI250X
RDNA4gfx1201Radeon RX 9070
RDNA4gfx1200Radeon RX 9060
RDNA3.5gfx1150Radeon 880M, 890M
RDNA3.5gfx1151Radeon 8060S
RDNA3.5gfx1152Radeon 860M
RDNA3gfx1100Radeon RX 7900
RDNA3gfx1101Radeon RX 7800, RX 7700
RDNA3gfx1102Radeon RX 7600
RDNA3gfx1103Radeon 780M
RDNA2gfx1030Radeon RX 6900
RDNA2gfx1033Van 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.

ChipArch targetMetal 4 arch target
M5apple-m5apple-m5-metal4
M4apple-m4apple-m4-metal4
M3apple-m3apple-m3-metal4
M2apple-m2apple-m2-metal4
M1apple-m1apple-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:

  1. NVIDIA (CUDA): loads libcuda.so.1 and libnvidia-ml.so.1
  2. AMD (HIP): loads libamdhip64.so
  3. 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:

check_gpu.mojo
from max.gpu.host import DeviceContext

def main() raises:
    var ctx = DeviceContext()
    print("GPU:", ctx.name())
mojo check_gpu.mojo

If 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-smi shows the version in the top-right corner). If your driver is older, set MODULAR_NVPTX_COMPILER_PATH as described in the NVIDIA software requirements section above.
  • Ensure libcuda.so.1 is 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=1 to get detailed logging of the CUDA detection process.

AMD GPU not detected:

  • Verify that you have ROCm/HIP installed and that libamdhip64.so is available.
  • Check your ROCm version by running apt show rocm-libs 2>/dev/null | grep Version or rocm-smi --showdriverversion.
  • Ensure your user is in the render and video groups: 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_PATH to a compatible system ptxas binary. 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.

Was this page helpful?