Skip to content

fix: enable TheRock ROCm installation on Windows for Radeon RX GPUs#2093

Open
anditherobot wants to merge 8 commits into
lemonade-sdk:mainfrom
anditherobot:fix/2050-therock-windows-rocm
Open

fix: enable TheRock ROCm installation on Windows for Radeon RX GPUs#2093
anditherobot wants to merge 8 commits into
lemonade-sdk:mainfrom
anditherobot:fix/2050-therock-windows-rocm

Conversation

@anditherobot
Copy link
Copy Markdown
Contributor

@anditherobot anditherobot commented Jun 4, 2026

fix: enable TheRock ROCm installation on Windows for Radeon RX GPUs (#2050)

Summary

Enables TheRock installation for Radeon RX GPUs when Lemonade detects the GPU by a family architecture code such as gfx120X.

In the reported Windows RX 9060 XT case, Lemonade correctly identifies the card as gfx120X. That code means the RX 9000 / RDNA4 GPU family. However, backend_versions.json did not list gfx120X, so Lemonade skipped the TheRock install step.

Change

Adds the Radeon RX family architecture codes to the TheRock install metadata:

GPU Series Architecture Code TheRock Package
RX 5000 gfx101X gfx101X-dgpu
RX 6000 gfx103X gfx103X-all
RX 7000 gfx110X gfx110X-all
RX 9000 gfx120X gfx120X-all

Also adds RX 5000 name detection so cards such as RX 5700 XT can resolve to gfx101X.

Testing

  • Confirmed locally on an RX 5700 XT that the ROCm backend is marked installable.
  • Verified the new TheRock package URLs exist on AMD's servers.
  • Confirmed the change covers the reported RX 9060 XT case, where detection returns gfx120X.

Fixes #2050

…k#2050)

Allows Lemonade to automatically detect and download ROCm graphics acceleration files for AMD Radeon gaming graphics cards (RX 5000, 6000, 7000, and 9000 series) on Windows. Previously, these cards were recognized as unsupported, forcing the server to run text and image models on the slower CPU or Vulkan fallbacks.
Copy link
Copy Markdown
Member

@superm1 superm1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs more matches for Linux too or this will cause an issue when a Linux user tries.

@anditherobot
Copy link
Copy Markdown
Contributor Author

Good catch. I originally focused on Windows (from the original issue), but you're right that Linux needs this
too.
I mapped the specific Linux target codes (gfx1010/11/12) to gfx101X so the recipes and ROCm downloads
resolve them correctly. I also added unit tests for these Linux values.

LMK if this looks good.

Comment thread src/cpp/server/system_info.cpp Outdated
Comment on lines +94 to +99
// RDNA1 family. Linux KFD reports the exact GPU ISA (gfx1010/gfx1011/gfx1012),
// while Lemonade recipes and ROCm backend downloads use the shared family name gfx101X.
{"gfx1010", "gfx101X"}, // Navi 10 (e.g., RX 5700 / 5700 XT)
{"gfx1011", "gfx101X"}, // Navi 12 (e.g., Radeon Pro 5600M)
{"gfx1012", "gfx101X"}, // Navi 14 (e.g., RX 5500 / 5500 XT)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're adding these, but the mappings you added also had more (103x, 110x, 120x). Either add them all here or drop the mapping from backend_versions.json

Comment thread src/cpp/server/system_info.cpp Outdated
}},
{"llamacpp", "rocm", {"windows", "linux"}, {
{"amd_gpu", {"gfx1150", "gfx1151", "gfx103X", "gfx110X", "gfx120X"}}, // STX iGPUs + RDNA2/3/4 dGPUs
{"amd_gpu", {"gfx101X", "gfx1150", "gfx1151", "gfx103X", "gfx110X", "gfx120X"}}, // STX iGPUs + RDNA1/2/3/4 dGPUs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above, missing more mappings

Keep Linux ROCm detection consistent with the backend package mappings by normalizing gfx1033, gfx1035, and gfx1036 to gfx103X. Update the ROCm mapping test to cover the same behavior.
@anditherobot
Copy link
Copy Markdown
Contributor Author

Thanks, this clarified the missing layer. Linux raw gfx... codes need translation before package selection.

I added gfx1033, gfx1035, and gfx1036 to the RDNA2 translations and updated the test.

Mapping for the codes covered by this PR:

GPU family Linux raw code Detection result Recipe target Download package
RDNA1 gfx1010 / gfx1011 / gfx1012 gfx101X gfx101X gfx101X-dgpu
RDNA2 gfx1030 - gfx1036 gfx103X gfx103X gfx103X-all
RDNA3 gfx1100 - gfx1103 gfx110X gfx110X gfx110X-all
RDNA3.5 gfx1150 / gfx1151 / gfx1152 exact code exact code exact package
RDNA4 gfx1200 / gfx1201 gfx120X gfx120X gfx120X-all

Does this cover the layer mismatch you were pointing at, or am I still missing a case?

@superm1
Copy link
Copy Markdown
Member

superm1 commented Jun 5, 2026

All of the targets and how they map are described here: https://github.com/ROCm/TheRock/blob/main/cmake/therock_amdgpu_targets.cmake

You can cross reference this.

Completes RDNA3.5 mappings in backend versions and system detection, following ROCm's therock_amdgpu_targets.cmake target definitions.
@anditherobot
Copy link
Copy Markdown
Contributor Author

anditherobot commented Jun 5, 2026

Thanks for the reference! I cross-referenced therock_amdgpu_targets.cmake and added mapping support/unit tests for the missing gfx1153 (Radeon 820M) architecture target.

I hope that this fully covers the RDNA3.5 family. Here is the updated mapping table:

GPU family Linux raw code Detection result Recipe target Download package
RDNA1 gfx1010 / gfx1011 / gfx1012 gfx101X gfx101X gfx101X-dgpu
RDNA2 gfx1030 - gfx1036 gfx103X gfx103X gfx103X-all
RDNA3 gfx1100 - gfx1103 gfx110X gfx110X gfx110X-all
RDNA3.5 gfx1150 / gfx1151 / gfx1152 / gfx1153 exact code exact code exact package
RDNA4 gfx1200 / gfx1201 gfx120X gfx120X gfx120X-all

Comment thread src/cpp/server/system_info.cpp Outdated
}},
{"llamacpp", "rocm", {"windows", "linux"}, {
{"amd_gpu", {"gfx1150", "gfx1151", "gfx103X", "gfx110X", "gfx120X"}}, // STX iGPUs + RDNA2/3/4 dGPUs
{"amd_gpu", {"gfx101X", "gfx1150", "gfx1151", "gfx1152", "gfx1153", "gfx103X", "gfx110X", "gfx120X"}}, // STX iGPUs + RDNA1/2/3/4 dGPUs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just drop the comments. This is never going to age well. You also added things like Phoenix, hawk point here.

@anditherobot anditherobot force-pushed the fix/2050-therock-windows-rocm branch from 7e9af8a to 1d9c021 Compare June 5, 2026 23:27
@github-actions github-actions Bot added engine::llamacpp llama.cpp backend (LlamaCppServer); GPU/CPU LLM inference (Vulkan, ROCm, Metal) runtime::rocm AMD ROCm runtime enhancement New feature or request labels Jun 6, 2026
Comment thread AGENTS.md Outdated
13. **Desktop app is on-demand; `lemond` runs independently** — On Windows, `LemonadeServer.exe` (which embeds `lemond` + tray icon) is the always-on process, auto-started via the Windows startup folder. The Tauri desktop app (`lemonade-app.exe`) is opened on demand when the user wants the UI and must not be added to startup. The desktop app must not embed or manage `lemond`'s lifecycle — it discovers the already-running server (UDP beacon for local, explicit base URL for remote) and speaks to it over HTTP.
14. **AMD GPU platform parity** — When adding or expanding AMD/ROCm GPU support, keep Windows and Linux detection in sync. Windows commonly detects GPUs from product names like `5700` or `6800`, while Linux may report raw KFD ISA codes like `gfx1010` or `gfx1030`. Update `ROCM_ARCH_MAPPING` in `system_info.cpp` as needed so Linux detections resolve to the backend target expected by recipes and ROCm downloads, or to `""` when that ISA is intentionally unsupported.

## Pending Local Work
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this not commit?

"gfx908",
"gfx90a",
"gfx942",
"gfx101X",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct here


std::string arch = lemon::SystemInfo::get_rocm_arch();
if (arch == "gfx1151") {
if (arch == "gfx1151" || arch == "gfx1152") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I don't have a way to test if gfx1152 actually needs this memory size fix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please drop then.

@anditherobot
Copy link
Copy Markdown
Contributor Author

anditherobot commented Jun 7, 2026

Hi @superm1,

I did some homework From what I understand, gfx1153 (Radeon 820M) is listed in therock_amdgpu_targets.cmake, but its package currently returns 403 on AMD's download server. Mapping it to itself in our code will cause a download crash.

GPU Linux KFD Package Status
gfx1010 to 12 100100 to 100102 gfx101X-dgpu
gfx1030 to 34 100300 to 100304 gfx103X-all
gfx1033/35/36 100303 to 100306 gfx103X-all
gfx1100 to 02 110000 to 110002 gfx110X-all
gfx1103 110003 gfx110X-all
gfx1150 110500 gfx1150
gfx1151 110501 gfx1151
gfx1152 110502 gfx1152
gfx1153 110503 gfx1153 ❌ 403
gfx1200/01 120000 to 120001 gfx120X-all

(Note: Generic gfx115X-all and gfx115X-igpu packages also return 403 — it seems AMD packages RDNA 3.5 integrated chips individually, not as a family).

I see two options to handle this:

  • A: Map gfx1153 → "" (empty value) — skip the ROCm graphics download and fall back to CPU mode.
    (edits in system_info.cpp, backend_versions.json, and test_rocm_arch_mapping.py to remove gfx1153 mappings).
  • B: Map gfx1153 → gfx1152 — workaround the driver into loading the Kraken Point package.
    (edit backend_versions.json to map the download package to gfx1152 and edit llamacpp_server.cpp to set HSA_OVERRIDE_GFX_VERSION=11.5.2 ).

What do you think of these approaches ?

(Edit: Replaced range dashes "–" with "to" in the table to clarify that these represent ranges of separate decimal target values, not a hyphenated integer format).

@superm1
Copy link
Copy Markdown
Member

superm1 commented Jun 8, 2026

Option A is the correct approach. We rely upon AMD binaries, and if AMD doesn't publish them we should fall back to vulkan or CPU.

@superm1
Copy link
Copy Markdown
Member

superm1 commented Jun 8, 2026

gfx1010–12 100100–02

HTH do you get 100100-02 from a 32 bit integer? This is impossible.

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdkfd/kfd_topology.c#L472

@anditherobot
Copy link
Copy Markdown
Contributor Author

gfx1010–12 100100–02

HTH do you get 100100-02 from a 32 bit integer? This is impossible.

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdkfd/kfd_topology.c#L472

The dash was meant as range shorthand, not as a literal kernel value: gfx1010 / gfx1011 / gfx1012 =
100100 / 100101 / 100102

@superm1
Copy link
Copy Markdown
Member

superm1 commented Jun 8, 2026

gfx1010–12 100100–02

HTH do you get 100100-02 from a 32 bit integer? This is impossible.

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdkfd/kfd_topology.c#L472

The dash was meant as range shorthand, not as a literal kernel value: gfx1010 / gfx1011 / gfx1012 =
100100 / 100101 / 100102

Ah Thanks for confirm

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

Labels

engine::llamacpp llama.cpp backend (LlamaCppServer); GPU/CPU LLM inference (Vulkan, ROCm, Metal) enhancement New feature or request runtime::rocm AMD ROCm runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

therock installation does not work on windows

2 participants