Skip to content

init: also clean empty unversioned .so stubs during nvidia setup#2034

Open
edodusi wants to merge 1 commit into89luca89:nextfrom
edodusi:fix/nvidia-empty-unversioned-so-cleanup-next
Open

init: also clean empty unversioned .so stubs during nvidia setup#2034
edodusi wants to merge 1 commit into89luca89:nextfrom
edodusi:fix/nvidia-empty-unversioned-so-cleanup-next

Conversation

@edodusi
Copy link
Copy Markdown

@edodusi edodusi commented Mar 29, 2026

Port of #2024 to the next branch.

Summary

  • Fixes empty unversioned .so stubs (e.g. libcuda.so, libnvcuvid.so) not being cleaned up during --nvidia initialization
  • The existing glob *.so.* only matches versioned libraries but misses unversioned ones, which remain as 0-byte files after driver upgrades
  • Applications that dlopen() the unversioned name (e.g. DaVinci Resolve for CUDA) load the empty stub and silently fall back to OpenCL
  • Widens the glob from *.so.* to *.so* so both versioned and unversioned empty stubs are removed before host driver bind-mounts
  • We use this fix to run DaVinci Resolve Studio inside distrobox with --nvidia — without it, Resolve silently loses CUDA support after every driver update and freezes on the Edit page

Fixes #1764

Test plan

  • Create a distrobox with --nvidia on a host with NVIDIA drivers
  • Verify ls -la /usr/lib64/libcuda.so is not a 0-byte file after container restart
  • Verify CUDA-dependent applications (e.g. DaVinci Resolve, nvidia-smi) detect CUDA correctly
  • Verify no regression: non-empty .so files are not affected (the find uses -empty)
  • Tested with DaVinci Resolve Studio in davincibox on Fedora Atomic (Bazzite) with RTX 4080 and NVIDIA driver 595.58.03

Widen the find glob from "*.so.*" to "*.so*" so that unversioned .so
stubs (e.g. libcuda.so, libnvcuvid.so) left behind after driver upgrades
are also removed during --nvidia initialization. Applications that
dlopen() the unversioned name (e.g. DaVinci Resolve for CUDA) would
otherwise silently load the empty stub and fall back to OpenCL.

Fixes 89luca89#1764

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant