Repository navigation
Docker ROCm Studio image: run GGUF chat on the GPU through Vulkan - #13852
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…multi-GPU hosts [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9844a2cf8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| curl git ca-certificates supervisor ffmpeg \ | ||
| curl git ca-certificates supervisor ffmpeg libvulkan1 mesa-vulkan-drivers \ |
There was a problem hiding this comment.
Pin the Vulkan loader to the RADV ICD
On mixed-GPU hosts, installing mesa-vulkan-drivers without setting VK_DRIVER_FILES exposes the other Mesa ICDs as well as RADV. Studio's Vulkan probe will therefore include non-AMD adapters, and its automatic placement can prefer a discrete Intel GPU or split across unintended devices instead of using the ROCm AMD card. Neither this Dockerfile nor another image setting pins the loader, so resolve the installed radeon_icd*.json path and bake that into VK_DRIVER_FILES as intended.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not pinning on purpose. An image-wide VK_DRIVER_FILES overrides any VK_ICD_FILENAMES a user sets in the container and dangles if Mesa renames the manifest, while the case it guards (a discrete Intel or other non-AMD Vulkan GPU passed into the ROCm image next to the AMD card) still runs chat on a GPU, picked by the same placement Studio uses on bare-metal Vulkan hosts. Without the pin, Studio still used Vulkan0 RADV on gfx1151, and lavapipe is dropped by ggml as a CPU device.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #5405
GGUF chat in the AMD Studio image (
unsloth/unsloth-rocm, thestudiotag and-studiotags) ran on the CPU. Training, the notebooks and PyTorch inference already used the GPU, butDockerfile.studio-rocminstalled the CPU llama.cpp bundle, because a ROCm bundle is built per gfx family and would pin the image to one card.This installs the Vulkan llama.cpp bundle instead, run by Mesa's RADV driver. Vulkan is not tied to one architecture, the
/dev/drinode it opens is one ROCm already needs, and it is the backend Studio picks by itself on the Strix APUs outside Docker.libvulkan1+mesa-vulkan-drivers(RADV). NoVK_DRIVER_FILESpin: ggml already drops lavapipe as a CPU device, and an image-wide pin would override a user's ownVK_ICD_FILENAMES.UNSLOTH_LLAMA_CPP_BACKEND=vulkanforinstall.shin place ofcpu, plus a build-time assert that the installed marker saysvulkan.HIP_VISIBLE_DEVICES(on a multi-GPU host, pick the chat GPU in Studio or pass only that card's render node). The CUDA images, the ROCm training image (latestbuilt fromDockerfile.rocm) and the WSL2 DXG path are unchanged.Tested on a Strix Halo (Radeon 8060S, gfx1151), Linux, Docker
The head image was built on the runner from this branch's
docker/, on the same published base digest (sha-133a807) and the same Studio commit as the publishedsha-133a807-studio, which is the base arm. OnlyDockerfile.studio-rocmdiffers. Each arm is a fresh container with the docs' flags (--device /dev/kfd --device /dev/driplus numeric group ids), Studio started by the image's own launcher,unsloth/Qwen3-4B-Instruct-2507-GGUFQ4_K_M loaded through/api/inference/load, then three 256-token chats through/v1/chat/completions, in the order base, head, head, base.linux-x64-cpu,Available devices: (none)linux-x64-vulkan,Vulkan0: Radeon 8060S Graphics (RADV GFX1151)-ngl -1 --fit off-ngl -1 --fit off --device Vulkan0CPU model buffer size = 692.63 MiB,CPU_REPACK ... = 1683.28 MiBVulkan0 model buffer size = 2375.91 MiBtok/s is wall time per request including prefill, with Studio's default settings. The answers start with the same text on both sides.
Build:
llama.cpp b11541-mix-2500203 app-b11541-mix-2500203-linux-x64-vulkan.tar.gzfrom the new assert, andVulkan selected for GGUF inference; the PyTorch training backend is unchangedfrominstall.sh. The image grows by about 245 MB uncompressed.A second build at this head (no ICD pin) on the same runner covered the fallback and the upgrade path, same model and prompts:
VK_LOADER_DRIVERS_DISABLE=*radeon*, lavapipe still installed: how a CDNA host looks to llama.cpp)Available devices: (none)(ggml drops the CPU rasterizer), weights inCPU/CPU_REPACKbuffers, chat works at 38.6 / 39.0 / 39.1 tok/s, no error--device Vulkan0,Vulkan0 model buffer size = 2375.91 MiB, 70.0 / 70.7 / 72.8 tok/susing device Vulkan0 (Radeon 8060S Graphics (RADV GFX1151)), 70.5 / 70.6 / 71.6 tok/sTests:
tests/python/test_docker_rocm.pygains two checks on the Dockerfile (Vulkan backend plus the marker assert, the RADV packages); both fail onmain. Every test file that reads the changed files passes (123 tests).Not covered on real hardware: discrete RDNA cards, CDNA (RADV does not drive it, so llama.cpp sees no Vulkan device and stays on the CPU, the case simulated above), and the WSL2 DXG path, which has no
/dev/dri.The Studio regression switchboard (auth, settings, page crawl) at this head: NO_REGRESSION, 36 same, 3 DOM-only with 0 changed pixels (no Studio source differs).