Skip to content

Mapping GPU guideline #1237

@dassic

Description

@dassic

Operating system

Ubuntu 24.04.2 LTS

Description

Hi!

So I was trying to get a Nvidia GPU mapped to a Windows 11 container, similar to what I do with Linux containers....but it's a bit random what works, and I wonder if we could get some guidelines added to the main page similar to what is done for other features (additional disks, external network, etc.) ?

In my specific case, the setup is a Proxmox server (8.4.1) running an Ubuntu 24.04.2 VM with PCIE GPU passthrough. This portion works fine, the VM can see the GPU and Nvidia docker toolkit is installed.
Linux docker containers do all work well and can use the GPU (an RTX8000).

The challenge begins with the Windows container.
It appears that when enabling the GPU: "Y" option and reference /dev/dri it does install support for Intel iGPU (something I do not have on the test machine), but for Nvidia GPUs, I've not been able to get it to map it properly to the container. At no time it got to a point where the GPU is seen in the device manager in the Windows container.

Any suggestions ?

Here's what's seen on the docker VM:

root@docker-03-gpu:~# lspci | egrep -i "vga|3d"
00:01.0 VGA compatible controller: Device 1234:1111 (rev 02)
01:00.0 3D controller: NVIDIA Corporation TU102GL [Quadro RTX 6000/8000] (rev a1)

root@docker-03-gpu:~# nvidia-smi
Tue May 13 07:20:28 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.144.03             Driver Version: 550.144.03     CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  Quadro RTX 8000                Off |   00000000:01:00.0 Off |                    0 |
| N/A   45C    P0             64W /  250W |    2629MiB /  46080MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      3634      C   /usr/local/bin/python                         266MiB |
|    0   N/A  N/A      8171      C   ...in/ubuntu/python38/venv/bin/python3        870MiB |
|    0   N/A  N/A      8468      C   python3.8                                    1490MiB |
+-----------------------------------------------------------------------------------------+

Docker compose

services:
  windows:
    image: dockurr/windows:latest
    networks:
      dclan:
    container_name: win11test
    environment:
      VERSION: "11"
      USERNAME: "bill"
      PASSWORD: "gates"
      REGION: "en-US"
      KEYBOARD: "en-US"
      LANGUAGE: "English"
      DHCP: "Y"
      DISK_SIZE: "200G"
      RAM_SIZE: "32G"
      CPU_CORES: "8"
      GPU: "Y"
      NVIDIA_VISIBLE_DEVICES: "all"
      NVIDIA_DRIVER_CAPABILITIES: "all"
    devices:
      - /dev/kvm
      - /dev/net/tun
      - /dev/vhost-net
      - /dev/dri
    device_cgroup_rules:
      - 'c *:* rwm'
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 3389:3389/tcp
      - 3389:3389/udp
    volumes:
      - ./windows:/storage
    restart: always
    stop_grace_period: 2m
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [compute, utility]
networks:
  dclan:
    external: true

Docker log

❯ Starting Windows for Docker v4.35...
❯ For support visit https://github.com/dockur/windows
❯ CPU: Intel Xeon Gold 5220 | RAM: 110/126 GB | DISK: 95 GB (ext4) | KERNEL: 6.8.0-59...
❯ Requesting Windows 11 from the Microsoft servers...
❯ Downloading product information from Microsoft server...
❯ Downloading Windows 11...

     0K ........ ........ ........ ........  0% 62.5M 63s
 32768K ........ ........ ........ ........  1% 80.1M 56s
 65536K ........ ........ ........ ........  2% 72.1M 55s
 98304K ........ ........ ........ ........  3% 74.9M 53s
