mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #414] test_setup_choices fails on a host with a real CUDA install: find_nvcc()'s /usr/local/cuda* glob is not mocked #195
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#195
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 @rwkeyes on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/414
What happens.
tools/test_setup_choices.py::ExperimentalSm60.test_find_nvcc_belowerrors on any machine that has a CUDA toolkit installed:Reproduced on two hosts, each failing on its own toolkit path — CUDA 13.2 at
/usr/local/cuda-13.2(plus/usr/bin/nvcc), and CUDA 12.8 at/usr/local/cuda-12.8:Seen from
python -m unittest discover -s tools -p 'test_*.py'on 0.1.32 (c499bd1), on both a HIP/gfx1100 box and a CUDA 12.8 box.Why. The test mocks
WIN,shutil.which,CUDA_PATHandsetup.out, butfind_nvcc()also enumerates the real filesystem:Those real candidates are appended to the mocked ones. They are normally newer than the test's fake
13.0, so they win the loop, and the mockedout()has no entry for them →KeyError.Confirmation. Faking the glob out — returning nothing for
cuda*— makes the test pass unchanged:So the cause is the unmocked glob and nothing about the host.
Suggested fix. Mock the cuda-root enumeration as well (
mock.patch.object(Path, "glob", ...)), or make the roots injectable so the test can pointfind_nvcc()at its temp directory.This is not a product bug —
find_nvcc()does exactly what it should, and the engine/setup path is unaffected. It is test hermeticity only, and it is invisible on a machine without CUDA installed, which is presumably why CI does not catch it.@rwkeyes commented on GitHub (Oct 1, 2026):
Confirmed in a pristine tree, to rule out my own working branch:
Same failure, same cause, with none of my local changes present — so this is not something my branch introduced.
The other error in that run is unrelated and environmental, and I am explicitly not claiming it as a bug:
test_iq_packcannot import without llama.cpp'sgguf-py, and it says so with an actionable message (run setup.py (it clones llama.cpp into third_party/), or set STRATA_GGUF_PY). That is fine behaviour; it just means a fresh worktree runs 138 of the intended tests until the checkout is present.@Niko1221 commented on GitHub (Oct 1, 2026):
Thanks! Fixed for the next release: the mocked
--versionanswers an empty string for any toolkit the test didn't create, so a real CUDA install on the host is skipped. This issue closes with the release.@Niko1221 commented on GitHub (Oct 1, 2026):
Fixed in 0.1.33. Thanks!