windows icon indicating copy to clipboard operation
windows copied to clipboard

Nvidia container toolkit

Open RiffyDivine opened this issue 11 months ago • 1 comments

Has anyone had success in using the NVK to get the windows 11 container to have access back to the GPU in the host machine? I've added my compose file in case that is the issue or does anyone know if this can even be leveraged in that way?

version: "3" services: windows: image: dockurr/windows container_name: windows devices: - /dev/kvm cap_add: - NET_ADMIN ports: - 8006:8006 - 3389:3389/tcp - 3389:3389/udp stop_grace_period: 2m environment: RAM_SIZE: "16G" CPU_CORES: "8" DISK_SIZE: "256G" volumes: - /home/riffy/docker/appdata/windows11:/storage deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: - gpu

RiffyDivine avatar Mar 08 '24 17:03 RiffyDivine

See https://github.com/dockur/windows/issues/22

kroese avatar Mar 10 '24 10:03 kroese

@kroese - can you point me to the post(s) that show how to configure for nvidia via docker-compose? It's a long and winding thread to follow, and the simple 'GPU: "Y"' seems to only install Intel GPU devices/drivers.

Here is what I currently have, and its passing the GPU into the container, but not into the windows VM:

services:

  windows:
    image: dockurr/windows
    container_name: win11
    environment:
      VERSION: "win11"
      DISK_SIZE: "256G"
      RAM_SIZE: "12G"
      CPU_CORES: "8"
      USERNAME: "myuser"
      PASSWORD: "mypassword"
      DHCP: "Y"
      GPU: "Y"
      ARGUMENTS: >
#        -device vfio-pci,host=01:00.0,multifunction=on 
#        -device vfio-pci,host=23:00.1,multifunction=on 
#        -device ivshmem-plain,memdev=ivshmem,bus=pcie.0 
#        -object memory-backend-file,id=ivshmem,share=on,mem-path=/dev/shm/looking-glass,size=32M
    devices:
      - /dev/kvm
      - /dev/vhost-net
#      - /dev/vfio/22
      - /dev/vfio/vfio
#      - /dev/shm/looking-glass
      - /dev/nvidia0
      - /dev/nvidiactl
      - /dev/nvidia-modeset
      - /dev/nvidia-uvm
      - /dev/nvidia-uvm-tools

    device_cgroup_rules:
      - 'c *:* rwm'
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 3388:3389/tcp
      - 3388:3389/udp
    stop_grace_period: 2m
    deploy:
      resources:
        reservations:
          devices:
          - driver: nvidia
            count: all
            capabilities: [gpu]  
      

swvajanyatek avatar Aug 25 '24 23:08 swvajanyatek