131072K ........ ........ ........ ........  4% 72.2M 53s
163840K ........ ........ ........ ........  4% 74.1M 52s
196608K ........ ........ ........ ........  5% 75.5M 52s
229376K ........ ........ ........ ........  6% 66.6M 52s
262144K ........ ........ ........ ........  7% 72.6M 51s
294912K ........ ........ ........ ........  8% 63.1M 51s
327680K ........ ........ ........ ........  8% 65.8M 51s
360448K ........ ........ ........ ........  9% 82.1M 50s
393216K ........ ........ ........ ........ 10% 68.5M 50s
425984K ........ ........ ........ ........ 11% 73.4M 49s
458752K ........ ........ ........ ........ 12% 77.8M 49s
491520K ........ ........ ........ ........ 12% 83.4M 48s
524288K ........ ........ ........ ........ 13% 81.6M 47s
557056K ........ ........ ........ ........ 14% 79.2M 46s
589824K ........ ........ ........ ........ 15% 63.4M 46s
622592K ........ ........ ........ ........ 16% 80.1M 46s
655360K ........ ........ ........ ........ 16% 81.6M 45s
688128K ........ ........ ........ ........ 17% 82.2M 44s
720896K ........ ........ ........ ........ 18% 71.7M 44s
753664K ........ ........ ........ ........ 19% 79.3M 43s
786432K ........ ........ ........ ........ 20% 56.4M 44s
819200K ........ ........ ........ ........ 20% 78.9M 43s
851968K ........ ........ ........ ........ 21% 69.7M 43s
884736K ........ ........ ........ ........ 22% 50.0M 43s
917504K ........ ........ ........ ........ 23% 74.4M 42s
950272K ........ ........ ........ ........ 24% 84.6M 42s
983040K ........ ........ ........ ........ 24% 85.5M 41s
1015808K ........ ........ ........ ........ 25% 66.5M 41s
1048576K ........ ........ ........ ........ 26% 78.9M 40s
1081344K ........ ........ ........ ........ 27% 84.6M 40s
1114112K ........ ........ ........ ........ 28% 84.4M 39s
1146880K ........ ........ ........ ........ 29% 82.7M 38s
1179648K ........ ........ ........ ........ 29% 76.0M 38s
1212416K ........ ........ ........ ........ 30% 67.8M 38s
1245184K ........ ........ ........ ........ 31% 52.6M 38s
1277952K ........ ........ ........ ........ 32% 68.7M 37s
1310720K ........ ........ ........ ........ 33% 81.5M 37s
1343488K ........ ........ ........ ........ 33% 73.9M 36s
1376256K ........ ........ ........ ........ 34% 67.2M 36s
1409024K ........ ........ ........ ........ 35% 84.3M 35s
1441792K ........ ........ ........ ........ 36% 74.6M 35s
1474560K ........ ........ ........ ........ 37% 81.4M 34s
1507328K ........ ........ ........ ........ 37% 77.9M 34s
1540096K ........ ........ ........ ........ 38% 80.2M 33s
1572864K ........ ........ ........ ........ 39% 78.1M 33s
1605632K ........ ........ ........ ........ 40% 73.3M 32s
1638400K ........ ........ ........ ........ 41% 75.5M 32s
1671168K ........ ........ ........ ........ 41% 79.3M 31s
1703936K ........ ........ ........ ........ 42% 61.6M 31s
1736704K ........ ........ ........ ........ 43% 73.8M 31s
1769472K ........ ........ ........ ........ 44% 82.8M 30s
1802240K ........ ........ ........ ........ 45% 73.3M 30s
1835008K ........ ........ ........ ........ 45% 73.8M 29s
1867776K ........ ........ ........ ........ 46% 74.8M 29s
1900544K ........ ........ ........ ........ 47% 81.7M 28s
1933312K ........ ........ ........ ........ 48% 71.9M 28s
1966080K ........ ........ ........ ........ 49% 87.5M 27s
1998848K ........ ........ ........ ........ 49% 62.2M 27s
2031616K ........ ........ ........ ........ 50% 80.3M 27s
2064384K ........ ........ ........ ........ 51% 76.0M 26s
2097152K ........ ........ ........ ........ 52% 80.9M 26s
2129920K ........ ........ ........ ........ 53% 71.8M 25s
2162688K ........ ........ ........ ........ 54% 53.1M 25s
2195456K ........ ........ ........ ........ 54% 76.1M 24s
2228224K ........ ........ ........ ........ 55% 78.6M 24s
2260992K ........ ........ ........ ........ 56% 74.8M 24s
2293760K ........ ........ ........ ........ 57% 76.5M 23s
2326528K ........ ........ ........ ........ 58% 78.1M 23s
2359296K ........ ........ ........ ........ 58% 73.4M 22s
2392064K ........ ........ ........ ........ 59% 80.1M 22s
2424832K ........ ........ ........ ........ 60% 45.7M 21s
2457600K ........ ........ ........ ........ 61% 78.8M 21s
2490368K ........ ........ ........ ........ 62% 87.9M 21s
2523136K ........ ........ ........ ........ 62% 76.3M 20s
2555904K ........ ........ ........ ........ 63% 71.3M 20s
2588672K ........ ........ ........ ........ 64% 72.6M 19s
2621440K ........ ........ ........ ........ 65% 55.0M 19s
2654208K ........ ........ ........ ........ 66% 48.2M 19s
2686976K ........ ........ ........ ........ 66% 82.9M 18s
2719744K ........ ........ ........ ........ 67% 77.5M 18s
2752512K ........ ........ ........ ........ 68% 64.7M 17s
2785280K ........ ........ ........ ........ 69% 73.5M 17s
2818048K ........ ........ ........ ........ 70% 72.7M 16s
2850816K ........ ........ ........ ........ 70% 68.9M 16s
2883584K ........ ........ ........ ........ 71% 81.9M 15s
2916352K ........ ........ ........ ........ 72% 80.4M 15s
2949120K ........ ........ ........ ........ 73% 79.6M 15s
2981888K ........ ........ ........ ........ 74% 87.8M 14s
3014656K ........ ........ ........ ........ 74% 68.4M 14s
3047424K ........ ........ ........ ........ 75% 76.0M 13s
3080192K ........ ........ ........ ........ 76% 76.6M 13s
3112960K ........ ........ ........ ........ 77% 77.4M 12s
3145728K ........ ........ ........ ........ 78% 84.0M 12s
3178496K ........ ........ ........ ........ 79% 74.9M 11s
3211264K ........ ........ ........ ........ 79% 77.9M 11s
3244032K ........ ........ ........ ........ 80% 82.0M 11s
3276800K ........ ........ ........ ........ 81% 83.3M 10s
3309568K ........ ........ ........ ........ 82% 78.3M 10s
3342336K ........ ........ ........ ........ 83% 74.5M 9s
3375104K ........ ........ ........ ........ 83% 79.4M 9s
3407872K ........ ........ ........ ........ 84% 80.5M 8s
3440640K ........ ........ ........ ........ 85% 50.7M 8s
3473408K ........ ........ ........ ........ 86% 77.8M 7s
3506176K ........ ........ ........ ........ 87% 68.9M 7s
3538944K ........ ........ ........ ........ 87% 57.7M 7s
3571712K ........ ........ ........ ........ 88% 67.1M 6s
3604480K ........ ........ ........ ........ 89% 82.7M 6s
3637248K ........ ........ ........ ........ 90% 70.3M 5s
3670016K ........ ........ ........ ........ 91% 82.2M 5s
3702784K ........ ........ ........ ........ 91% 75.3M 4s
3735552K ........ ........ ........ ........ 92% 86.5M 4s
3768320K ........ ........ ........ ........ 93% 58.5M 4s
3801088K ........ ........ ........ ........ 94% 74.3M 3s
3833856K ........ ........ ........ ........ 95% 76.3M 3s
3866624K ........ ........ ........ ........ 95% 71.2M 2s
3899392K ........ ........ ........ ........ 96% 68.6M 2s
3932160K ........ ........ ........ ........ 97% 78.0M 1s
3964928K ........ ........ ........ ........ 98% 74.3M 1s
3997696K ........ ........ ........ ........ 99% 54.6M 0s
4030464K ........ ........ ........ ........ 99% 78.4M 0s
4063232K                                    100%  105M=54s

❯ Extracting Windows 11 bootdisk...
❯ Extracting Windows 11 environment...
❯ Extracting Windows 11 setup...
❯ Extracting Windows 11 image...
❯ Adding drivers to image...
❯ Adding win11x64.xml for automatic installation...
❯ Building Windows 11 image...
❯ Creating a 200 GB growable disk image in raw format...
❯ Installing Intel GPU drivers...
❯ Installing OpenGL module...
❯ Nested KVM virtualization detected..
❯ Booting Windows securely using QEMU v10.0.0...
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
BdsDxe: skipped Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: loading Boot0001 "UEFI QEMU DVD-ROM QM00013 " from PciRoot(0x0)/Pci(0x5,0x0)/Sata(0x0,0xFFFF,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU DVD-ROM QM00013 " from PciRoot(0x0)/Pci(0x5,0x0)/Sata(0x0,0xFFFF,0x0)
❯ Windows started succesfully, visit http://127.0.0.1:8006/ to view the screen...

Screenshots (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions