Skip to content

CUDA compilation fails on Blackwell (sm_120) with MXFP4: "Instruction 'mma with block scale' not supported" #19662

Description

@karolysovagoozeki

Git commit

git rev-parse HEAD
d5dfc33

Operating systems

Linux

GGML backends

CUDA

Problem description & steps to reproduce

Environment
GPU: NVIDIA RTX PRO 6000 Blackwell Workstation Edition (compute capability 12.0)

CUDA Toolkit: 13.1.115 (installed to /usr/local/cuda-13.1)

OS: Ubuntu 24.04

llama.cpp commit: Latest master (as of 2026-02-16)

CMake version: 3.28.3

Compiler: GCC 13.3.0

Problem
Building llama.cpp with CUDA support fails during PTX assembly when compiling MXFP4 template instances for sm_120 (Blackwell architecture). The build process encounters hundreds of errors from ptxas indicating that MXFP4-related instructions are not supported on the sm_120 target.

Build Configuration

cmake llama.cpp -B llama.cpp/build
-DBUILD_SHARED_LIBS=OFF
-DGGML_CUDA=ON
-DLLAMA_CURL=ON
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
-DCMAKE_CUDA_ARCHITECTURES=120

Error Output

ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error : Instruction 'mma with block scale' not supported on .target 'sm_120'
ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error : Feature '.kind::mxf4' not supported on .target 'sm_120'
ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error : Feature '.block_scale' not supported on .target 'sm_120'
ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error : Feature '.scale_vec::2X' not supported on .target 'sm_120'
...
ptxas fatal : Ptx assembly aborted due to errors
gmake[3]: *** [ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/build.make:1547: ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-mxfp4.cu.o] Error 255
Additional Details
The error occurs specifically in mmq-instance-mxfp4.cu compilation

Using -DGGML_CUDA_MXFP4=OFF does not prevent the compilation of MXFP4 template instances

The MXFP4 code appears to be compiled unconditionally for sm_120 targets

ptxas --version confirms CUDA 13.1.115 is being used

nvidia-smi confirms the GPU is properly detected with compute capability 12.0

Workaround
Rolling back to commit caf5681 (pre-MXFP4) allows successful compilation on sm_120, but this version lacks support for newer model architectures like mistral3 (Devstral models).

Expected Behavior
Either:

MXFP4 code should compile successfully for sm_120 (Blackwell) when using CUDA 13.1+, or

There should be a working CMake flag to disable MXFP4 compilation entirely for architectures where it's not yet supported, or

MXFP4 template instantiation should be automatically skipped for sm_120 until proper support is available

Use Case
We're trying to run Devstral-Small-2-24B-Instruct models on Blackwell hardware with CUDA acceleration. The current state makes it impossible to build a version that supports both the new architecture and the new GPU.

Question
Is MXFP4 + Blackwell (sm_120) support planned? If so, what's the timeline? Should we expect this to work with CUDA 13.1, or is a newer toolkit version required?

First Bad Commit

No response

Compile command

cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-gguf-split

Relevant log output

ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error   : Instruction 'mma with block scale' not supported on .target 'sm_120'
ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error   : Feature '.kind::mxf4' not supported on .target 'sm_120'
ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error   : Feature '.block_scale' not supported on .target 'sm_120'
ptxas /tmp/tmpxft_00021d12_00000000-7_mmq-instance-mxfp4.ptx, line 110582; error   : Feature '.scale_vec::2X' not supported on .target 'sm_120'
...
ptxas fatal   : Ptx assembly aborted due to errors
gmake[3]: *** [ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/build.make:1547: ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-mxfp4.cu.o] Error 255

Metadata

Metadata

Assignees

No one assigned

    Labels

    CUDARelated to the CUDA backendbugSomething isn't workingbuildCompilation issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions