ci: use CPU torch on GitHub runners to stop random CUDA-preload segfault - #807
Merged
Merged
Conversation
The cu130 torch build pinned in poetry.lock sometimes segfaults in torch._preload_cuda_lib on GPU-less runners (seen on master 7cac0c3 and Dependabot PRs #804/#805). After poetry install, reinstall the same torch/torchvision versions from the CPU wheel index and assert the build has no CUDA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hananel-Hazan
added a commit
that referenced
this pull request
Oct 2, 2026
Conflicts came from #807. pythonpackage.yml stays deleted (this branch replaces it); both jobs in python-app.yml now run .github/scripts/use_cpu_torch.sh after poetry install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tests on GitHub runners crash at random with
Fatal Python error: Segmentation faultinsidetorch._preload_cuda_lib(torch/__init__.py:348), before any test runs. The runners have no GPU, butpoetry.lockinstalls the CUDA 13.0 build of torch. Seen on master7cac0c3and on Dependabot PRs #804 and #805 (lock-only bumps of tornado/virtualenv, unrelated to torch).Fix
.github/scripts/use_cpu_torch.shruns afterpoetry installin both test workflows. It reads the installed torch/torchvision versions from package metadata (without importing torch), reinstalls those same versions from the CPU wheel index, and fails the job if the resulting torch still reports CUDA.Local installs and
poetry.lockare unchanged.🤖 Generated with Claude Code