mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5060] [Engine] Linux HIP self-build against kpack ROCm: bundled librocblas can't find its device code (hipErrorInvalidKernelFile, engine hangs) #2349
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2349
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @amplogik on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5060
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
A Linux HIP engine built with
packaging/build_hip_linux.shagainst a system ROCm that uses kpack (device code split out of the libraries into<rocm>/.kpack/*_lib_<arch>.kpack) works for most requests, then on some request dies with:After that the engine hangs (client times out, then HTTP 503) until it is restarted. With
AMD_LOG_LEVEL=1the cause is printed just before it:Cause, as far as I can tell: the bundled
librocblas.so.5,libhipblaslt.so.1andlibrocsolver.so.0have an empty.hip_fatbin(NOBITS) and a.rocm_kpack_refsection whose search path is relative to the library:In the ROCm tree that resolves to
/opt/rocm/core-10.1/.kpack/blas_lib_gfx1100.kpack(present). Aftercollect_libs.pycopies the libraries into the component,../.kpackpoints atcomponents/engine/.kpack, which does not exist, andbuild_hip_linux.shnever copies the.kpackarchives (it only bundlesrocblas/libraryandhipblaslt/libraryvia--data). Kernels that rocBLAS keeps in its own fat binary (not in the Tensile library files) therefore cannot be loaded; the first request whose shapes reach one of them fails. That is why it looks intermittent.Expected: the component carries the kpack archives it needs for its target archs (or the launcher points the kpack loader at them), so the engine is self-contained like the TheRock-based package.
Smallest steps or command that reproduce it
VARIANT=rx7900 DSV41=1 HP=/opt/rocm CORE=/opt/rocm LIBW=/opt/rocm packaging/build_hip_linux.shon a system ROCm with/opt/rocm/.kpack(here: ROCm core 10.1, HIP 7.16.26385), install the component.readelf -S librocblas.so.5in the component shows.hip_fatbin NOBITS+.rocm_kpack_ref;ls ../.kpackfrom the component dir: missing.--context 1mon 6× gfx1100 and send a few 4K-16K-token prompts. Here it failed 5 times in 5 engine starts: four times on a ~16K-token real-code prompt (Python source + "explain and refactor"), once on a ~230-token code-generation request partway through a ~12K-token answer. The most reliable sequence: three random-word prompts of ~3.5K/7K/27K tokens, one ~4K and then one ~16K real-code prompt; it died on the ~16K one on the most recent fresh start. Synthetic prompts of the same lengths and a replay of the 230-token request did not trigger it on other starts, so it depends on which kernel a request reaches, not on length alone.Workaround that fixed it here (verified: the same sequence then ran 3 rounds clean, and
ROCM_KPACK_DEBUG=1showsopened and cached archive: /opt/rocm/core-10.1/.kpack/blas_lib_gfx1100.kpack ... loaded code object: 3940648 bytes):Possible fix (not tested): in
build_hip_linux.sh, bundle$LIBW/.kpack/{blas,solver}_lib_<arch>.kpackfor the variant's archs and lay them out so the relative../.kpackresolves inside the component (for example libraries in alib/subfolder with.kpack/beside it).librocm_kpack.so.0also knowsROCM_KPACK_PATH/ROCM_KPACK_PATH_PREFIX, which the launcher could set instead; I did not test those.I only observed it at
--max-context 1048576; at 64K it did not occur over a few dozen requests including a full benchmark, but nothing in the cause is context-specific, so it may just be which kernels those requests reached. Possibly related in spirit to #4350 (also a self-built gfx1100 HIP engine), but the error and the cause here are different.Reproduction status
Reproduced locally
Strata version
Strata 0.2.9 (commit
c62d5e3) · engine 0.1.55 · self-built0.1.55-linux-x86_64-hip-rx7900withDSV41=1Graphics card, memory and system
6× RX 7900 XTX 24 GB (gfx1100) · Threadripper PRO 3955WX · 108 GB RAM usable · Ubuntu 26.04.1, kernel 7.0.0-42 · system ROCm core 10.1 (HIP 7.16.26385) under /opt/rocm/core-10.1
Model, size and settings
DeepSeek-V4.1-Flash IST-DAS 2.25 bpw · 1M context (
--max-context 1048576 --eos 1 --vision on --dspark auto --dspark-conf 0.65 --tp 1 --layer-split auto) · pictures on ·STRATA_DSV41_EXEpointing at the self-builtstrata-dsv41Logs
Engine log excerpt (one failing start):
No amdgpu errors, resets or faults in the kernel log at any of the failure times.
Thanks for Strata, by the way: on this box DeepSeek V4.1 2.25 bpw read 9 of 9 planted facts at up to ~885K tokens with the workaround in place.