PyTorch 2.9+cu128 wheel fails to import on systems with CUDA Toolkit <12.5 due to libcudart load-order
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- linux, python, pytorch
- Domain
- machine-learning, testing-qa, tooling
Research direction
Reproduce the failure with uv sync --group dev --extra qdp and uv run python -c "import torch". Read qdp/DEVELOPMENT.md, qdp/qdp-python/pyproject.toml, and the RC2 lockfile, then choose one of the listed compatibility fixes. Done means the documented or implemented path allows the import and uv run pytest -v to pass on the affected CUDA setup.
Written by the indexing model from the issue text.
Description
Summary
On Linux systems where the installed CUDA Toolkit is older than 12.5 (e.g., Ubuntu 24.04's nvidia-cuda-toolkit package, which ships CUDA 12.4), import torch fails after a fresh uv sync --group dev --extra qdp of the RC2 environment:
ImportError: /…/site-packages/torch/lib/libc10_cuda.so: undefined symbol:
cudaGetDriverEntryPointByVersion, version libcudart.so.12
cudaGetDriverEntryPointByVersion was added in CUDA 12.5. The PyTorch 2.9.0+cu128 wheel currently resolved by the project's lockfile needs it.
Root cause
The PyTorch wheel bundles a compatible libcudart.so.12 (with the symbol) at nvidia/cuda_runtime/lib/. But libc10_cuda.so's RUNPATH walks several other nvidia-* wheel directories first; LD_DEBUG=libs shows the loader finds the right libcudart.so.12, calls init, then immediately calls fini (refcount drops to zero before libc10_cuda resolves the symbol). This is a PyTorch wheel packaging fragility, not a Mahout code defect, but it blocks Mahout testing.
Reproducer
On Ubuntu 24.04 with nvidia-cuda-toolkit (12.4) installed:
git checkout mahout-qumat-0.6.0-RC2
uv sync --group dev --extra qdp
uv run python -c "import torch" # fails
Workaround
Force-load the bundled cudart via LD_PRELOAD:
export LD_PRELOAD=$VIRTUAL_ENV/lib/python3.12/site-packages/nvidia/cuda_runtime/lib/libcudart.so.12
uv run python -c "import torch; print(torch.__version__)" # works
uv run pytest -v # works
Suggested fixes (any one)
- Document the workaround in
qdp/DEVELOPMENT.mdfor users with CUDA Toolkit <12.5. - Document a minimum CUDA Toolkit version (12.5 or 12.6) in the project requirements.
- Pin PyTorch to a wheel built against an older CUDA in
qdp/qdp-python/pyproject.tomluntil the upstream wheel issue is resolved. - Wrap test entry points (Makefile targets, docs commands) to set
LD_PRELOADautomatically when the system's libcudart lacks the symbol.
Environment
- OS: Ubuntu 24.04
- CUDA Toolkit: 12.4 (apt
nvidia-cuda-toolkit) - GPU: NVIDIA GeForce GTX 1060 with Max-Q Design (sm_61) — irrelevant to this issue; fails before any GPU work
- Python: 3.12.12 (uv-managed)
- PyTorch: 2.9.0+cu128 (resolved by RC2 lockfile)
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 1k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 7
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/mahout
-
[Bug] Amazon Braket get_final_state_vector() changes the circuit, so execute_circuit() fails afterwardsPossibly taken @Howardisme claimed this 48 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
apache/mahout#1538 · 1 comment ·
Maintainers usually reply within 2 days
-
[Bug] Reusing a parameter name on two gates fails on Qiskit only (name conflict adding parameter)Possibly taken @Imad2702 claimed this 50 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/mahout#1509 · 2 comments ·
Maintainers usually reply within 2 days
-
[Bug] Cirq backend ignores the initialized simulator and creates its own cirq.Simulator()Possibly taken @Howardisme claimed this 49 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
apache/mahout#1508 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug] Unknown backend_name leaks ModuleNotFoundError instead of a clear ValueErrorPossibly taken @Asterisk-Hunter claimed this 38 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
apache/mahout#1506 · 5 comments ·
Maintainers usually reply within 2 days
-
bug docs enhancement question
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
Similar issues
-
chat compiler P1
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HerringtonDarkholme/hd-lang#2793 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
security-advisory
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MinBZK/regelrecht#2173 ·
-
ci
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
oxc-project/tsrs#1277 · 1 comment ·
Maintainers usually reply within 1 day