Skip to content

kernel: add 0132, the BC-250 per-shader-array WGP mask for KFD - #131

Merged
MTSistemi merged 1 commit into
mainfrom
kernel/0132-bc250-cc-wgp-mask
Nov 15, 2026
Merged

MTSistemi merged 1 commit into
mainfrom
kernel/0132-bc250-cc-wgp-mask

Conversation

@MTSistemi

Copy link
Copy Markdown
Owner

What

New recipe patch 0132-mastag-0029-bc250-cc-wgp-mask.mypatch: the module parameter amdgpu.bc250_cc_wgp_mask=SE0.SH0,SE0.SH1,SE1.SH0,SE1.SH1 (four 5-bit WGP enable masks). Unset, the kernel behaves as before.

Why

skillfish-cu unlocks the harvested WGPs at boot through UMR, after amdgpu has bound. Vulkan uses them, but KFD counts CUs once in gfx_v10_0_get_cu_info() and keeps the fused 24, so ROCm never sees the rest. The mask writes, per shader array and before that count, the disabled WGPs into CC_GC_SHADER_ARRAY_CONFIG bits 31:16 and the mask into SPI_PG_ENABLE_STATIC_WGP_MASK.

Origin

MastaG/linux-cachyos-bc250 0029 (author ForceConstant, MastaG/linux-cachyos-bc250#14), GPL-2.0. Ported onto our 0114 (ariel-16) instead of their 0011, and without their RLC_PG_ALWAYS_ON_WGP_MASK write: 0114 leaves that register out on purpose, because with RLC firmware running the write deadlocks the RLC on the first KFD queue.

Tests

On bc250-dev, test build 7.3.4-skillfishos-p0132 (BC-250 flavour, signed), installed next to the released kernel and booted once with grub-reboot:

KFD simd_count CUs vkpeak fp32-scalar
released 7.3.4 48 24 9757 GFLOPS
p0132, mask unset 48 24 -
p0132, mask 0x1f,0x1f,0x1f,0x1f 80 40 10172 GFLOPS

With the mask, bc250-wgp-mask logs CC=0xfff80000->0xffe00000 SPI=0x00000007->0x0000001f on all four shader arrays. Fans, desktop and services normal in both boots. gfx_v10_0.o builds clean with W=1.

Not tested: a KFD queue in use, since the board has no ROCm stack.

The kernel README's recipe section is brought up to date (49 patches, 7.3.4, ranges per series) with a section on 0132. The patch ships with the next kernel build.

skillfish-cu unlocks the harvested WGPs through UMR after amdgpu has bound,
so Vulkan uses 40 CUs but KFD keeps the fused 24: it counts CUs once, in
gfx_v10_0_get_cu_info(). amdgpu.bc250_cc_wgp_mask writes the disabled WGPs
into CC_GC_SHADER_ARRAY_CONFIG bits 31:16 and the mask into
SPI_PG_ENABLE_STATIC_WGP_MASK before that count. Unset, nothing changes.

From MastaG/linux-cachyos-bc250 0029 (ForceConstant, issue #14), ported
onto 0114 instead of their 0011 and without their RLC_PG_ALWAYS_ON_WGP_MASK
write, which 0114 leaves out on purpose.

Tested on bc250-dev with a 7.3.4 test build: unset, KFD simd_count 48 as on
the released kernel; with 0x1f x4, simd_count 80, registers as expected,
vkpeak 10172 GFLOPS. No KFD queue in use: the board has no ROCm stack.

The README's recipe section is brought up to date (49 patches, 7.3.4).
@MTSistemi
MTSistemi merged commit 753490d into main Nov 15, 2026
5 checks passed
@MTSistemi
MTSistemi deleted the kernel/0132-bc250-cc-wgp-mask branch November 15, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant