Skip to content

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

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

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

Conversation

@edodusi
Copy link
Copy Markdown

@edodusi edodusi commented Mar 25, 2026

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

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)

🤖 Generated with Claude Code

The existing cleanup pattern `*.so.*` only matches versioned libraries
(e.g. libcuda.so.1) but misses unversioned stubs (e.g. libcuda.so,
libnvcuvid.so). After a driver upgrade, these remain as empty 0-byte
files and are not overwritten by the subsequent bind-mounts, which only
mount the versioned files. Applications that dlopen the unversioned name
(like DaVinci Resolve for CUDA) load the empty file and silently fall
back to OpenCL.

Widen the glob to `*.so*` so that both versioned and unversioned empty
stubs are removed before the host driver libraries are mounted.

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.

CUDA Symlink Persistence

1 participant