mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 12:52:04 +00:00
[PR #142] [MERGED] fix(nvidia): resolve driver libs in non-Debian GPU containers (LD_LIBRARY_PATH) #142
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/142
Author: @JBailes
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @JBailes
Base:
main← Head:fix/nvidia-ldcache-cross-distro📝 Commits (3)
a4f4adffix(nvidia): register driver lib dir in ldcache for non-Debian containers4895522fix(nvidia): run the container's ldconfig (Fedora has no /sbin/ldconfig)6abe590fix(nvidia): put the CDI lib dir on LD_LIBRARY_PATH for GPU containers📊 Changes
3 files changed (+70 additions, -2 deletions)
View changed files
📝
internal/api/containers.go(+34 -0)📝
internal/lxc/nvidia.go(+33 -2)📝
internal/lxc/nvidia_test.go(+3 -0)📄 Description
Symptom
GPU session containers on a Fedora/Arch base (e.g. GOW
steam:fedora) crash to a black screen:libEGL warning: driver (null)/DRI2: failed to load driver,libnvidia-ml.so.1: cannot open shared object file,Could not initialize renderer→ sway/Steam die. Ubuntu-based containers (Wolf itself) are unaffected — NVENC works — so only the game sessions break.Cause
The CDI injects the driver libs into the host's multiarch dir
/usr/lib/x86_64-linux-gnu. Debian/Ubuntu images search it; Fedora only searches/usr/lib64, so the mounted libs are invisible to its linker. And the daemon's ldcache-update runs as anlxc.hook.mount— before the lib bind-mounts land (and it would race the app anyway), so the cache never picks them up. Verified live:nvidia-smiin asteam:fedoraGPU container fails without help and succeeds withLD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu.Fix
Three layers, most-reliable last:
/etc/ld.so.conf.ddrop-in (soldconfigindexes them on any distro).ldconfigvia a distro-agnostic PATH (Fedora has/usr/bin/ldconfig, not/sbin/ldconfig).LD_LIBRARY_PATHfor GPU containers — checked before the cache, present from process start, timing- and distro-independent. This is what actually fixes it.Verified live (pve .253, RTX 5080)
Steam:fedora sessions went from instant black-screen crash to launching with EGL/Vulkan initialized and the GPU passed through.
go test ./...passes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.