Skip to content

GPU passthrought #404

@dexter74

Description

@dexter74

Operating system

Debian GNU/Linux 12 (bookworm)

Description

Hello,
I need attached a GPU Nvidia at Docker Windows 10. (**args: ...... **)

I take a command line in container:

qemu-system-x86_64
-nodefaults
-cpu host,kvm=on,l3-cache=on,+hypervisor,migratable=no,-vmx,+invtsc,arch_capabilities=off,hv_passthrough,-hv-avic,-hv-evmcs
-smp 8,sockets=1,dies=1,cores=8,threads=1
-m 8G 
-machine type=q35,smm=off,graphics=off,vmport=off,dump-guest-core=off,hpet=off,accel=kvm 
-enable-kvm 
-global kvm-pit.lost_tick_policy=discard 
-display vnc=:0,websocket=5700 
-vga virtio 
-monitor telnet:localhost:7100,server,nowait,nodelay 
-daemonize -D /run/shm/qemu.log 
-pidfile /run/shm/qemu.pid 
-name windows,process=windows,debug-threads=on
-serial pty
-device qemu-xhci,id=xhci,p2=7,p3=7
-device usb-tablet 
-netdev tap,id=hostnet0,ifname=qemu,script=no,downscript=no 
-device virtio-net-pci,id=net0,netdev=hostnet0,romfile=,mac=02:88:D0:E3:22:FB 
-drive file=/storage/data.img,id=data3,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on,if=none 
-device virtio-scsi-pci,id=data3b,bus=pcie.0,addr=0xa,iothread=io2 
-device scsi-hd,drive=data3,bus=data3b.0,channel=0,scsi-id=0,lun=0,rotation_rate=1,bootindex=3
-drive file=/storage2/data2.img,id=data4,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on,if=none
-device virtio-scsi-pci,id=data4b,bus=pcie.0,addr=0xb,iothread=io2
-device scsi-hd,drive=data4,bus=data4b.0,channel=0,scsi-id=0,lun=0,rotation_rate=1,bootindex=4
-object iothread,id=io2
-rtc base=localtime
-global ICH9-LPC.disable_s3=1 
-global ICH9-LPC.disable_s4=1 
-drive file=/storage/windows.rom,if=pflash,unit=0,format=raw,readonly=on 
-drive file=/storage/windows.vars,if=pflash,unit=1,format=raw 
-object rng-random,id=objrng0,filename=/dev/urandom 
-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0

In VM: lspci

06:10.0 VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060] (rev a1)
06:10.1 Audio device: NVIDIA Corporation GA106 High Definition Audio Controller (rev a1)

Docker compose

###########
services: #
###########
#
#
###############################
 windows:                     #
  image: 'dockurr/windows'    #
  # ------------------------- #
  container_name: 'windows'   #
  restart: 'always'           #
  # ------------------------- #
  stop_grace_period: '2m'     #
  hostname: 'Windows'         #
  # ------------------------- #
  cap_add:                    #
   - 'NET_ADMIN'              #
  # ------------------------- #
  deploy:                     #
   # ------------------------ #
   resources:                 #
   # ------------------------ #
    reservations:             #
     # ---------------------- #
     devices:                 #
      - driver: 'nvidia'      #
        count: '1'            #
        capabilities: ["gpu"] #
  # ------------------------- #
  environment:                #
   # ------------------------ #
   CPU_CORES: '4'             #
   DISK_SIZE: '32G'           #
   DISK2_SIZE: '2G'           #
   RAM_SIZE: '4G'             #
   VERSION: '10'              #
   # ------------------------ #
   LANGUAGE: 'French'         #
   REGION: 'fr-FR'            #
   KEYBOARD: 'fr-FR'          #
   # ------------------------ #
   USERNAME: 'marc'           #
   PASSWORD: 'admin'          #
   # ------------------------ #
   MANUAL: 'N'                #
  # ------------------------- #
  devices:                    #
   - '/dev/kvm'               #
   - '/dev/net/tun'           #
   - '/dev/dri/renderD128'    #
  # ------------------------- #
  volumes:                    #
    - 'Data:/storage'         #
    - 'Data2:/storage2'       #
    - '/home:/shared'         #
  # ------------------------- #
  ports:                      #
   - '8006:8006'              #
   - '3389:3389/tcp'          #
   - '3389:3389/udp'          #
###############################
#
###############################
volumes:                      #
 Data:                        #
 Data2:                       #
###############################

Docker log

❯ Starting Windows for Docker v5.14...
❯ For support visit https://github.com/dockur/windows
❯ CPU: AMD Ryzen 7 5700X | RAM: 9/16 GB | DISK: 6 GB (ext4) | KERNEL: 6.1.0-44-amd64...
❯ Warning: the virtual size of the disk is 32 GB (of which 11 GB is used), but there is only 6.4 GB of free space left in /storage, make at least 15 GB more room available!
❯ Nested KVM virtualization detected..
❯ Booting Windows using QEMU v10.0.6...
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: loading Boot0005 "Windows Boot Manager" from HD(1,GPT,2E574BF9-BFBA-41D1-9BF5-6E2E18CE4E59,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi
BdsDxe: starting Boot0005 "Windows Boot Manager" from HD(1,GPT,2E574BF9-BFBA-41D1-9BF5-6E2E18CE4E59,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi

Screenshots (optional)

The GPU isn't attached :
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions