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

feat: add support for nvidia gpu access #5132

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MondoGao
Copy link

@MondoGao MondoGao commented Aug 16, 2024

Add a new environment to enable Nvidia gpu access when creating containers. It's similar to /dev/dri support. See #1525.

Note: I didn't fully inspect and test this change since I don't have php development environment set up in my machine. Feel free to inherit this pr to enhance its maintainability.

@szaimen
Copy link
Collaborator

szaimen commented Aug 16, 2024

Hi @MondoGao thanks for your PR! Can you please fix DCO? Wee need that in order to be able to merge it later on. See https://github.com/nextcloud/all-in-one/pull/5132/checks?check_run_id=28844781358

@szaimen szaimen added 2. developing Work in progress enhancement New feature or request labels Aug 16, 2024
@szaimen szaimen added this to the next milestone Aug 16, 2024
@MondoGao
Copy link
Author

Hi @MondoGao thanks for your PR! Can you please fix DCO? Wee need that in order to be able to merge it later on. See https://github.com/nextcloud/all-in-one/pull/5132/checks?check_run_id=28844781358

Sign added :)

@szaimen
Copy link
Collaborator

szaimen commented Aug 19, 2024

Hi, I had a fast look at this and I think it would add the capability to all containers that are controlled by AIO. Better would probably be to add this as a capability to containers-schema.json and add this only to certain containers via containers.json

Also this is missing some places, e.g. adding documentation on it in the readme. See #1659 as inspiration.

Additionally, do you know if this is also going to work with AMD and Intel GPUs? In best case we create only one setting that works for all of them.

@MondoGao
Copy link
Author

Hi, I had a fast look at this and I think it would add the capability to all containers that are controlled by AIO. Better would probably be to add this as a capability to containers-schema.json and add this only to certain containers via containers.json

Also this is missing some places, e.g. adding documentation on it in the readme. See #1659 as inspiration.

Additionally, do you know if this is also going to work with AMD and Intel GPUs? In best case we create only one setting that works for all of them.

I believe docker runtime only supports Nvidia GPU passthrough. Intel & AMD CPU/GPU's hardware acceleration is exposed through /dev/dri.

Looks like I have to install php dev env to polish this pr, please expect a late response.

@luzfcb
Copy link

luzfcb commented Aug 19, 2024

@MondoGao Thank you for starting this effort.

@MondoGao @szaimen

Besides supporting Nvidia GPU passthrough, there are cases where the container may require the same specific version of the NVIDIA driver installed on the host system. It might be a good idea to create an environment variable for the Nvidia driver version and let the container handle the Nvidia driver setup and configuration logic inside the container.

That is, Nextcloud AIO could either provide some way for the user to manually specify the version or, if it is not provided by the user, then have an automatic way to obtain this information and fill an NVIDIA_DRIVER_VERSION environment variable that will be available to all containers managed by Nextcloud AIO.

I have exactly this with docker-steam-headless, and it works great.

This is the driver download and installation script: https://github.com/Steam-Headless/docker-steam-headless/blob/860451da74b397385f1b1658545d2bb891aa8e46/overlay/etc/cont-init.d/60-configure_gpu_driver.sh

This script creates the X Server configuration files and other related configurations. It probably does not apply to Nextcloud and plugins since they do not use X Server, but I am including it here just for reference.

https://github.com/Steam-Headless/docker-steam-headless/blob/860451da74b397385f1b1658545d2bb891aa8e46/overlay/etc/cont-init.d/70-configure_xorg.sh

@docjyJ
Copy link
Collaborator

docjyJ commented Aug 21, 2024

It would be nice to have this feature!

We can have Nextcloud Assistant servers with high performance easily!!!!!!

I agree with @szaimen the configuration should be done in the containers.json schema.

Otherwise it looks good to me.

AMD GPU : https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/docker.html

@szaimen szaimen modified the milestones: v9.5.0, next, v9.5.1 Sep 4, 2024
@szaimen szaimen modified the milestones: v9.6.0, next Sep 18, 2024
@szaimen szaimen modified the milestones: v9.7.0, next Oct 10, 2024
@szaimen szaimen removed this from the next milestone Oct 20, 2024
@szaimen szaimen marked this pull request as draft October 22, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants