Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #127 - Use common dir for Nvidia Passthrough #165

Closed
wants to merge 4 commits into from
Closed

Fix for #127 - Use common dir for Nvidia Passthrough #165

wants to merge 4 commits into from

Conversation

dalgibbard
Copy link
Contributor

@dalgibbard dalgibbard commented May 9, 2024

As per title; proposed fix for nvidia mounting issues in 24.04; mount the entire nvidia common module path, instead of the individual files which are usually presented.

Before:

systemd-run --collect --property=Delegate=yes --property=RestartForceExitStatus=133 --property=SuccessExitStatus=133 --property=TasksMax=infinity --property=Type=notify --setenv=SYSTEMD_NSPAWN_LOCK=0 --property=KillMode=mixed --unit=jlmkr-gpu --working-directory=./jails/gpu '--description=My nspawn jail gpu [created with jailmaker]' --setenv=SYSTEMD_SECCOMP=0 -- systemd-nspawn '--property=DeviceAllow=/dev/nvidia-uvm rwm' '--property=DeviceAllow=/dev/nvidia-uvm-tools rwm' '--property=DeviceAllow=/dev/nvidiactl rwm' '--property=DeviceAllow=/dev/nvidia-modeset rwm' --property=DeviceAllow=/dev/dri/renderD128 '--property=DeviceAllow=/dev/dri rw' '--property=DeviceAllow=/dev/shm rw' --bind-ro=/sys/module --boot --inaccessible=/sys/module/apparmor --quiet --keep-unit --machine=gpu --directory=rootfs --capability=all --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-cfg.so.545.23.08 --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so.545.23.08 --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvcuvid.so.545.23.08 --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-nvvm.so.545.23.08 --bind=/dev/nvidia-uvm-tools --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-encode.so.545.23.08 --bind=/dev/nvidia0 --bind-ro=/usr/bin/nvidia-smi --bind-ro=/usr/bin/nvidia-persistenced --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libcuda.so.545.23.08 --bind-ro=/usr/lib/nvidia/current/nvidia-smi --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ptxjitcompiler.so.545.23.08 --bind=/dev/nvidiactl --bind=/dev/nvidia-uvm --network-bridge=br0 --resolv-conf=bind-host --bind=/dev/fuse --bind=/dev/shm --bind=/dev/nvidia0 --bind=/dev/nvidiactl --bind=/dev/nvidia-uvm --bind=/dev/nvidia-uvm-tools --bind-ro=/sys/module --inaccessible=/sys/module/apparmor

After:

systemd-run --collect --property=Delegate=yes --property=RestartForceExitStatus=133 --property=SuccessExitStatus=133 --property=TasksMax=infinity --property=Type=notify --setenv=SYSTEMD_NSPAWN_LOCK=0 --property=KillMode=mixed --unit=jlmkr-gpu --working-directory=./jails/gpu '--description=My nspawn jail gpu [created with jailmaker]' --setenv=SYSTEMD_SECCOMP=0 -- systemd-nspawn '--property=DeviceAllow=/dev/nvidia-uvm rwm' '--property=DeviceAllow=/dev/nvidia-uvm-tools rwm' '--property=DeviceAllow=/dev/nvidiactl rwm' '--property=DeviceAllow=/dev/nvidia-modeset rwm' --property=DeviceAllow=/dev/dri/renderD128 '--property=DeviceAllow=/dev/dri rw' '--property=DeviceAllow=/dev/shm rw' --bind-ro=/sys/module --boot --inaccessible=/sys/module/apparmor --quiet --keep-unit --machine=gpu --directory=rootfs --capability=all --bind=/dev/nvidiactl --bind-ro=/usr/lib/nvidia/current/nvidia-smi --bind=/dev/nvidia-uvm --bind-ro=/usr/lib/x86_64-linux-gnu/nvidia/current --bind-ro=/usr/bin/nvidia-persistenced --bind=/dev/nvidia-uvm-tools --bind-ro=/usr/bin/nvidia-smi --bind=/dev/nvidia0 --network-bridge=br0 --resolv-conf=bind-host --bind=/dev/fuse --bind=/dev/shm --bind=/dev/nvidia0 --bind=/dev/nvidiactl --bind=/dev/nvidia-uvm --bind=/dev/nvidia-uvm-tools --bind-ro=/sys/module --inaccessible=/sys/module/apparmor

Where the change is the removal of individual files under /usr/lib/x86_64-linux-gnu/nvidia/current/ and are replaced with just a single mount for the whole directory itself.

@Jip-Hop
Copy link
Owner

Jip-Hop commented May 9, 2024

Could you please create a PR against the current develop branch? :)

@dalgibbard
Copy link
Contributor Author

Could you please create a PR against the current develop branch? :)

Ah, yeah sure, no probs :)

@dalgibbard dalgibbard closed this by deleting the head repository May 9, 2024
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.

2 participants