containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.59k stars 220 forks source link

Add flag to start toolbox container with gpu support #810

Closed pkarakal closed 3 years ago

pkarakal commented 3 years ago

Is your feature request related to a problem? Please describe. Podman can currently utilize the gpu of the computer to run gpu tasks (like compile and run CUDA applications, train models on GPU inside a container) by using these flags --security-opt=label=disable --hooks-dir=/usr/share/containers/oci/hooks.d/ though you should already have the runtime and toolkit of your graphics vendor. For those use cases it would be great if we could passthrough our gpu inside the toolbox and never mind creating new containers for that use case.

Describe the solution you'd like It would be ideal if a flag could be added for creating a toolbox container with gpu support (eg --gpu).

Describe alternatives you've considered Another alternative would be to pass arguments down to podman so that it could use those cli arguments to create the container. (haven't tried this and I don't know if that is already supported)

Additional context Packaging may become a problem. NVIDIA for example doesn't ship their container tools to Fedora which is just sad, though one can compile it from source or a package could be created for it (they do have a package for CentOS which works on Fedora (maybe start by making a package for fedora as well ?!)) There is also the ROCm for AMD Radeon gpus but i don't have an AMD gpu to test if it is supported under podman.

debarshiray commented 3 years ago

From a very high-level, all Toolbox containers should have GPU support (whatever that means, because the term is a bit nebulous). So, we should not add or need an option to have special GPU-enabled containers.

Toolbox containers already have access to the entire /dev from the host so a lot of things should already work.

That said, I think there are some gaps with the NVIDIA proprietary driver that we could address.

debarshiray commented 3 years ago

Duplicate of https://github.com/containers/toolbox/issues/116

debarshiray commented 2 years ago

Duplicate of https://github.com/containers/toolbox/issues/1110