`distrobox create name example nvidia
distrobox create --name example-nvidia-toolkit --additional-flags "--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -e NVIDIA_DRIVER_CAPABILITIES=all" --image nvidia/cuda
27 Replies
didn't seem to work, this is the full command line:
fails with:
me thinks this is because of the
--user root:root
in podman by default your user maps to root so therefore no permission issues
distrobox uses --userns keep-id
and --user root:root
which means your user maps to itself and root maps to root
works if you use distrobox
with --root
change the
/etc/nvidia-container-runtime/config.toml
to remove no-cgroups = true
?
ahI think at least for bazzite this should work ok, just add the stuff in the assemble file
eugh, does it have to be root?
that's unfortunate
and distrobox is going to start enforcing root containers having their own passwords
which means I can't just assemble them
unless I also pass a flag to disable password checks at all, which is very dangerous
not really, it works on rootless podman
it just that distrobox combination of flags makes it using that flag is the lowest-effort workaround
mm this probably means it will incompatible with toolbox images, at least semantically as toolbox images require
:NOPASSWD
on sudo anyway
I guess the effect is that any password won't do anything when using these images as sudo
will just not ask anywayat least this might solve the controller issue
the issue where it has to be connected before the container starts?
yea
nice!
That affects flatpak too I think, we need a udev event proxy 🧐
so what exactly is needed to get this working then? I'm down to make some test images
For the nvidia thing?
Yeah, saw something about generating a file and deleting an existing one
Just making sure I have all the pieces since I can't test this myself
Unless that's upstream already
You just need to use the latest version of the nvidia container toolkit
And generate the CDI file
Ah cool, that's easy 🙂
CDI configuration is hardware specific
That CDI is optional, no? I saw something about being able to skip it and generate on the fly
via nvidia.com/all as an arg
No I think that just selects all gpus
I didn’t try on the new container toolkit version though because ublue is outdated in that part
Nvidia's docs say that CDI can change from driver updates
So unless we're generating that often that may be a problem
Let me find what I was reading just in case we can avoid this
i should get that updated today sometime, so tomorrow's builds should have newer toolit
I guess that works
Unclear what the difference is
🙂 nothing like bypassing merge protection
https://github.com/ublue-os/akmods/commit/45719c8d4f2320772f8a4584c70a3b715fbfd88b
GitHub
feat: update to new repo for nvidia-container-toolkit · ublue-os/ak...
This enables us to get a newer nvidia container toolkit version 1.14
which now provides root and rootless podman modes without configuration
files, plus CDI.
Added some links to docs.