Manual: Enabling GPU Access in Portainer & Docker

1. Prepare your server

Open a terminal and run the following commands to identify your GPU information:


cd /proc/driver/nvidia/gpus/
ls
cd [your-folder-name]
cat information

Alternatively, you can use:


nvidia-smi --query-gpu name,uuid --format=csv

Copy your GPU UUID or relevant details.

2. Login to Portainer

  • Go to the Portainer homepage: http://portainer:port#!/home
  • Select the environment you want to manage.

3. Adjust GPU settings (based on your setup)

  1. Open the panel for your environment (for example, “local” on the left side).
  2. Go to the Host section, then navigate to Setup.
  3. Scroll down until you see “GPUs (?)”.
  4. Follow the steps to add your GPU:
    • Paste the copied GPU UUID in the appropriate field.
    • Give it a recognizable name (e.g., GTX 1060 3GB).
    • Confirm or update the environment.

4. Configure containers

  • When creating a new container, you can now easily enable GPU support in the container’s configuration.

Note

In newer Portainer versions (v2.18 and above), the GPU settings have been moved to the Host > Setup section of your environment.

You are now ready to use GPU acceleration in Docker containers managed via Portainer for workloads like machine learning or video processing!

Close Menu