Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.
Quickstart troubleshooting
Install and first-run problems on Strix Halo (gfx1151), as symptom and fix. Run the commands below from the repository root, with the venv active (source .venv/bin/activate). After a fix (and ./build.sh again for the build errors), bash tools/strix_halo/env.sh --check should print GPU compute: OK and exllamav3_ext: OK.
Segfault (exit code 139) at the first GPU operation, or undefined symbol: hsa_...
Symptoms, all from the same cause:
- The process dies with exit code 139 at the first tensor on the GPU, even
torch.zeros(4, device="cuda"), with no Python traceback.dmesgshowssegfault ... in libhsa-runtime64.so. undefined symbol: hsa_ext_image_create_v2when torch is imported.undefined symbol: hsa_amd_enable_loggingwhen torch is imported.
Cause: the wrong libhsa-runtime64.so.1 was loaded. The copy bundled in the torch wheel segfaults on gfx1151, Ubuntu's own libhsa-runtime64-1 is ROCm 5.7 and too old (hsa_amd_enable_logging), and an older ROCm under /opt/rocm does not match the wheel (hsa_ext_image_create_v2).
In the segfault case, torch.cuda.is_available() returns True and the device is listed correctly, so they are not proof that the runtime works. The crash comes with the first allocation or copy.
Fix: run these in every new shell, from the repository root. env.sh then preloads the runtime from the SDK first:
source .venv/bin/activate
export EXL3_ROCM_SDK=$(rocm-sdk path --root)
source tools/strix_halo/env.sh
To use another copy of the runtime, set EXL3_HSA_LIB to its path before sourcing env.sh, for example export EXL3_HSA_LIB=$(rocm-sdk path --root)/lib/libhsa-runtime64.so.1.
If env.sh prints [env.sh] WARNING: no libhsa-runtime64.so.1 found, none of its candidates exist: set EXL3_ROCM_SDK or EXL3_HSA_LIB as above.
Prefill is about 20 % slower than the published figures
The server prints one line at start, [kyojin] HIP kernel compiler: ..., and /health shows the same text (field hip_compiler). If it points to /opt/rocm or another system compiler and a WARNING line follows, the engine built its kernels with the system ROCm instead of the SDK compiler. Run export EXL3_ROCM_SDK=$(rocm-sdk path --root) and restart. The kernel cache is keyed by compiler version, so the new start rebuilds the kernels once; the old files stay in ~/.cache/exllamav3 and can be deleted by hand. Please include that line in a performance report.
CUDA error: invalid kernel file and the check prints gfx1100
bash tools/strix_halo/env.sh --check must print gfx1151 on the device line. If it prints gfx1100 (or any other name), the variable HSA_OVERRIDE_GFX_VERSION is set somewhere, usually left from an older ROCm set-up. The runtime then loads kernels built for another GPU and stops with hipErrorInvalidKernelFile, whatever the torch or ROCm version.
echo "${HSA_OVERRIDE_GFX_VERSION:-unset}" # must print "unset"
unset HSA_OVERRIDE_GFX_VERSION # then remove it from ~/.bashrc, ~/.profile or /etc/environment
If the same line shows about half of your memory (for example 62.5 GiB on a 128 GB machine), the kernel GTT limit is still at its default. Raise it with ttm.pages_limit and ttm.page_pool_size on the kernel command line, then reboot.
HIP error: invalid device function on every kernel
Cause: ROCm 6.4 or older. It has no code object for gfx1151.
Fix: use ROCm 7.0 or newer, for example the gfx1151 nightly wheels from the quickstart. Leave HSA_OVERRIDE_GFX_VERSION unset: gfx1151 is native on ROCm 7, and an override makes it pick the wrong kernels. An older install may have set it in your shell profile, so check:
echo "${HSA_OVERRIDE_GFX_VERSION:-unset}" # must print "unset"
unset HSA_OVERRIDE_GFX_VERSION # for this shell; also remove it from ~/.bashrc or ~/.profile
The build stops: no hipsparse headers
[build] EXL3_ROCM_SDK=... and EXL3_ROCM_DEV_INCLUDE have no hipsparse headers. ...
Cause: the build needs the hipsparse/ and thrust/ headers of the ROCm SDK devel tree, and EXL3_ROCM_SDK does not point at one. _rocm_sdk_core alone does not have them.
Fix: install rocm-sdk-devel (see the quickstart), expand its headers, and point EXL3_ROCM_SDK at it:
rocm-sdk init # expands the devel headers, about 12 GB on disk
export EXL3_ROCM_SDK=$(rocm-sdk path --root)
./build.sh
With your own devel tree, set EXL3_ROCM_DEV_INCLUDE to an include directory that has hipsparse/ and thrust/ instead.
The build stops in a system header: expected an identifier for the attribute name (GCC 16)
/usr/include/c++/16/format:4550:30: error: expected an identifier for the attribute name [-Wtemplate-body]
4550 | [[__gnu__::__noinline__]]
Seen on Fedora 44 and Arch Linux, at bindings_hip.o.
Cause: GCC 16's libstdc++ uses __noinline__ as an attribute name, and the rocm-sdk-devel wheel defines __noinline__ to nothing for a non-clang host compiler (include/hip/amd_detail/host_defines.h). Older GCC (13 on Ubuntu 24.04) does not use that attribute, so the build passes there.
Fix, until the ROCm header changes: undefine it right after that line in the venv's copy, then build again.
H=$(rocm-sdk path --root)/include/hip/amd_detail/host_defines.h
sed -i 's/^#define __noinline__$/&\n#undef __noinline__/' "$H"
./build.sh
Other distributions: Fedora 44's default python3 is 3.14, so install python3.12 and create the venv with python3.12 -m venv .venv. Arch only has Python 3.14; the build, the tests and the Qwen server were reported working with it.
The build stops: PyTorch is not a ROCm build
[build] the venv's PyTorch is not a ROCm build (torch.version.hip is empty). ...
Cause: pip install torch (or a requirements.txt install that ran first) installed a CUDA or CPU build.
Fix: install torch from the gfx1151 index first, then the requirements:
pip install --pre torch rocm-sdk-devel --index-url https://rocm.nightlies.amd.com/v2/gfx1151/
pip install -r requirements.txt
Check with python -c "import torch; print(torch.version.hip)": it must print a version, not None.
A test or the first import hangs with no output
Cause: a stale lock file from an interrupted JIT load. When exllamav3 is imported and no built extension is found, torch compiles it on the fly, and it first waits on ~/.cache/torch_extensions/<version>/exllamav3_ext/lock, silently, as long as the file is there. ./build.sh installs through pip and does not use this lock.
Fix: make sure no other process is loading the extension, then remove the lock:
ls ~/.cache/torch_extensions/*/exllamav3_ext/lock
rm ~/.cache/torch_extensions/*/exllamav3_ext/lock
Then run the command that hung again. If ls prints No such file or directory, there is no stale lock, and the hang has another cause.
If TORCH_EXTENSIONS_DIR is set, the lock is under that directory instead.
NaN rows or HSA memory fault only when other GPU processes share the device (ROCm)
Symptom: with several GPU processes on one AMD device (for example the model plus small helper models), a request now and then fails with a row of NaN or a nonfinite value deep in the model, or an HSA memory fault during prefill. The same request passes when the helpers are stopped or after a reboot.
Workaround, tested by a user on two Strix Halo machines (issue #188): limit the HIP hardware queues of the model process:
GPU_MAX_HW_QUEUES=1 python tools/qwen/serve.py ...
This serializes the streams of that process, so it can cost some speed when the engine overlaps copies and compute. It is a workaround, not a diagnosis: a related ROCm report (ROCm/rocm-systems#5815) describes copies that return stale data with several processes on one GPU. If the failures stay with the helpers stopped and the default queue count, look for a missing stream or event wait in your own code instead.