Private ML/GPU Cloud with MS HYPER-V

Private ML/GPU Cloud with MS HYPER-V

I share short tutorial how to create own VM with GPU passthrough. With this example you will be able to create multiple dev vm instances, that share one GPU at the same time. You must have at least Windows 10 Pro with latest updates and installed current GPU drivers.

- Installation Instructions -

Install HyperV (Turn Windows Features On or Off)

- Configure virtual switch for External Network

- Disable Enhanced Sessions

Verify GPU Compatibility

- Check with Powershell: Get-VMPartitionableGPU

Create New VM:

- Gen 2

- 16GB RAM (or more), Uncheck Dynamic Memory

- 250GB (or more) HDD

VM Settings:

- 4 CPU Cores (or more)

- Disable Checkpoints

Start VM + Install Windows 11 Pro

- Driver Installation after VM Windows setup -

File Transfers

- HOST - C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_[UUID]

- GUEST - - To C:\Windows\System32\HostDriverStore\FileRepository\nv_dispi.inf_amd64_[UUID]

- HOST - C:\Windows\System32\nv*.* (Every file that begins with nv)

- GUEST - C:\Windows\System32\

- GPU Partition -

Run PowerShell ISE as Administrator

- Set $vm = [VM-NAME]

- Set-ExecutionPolicy Unrestricted

- Run Script with Play button

$vm = "GPU_VM"

Add-VMGpuPartitionAdapter -VMName $vm
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 80000000 -MaxPartitionVRAM 100000000 -OptimalPartitionVRAM 100000000 -MinPartitionEncode 80000000 -MaxPartitionEncode 100000000 -OptimalPartitionEncode 100000000 -MinPartitionDecode 80000000 -MaxPartitionDecode 100000000 -OptimalPartitionDecode 100000000 -MinPartitionCompute 80000000 -MaxPartitionCompute 100000000 -OptimalPartitionCompute 100000000

Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
Set-VM –HighMemoryMappedIoSpace 32GB –VMName $vm        

Start VM

Check to see driver is loaded and check device manager if GPU is visible.


To view or add a comment, sign in

Explore content categories