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

Nvidia container toolkit #235

Closed
RiffyDivine opened this issue Mar 8, 2024 · 2 comments
Closed

Nvidia container toolkit #235

RiffyDivine opened this issue Mar 8, 2024 · 2 comments

Comments

@RiffyDivine
Copy link

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

@kroese
Copy link
Contributor

kroese commented Mar 10, 2024

See #22

@kroese kroese closed this as completed Mar 13, 2024
@swvajanyatek
Copy link

swvajanyatek commented Aug 25, 2024

@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]  
      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants