Skip to content

ROCm llama.cpp with 9070xt on Windows 11. #2358

Description

@Zanonale

Which version of LM Studio?

LM Studio 0.4.23

Installed runtime:
llama.cpp-win-x86_64-amd-rocm-avx2-2.33.0

Installed ROCm vendor:
win-llama-rocm-vendor-v6

Which operating system?

Windows 11 64-bit

What is the bug?

On LM Studio 0.4.23, the AMD ROCm llama.cpp runtime fails GPU hardware survey on an AMD Radeon RX 9070 XT.

LM Studio shows:
GPU survey unsuccessful

Backend 'llama.cpp-win-x86_64-amd-rocm-avx2' requires GPU acceleration, but GPU survey software was unsuccessful with message:

Error trying to query ROCm GPUs: Failed to get memory info for hip device id "0".

Because the GPU survey fails, the ROCm runtime cannot be used normally in LM Studio.

The GPU architecture is gfx1201, and the issue does not appear to be caused by the GPU, driver, VRAM capacity, ROCm installation, model file, or GPU support in general.

I installed TheRock HIP 7.14.60850-2b22ab01 at:
C:\TheRock\build

HIP works correctly outside LM Studio. hipInfo detects the GPU and reads memory correctly:
Name: AMD Radeon RX 9070 XT
gcnArchName: gfx1201
memInfo.total: 15.92 GB
memInfo.free: 15.77 GB (99%)

Official upstream llama.cpp Windows ROCm build also works correctly on the same system with TheRock HIP 7.14. It detects the RX 9070 XT and successfully runs a Qwen3.8 27B IQ3_XXS model with full GPU offload (-ngl 99).

Successful upstream llama.cpp output:
ggml_cuda_init: found 1 ROCm devices (Total VRAM: 16304 MiB):
Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32, VRAM: 16304 MiB
load_backend: loaded ROCm backend from D:\Programs\Llama\ggml-hip.dll

Successful upstream benchmark:
Model: Qwen3.8-27B-UD-IQ3_XXS.gguf
Model size: 10.17 GiB
GPU layers: -ngl 99
Backend: ROCm
pp64: 577.14 tokens/s
tg64: 33.40 tokens/s
llama.cpp build: 0f3a71be1 (10760)

However, the bundled LM Studio ROCm runtime also crashes when launched manually, even outside the LM Studio GUI.

I tested the bundled LM Studio backend:
llama.cpp-win-x86_64-amd-rocm-avx2-2.33.0

with the bundled vendor:
win-llama-rocm-vendor-v6

I also tested the same bundled LM Studio backend while explicitly setting HIP_PATH, ROCM_PATH, HIP_DEVICE_LIB_PATH, and PATH to TheRock HIP 7.14. The crash is the same in both cases.

The crash happens while loading tensors with a small model:
gemma-3n-E4B-it-Q4_K_M.gguf

The Gemma model is only 3.95 GB. I used conservative settings:
-ngl 1
-c 512
-np 1
-b 64
-ub 64
-fa off

The bundled LM Studio runtime crashes during create_tensor loading with:
Exit code decimal: -1073741819
Exit code hex: 0xC0000005

0xC0000005 is a Windows access violation.

The last visible log lines are similar to:

load_tensors: loading model tensors, this can take a while...
create_tensor: loading tensor blk.8.attn_q.input_scale
create_tensor: loading tensor blk.9.attn_q.scale
create_tensor: loading tensor blk.9.attn_k.scale
create_tensor: loading tensor blk.9.attn_v.scale
create_tensor: loading tensor blk.9.attn_output.scale
create_tensor: loading tensor blk.9.ffn_gate.scale
create_tensor: loading tensor blk.9.ffn_down.scale
create_tensor: loading tensor blk.9.ffn_up.scale
Exit code: 0xC0000005

Before the crash, the bundled runtime also prints:
ggml_backend_cuda_device_get_memory: cudaMemGetInfo failed (invalid argument), returning 0/0

This warning appears related to the GPU survey error. In one manual test, the backend later reported a valid fallback memory value:
using device ROCm0 (AMD Radeon RX 9070 XT) (0000:0a:00.0) - 16229 MiB free

So the runtime can sometimes identify the GPU and free VRAM, but LM Studio still treats the initial memory query error as a failed survey, and the bundled server then crashes during tensor loading.

Screenshots

Attached screenshot shows the LM Studio runtime error:
GPU survey unsuccessful
Error trying to query ROCm GPUs: Failed to get memory info for hip device id "0".

Logs

System:
OS: Windows 11 64-bit
CPU: AMD Ryzen 7 5700X
GPU: AMD Radeon RX 9070 XT
GPU architecture: gfx1201
VRAM: 15.92 GB total
ROCm: TheRock HIP 7.14.60850-2b22ab01
TheRock path: C:\TheRock\build
LM Studio: 0.4.23
LM Studio ROCm runtime: llama.cpp-win-x86_64-amd-rocm-avx2-2.33.0
LM Studio ROCm vendor: win-llama-rocm-vendor-v6

The ROCm vendor directory contains gfx1201 Tensile files, including:
TensileLibrary_lazy_gfx1201.dat

Therefore, this does not appear to be caused by missing gfx1201 Tensile library files.

To Reproduce

  1. Use Windows 11 with an AMD Radeon RX 9070 XT, architecture gfx1201

  2. Install LM Studio 0.4.23

  3. Install the runtime:
    llama.cpp-win-x86_64-amd-rocm-avx2-2.33.0

  4. Open LM Studio and go to the Runtime Manager

  5. Observe that the ROCm runtime shows:

GPU survey unsuccessful
Error trying to query ROCm GPUs: Failed to get memory info for hip device id "0".

  1. Optional manual reproduction: run the bundled llama-server.exe from:

C:\Users\Zanonale.lmstudio\extensions\backends\llama.cpp-win-x86_64-amd-rocm-avx2-2.33.0

  1. Load a small GGUF such as gemma-3n-E4B-it-Q4_K_M.gguf with:
    -ngl 1
    -c 512
    -np 1
    -b 64
    -ub 64
    -fa off

  2. The bundled LM Studio ROCm server crashes during tensor loading with:

0xC0000005

Expected behavior

LM Studio should successfully survey the Radeon RX 9070 XT through ROCm and load GGUF models with GPU acceleration.

The same GPU, same Windows installation, same TheRock HIP 7.14 installation, and same GGUF models work correctly with the official upstream llama.cpp ROCm Windows build, including complete GPU offload with -ngl 99.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions