[PR #2914] [CLOSED] [Other] fix(setup AMD): engine probes get the engine's lib_dirs on LD_LIBRARY_PATH on Linux (the PATH-only #2372 env made strata --families exit 127, so setup falsely refused Qwen3.6) #4331

Closed
opened 2026-11-07 15:34:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2914
Author: @xxxliqu1dxxx
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix-setup-amd-ld-library-path


📝 Commits (1)

  • d87b79c fix(setup AMD): engine probes get the engine's lib_dirs on LD_LIBRARY_PATH on non-Windows (setup's own strata --families / strata-device --list-devices exited 127 on libhipblas.so.3 on AMD Linux, so setup falsely said the engine does not run Qwen3.6; #2372 put them on PATH only, which the loader only honors on Windows - mirrors serve/server.py's os-dependent choice)

📊 Changes

2 files changed (+23 additions, -7 deletions)

View changed files

📝 setup.py (+7 -3)
📝 tools/test_setup_amd.py (+16 -4)

📄 Description

Problem and result

Setup's own engine probes (strata --families, strata-device --list-devices) only got the
engine's ROCm lib_dirs on PATH (#2372), which the dynamic loader only honors on Windows.
On AMD Linux the probes exited 127 on libhipblas.so.3, so ./setup.sh --backend hip Step 4
falsely said "this engine does not run Qwen3.6-35B-A3B yet" while the local HIP engine does
run it. After the change, on POSIX the lib_dirs are prepended to LD_LIBRARY_PATH (existing
value preserved); on Windows the PATH behavior is byte-identical. The probes exit 0.

Follow-up to #2372 (commit 093108c). No open issue. Focused fix, no scope agreement needed.

Approach

engine_env only: on POSIX, lib_dirs are prepended to LD_LIBRARY_PATH instead of PATH;
on Windows the PATH prepend is unchanged. Mirrors serve/server.py's existing
"PATH" if os.name == "nt" else "LD_LIBRARY_PATH" choice. Left alone: the engine binary, the
build, the server launch env, the engine_families fallback, hip_lib_dirs, prebuilt Windows
engine handling.

Validation

Passed:

  • python tools/test_setup_amd.py — revision d409ec38 (rebased on main, 0.2.0-beta), local
    Windows PC (no GPU needed): 42 tests OK. Covers EngineLaunchEnv: the Windows PATH
    behavior (pinned to os.name = "nt"), the new LD_LIBRARY_PATH test (lib dir first,
    existing value preserved, PATH untouched), and the two probe tests.
  • Live check on an AMD Linux box (Radeon RX 9060 series, gfx1200, 16 GB VRAM, 31 GB RAM,
    local HIP engine 0.1.45): env = setup.engine_env(Path('engine')) +
    engine/strata --families → rc 0, prints qwen4exp qwen35moe (previously exit 127).

Failed: none observed.

Not run: multi-GPU, Windows live run (no Windows AMD box), NVIDIA/CUDA paths (untouched by
the change).

Limits

Only affects the two setup probe commands' environment on non-Windows. No behavior change on
Windows, in the engine, the build, or the server.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2914 **Author:** [@xxxliqu1dxxx](https://github.com/xxxliqu1dxxx) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-setup-amd-ld-library-path` --- ### 📝 Commits (1) - [`d87b79c`](https://github.com/Niko1221/Strata/commit/d87b79c2599be971bd760ac3dee7c226c19dacab) fix(setup AMD): engine probes get the engine's lib_dirs on LD_LIBRARY_PATH on non-Windows (setup's own `strata --families` / `strata-device --list-devices` exited 127 on libhipblas.so.3 on AMD Linux, so setup falsely said the engine does not run Qwen3.6; #2372 put them on PATH only, which the loader only honors on Windows - mirrors serve/server.py's os-dependent choice) ### 📊 Changes **2 files changed** (+23 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+7 -3) 📝 `tools/test_setup_amd.py` (+16 -4) </details> ### 📄 Description ## Problem and result Setup's own engine probes (`strata --families`, `strata-device --list-devices`) only got the engine's ROCm `lib_dirs` on `PATH` (#2372), which the dynamic loader only honors on Windows. On AMD Linux the probes exited 127 on `libhipblas.so.3`, so `./setup.sh --backend hip` Step 4 falsely said "this engine does not run Qwen3.6-35B-A3B yet" while the local HIP engine does run it. After the change, on POSIX the `lib_dirs` are prepended to `LD_LIBRARY_PATH` (existing value preserved); on Windows the `PATH` behavior is byte-identical. The probes exit 0. ## Related discussion Follow-up to #2372 (commit 093108c). No open issue. Focused fix, no scope agreement needed. ## Approach `engine_env` only: on POSIX, `lib_dirs` are prepended to `LD_LIBRARY_PATH` instead of `PATH`; on Windows the `PATH` prepend is unchanged. Mirrors `serve/server.py`'s existing `"PATH" if os.name == "nt" else "LD_LIBRARY_PATH"` choice. Left alone: the engine binary, the build, the server launch env, the `engine_families` fallback, `hip_lib_dirs`, prebuilt Windows engine handling. ## Validation **Passed:** - `python tools/test_setup_amd.py` — revision d409ec38 (rebased on main, 0.2.0-beta), local Windows PC (no GPU needed): 42 tests OK. Covers `EngineLaunchEnv`: the Windows `PATH` behavior (pinned to `os.name = "nt"`), the new `LD_LIBRARY_PATH` test (lib dir first, existing value preserved, `PATH` untouched), and the two probe tests. - Live check on an AMD Linux box (Radeon RX 9060 series, gfx1200, 16 GB VRAM, 31 GB RAM, local HIP engine 0.1.45): `env = setup.engine_env(Path('engine'))` + `engine/strata --families` → rc 0, prints `qwen4exp qwen35moe` (previously exit 127). **Failed:** none observed. **Not run:** multi-GPU, Windows live run (no Windows AMD box), NVIDIA/CUDA paths (untouched by the change). ## Limits Only affects the two setup probe commands' environment on non-Windows. No behavior change on Windows, in the engine, the build, or the server. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:57 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4331
No description provided.