Repository navigation
fix(build): bundle NVRTC builtins library in CUDA backend - #1183
Open
bkbatchelor wants to merge 1 commit into
Open
bkbatchelor wants to merge 1 commit into
bkbatchelor wants to merge 1 commit into
Conversation
NVRTC dlopen()s libnvrtc-builtins at runtime, so PyInstaller's dependency scan never picks it up. The CUDA backend then fails on the first torch JIT kernel (e.g. complex abs during generation) with "failed to open libnvrtc-builtins.so.12.8". Add the builtins libraries from nvidia.cuda_nvrtc explicitly with --add-binary next to libnvrtc, and fail the build if none are found.
This branch has not been deployed
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
The Linux CUDA backend (
voicebox-server-cuda) fails on the first generation that needs a torch JIT kernel (for example, complexabs):libnvrtc.so.12is bundled, but NVRTC loadslibnvrtc-builtins.so.12.8withdlopen()at runtime. PyInstaller's dependency scan never sees that load, so the library is left out of_internal/nvidia/cuda_nvrtc/lib/.Fix
In the CUDA branch of
build_server(), find the installednvidia.cuda_nvrtcpackage and pass its builtins libraries to PyInstaller with--add-binary. They go into the same directory aslibnvrtc(lib/*.so*on Linux,bin/*.dllon Windows). If none are found, the build raises an error instead of producing a backend that breaks at runtime.Testing
python build_binary.py --cudaon Arch Linux (torch 2.11.0+cu128, nvidia-cuda-nvrtc-cu12 12.8.93).libnvrtc-builtins.so.12.8andlibnvrtc-builtins.alt.so.12.8now appear indist/voicebox-server-cuda/_internal/nvidia/cuda_nvrtc/lib/.nvrtcCompileProgramthrough the bundledlibnvrtc.so.12succeeds..dllpath was not tested.