Repository navigation
Polygraphy: find the CUDA runtime from CUDA 13+ pip wheels - #4871
Open
LinCanNerd wants to merge 1 commit into
Open
LinCanNerd wants to merge 1 commit into
LinCanNerd wants to merge 1 commit into
Conversation
The CUDA 13 runtime wheel (`nvidia-cuda-runtime`) installs libcudart under
`<site-packages>/nvidia/cu13/lib` on Linux and `nvidia/cu13/bin/x86_64` on
Windows, while Polygraphy only searched the CUDA 12 wheel location
`nvidia/cuda_runtime/{lib,bin}`. On systems whose CUDA runtime comes only
from pip, such as a Jetson AGX Thor without a CUDA Toolkit, every TensorRT
runner failed with `OSError: libcudart.so: cannot open shared object file`.
Also search `nvidia/cu<major>` wheel directories, after the existing
locations, and update the missing-runtime hint to name the current wheels.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: LinCanNerd <lincanecdl@gmail.com>
pranavm-nvidia
approved these changes
Oct 6, 2026
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.
What does this PR do?
On a system whose CUDA runtime comes only from pip (no CUDA Toolkit, no
LD_LIBRARY_PATHentry), every TensorRT runner in Polygraphy fails:_cuda_runtime_wheel_dirsonly searches the CUDA 12 wheel location,<site-packages>/nvidia/cuda_runtime/{lib,bin}. The CUDA 13 runtime wheel (nvidia-cuda-runtime13.x; the-cu13name is deprecated, see #4614) uses a different layout. From the publishednvidia-cuda-runtime==13.0.96wheels:manylinux2014_x86_64,manylinux2014_aarch64nvidia/cu13/lib/libcudart.so.13win_amd64nvidia/cu13/bin/x86_64/cudart64_13.dllnvidia-cuda-runtime-cu12)nvidia/cuda_runtime/{lib,bin}Changes in
polygraphy/cuda/cuda.py:nvidia/cu<major>package directories (globbed ascu[0-9]*, so othernvidia/cu*packages such as cuBLAS are not matched). They are appended after the current locations, so environments that work today resolve the same library.bin/x86_64subdirectory.nvidia-cuda-runtime(CUDA 13+) andnvidia-cuda-runtime-cu12instead of the deprecatednvidia-cuda-runtime-cuXX.Added
TestFindCudaLibDirs::test_cuda13_runtime_wheel_dirs_included(Linux and Windows) and a CHANGELOG entry.Testing
On NVIDIA Jetson AGX Thor (SM110, JetPack 7.2 / L4T R39.2, no CUDA Toolkit installed), TensorRT 11.3.0.99 (
tensorrt-cu13),nvidia-cuda-runtime==13.0.96, Polygraphy frommain, Python 3.12,LD_LIBRARY_PATHunset:polygraphy run model.onnx --trt --onnxrtOSError: libcudart.so: cannot open shared object filenvidia/cu13/lib/libcudart.so.13; outputs match (PASSED)pytest tests/cuda/test_cuda.pyOSError)The one remaining failure is
TestDeviceBuffer::test_copy_from_overhead, which is markedflakyand assertscopy_fromis within 12% of a rawmemcpy; on this device it measures 1.2–2.2x across runs. It could not run at all before this change and is unrelated to it.black --checkpasses on the changed files.