-
-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Generally speaking, if using PowerShell to configure GPU-PV, parameters such as OptimalPartitionCompute would be utilized. I would like to know if there is a way to set such parameters in the HCS API? For example, restricting a certain virtual machine to using only 50% of the GPU resources.
NVIDIA SOP of GPU-PV setup: https://docs.nvidia.com/vgpu/latest/pdf/grid-vgpu-user-guide.pdf (page 29)
# VM name
$vmName = "GuestVmWithGpu"
$hostGpus = Get-VMHostPartitionableGpu
$targetGpuIndex = 0
$targetGpu = $hostGpus[$targetGpuIndex]
# From nvidia docs https://docs.nvidia.com/vgpu/latest/pdf/grid-vgpu-user-guide.pdf
Remove-VMGpuPartitionAdapter -VMName $vmName
Add-VMGpuPartitionAdapter -VMName $vmName `
-MinPartitionVRAM $targetGpu.MinPartitionVRAM `
-MaxPartitionVRAM $targetGpu.MaxPartitionVRAM `
-OptimalPartitionVRAM $targetGpu.OptimalPartitionVRAM `
-MinPartitionEncode $targetGpu.MinPartitionEncode `
-MaxPartitionEncode $targetGpu.MaxPartitionEncode `
-OptimalPartitionEncode $targetGpu.OptimalPartitionEncode `
-MinPartitionDecode $targetGpu.MinPartitionDecode `
-MaxPartitionDecode $targetGpu.MaxPartitionDecode `
-OptimalPartitionDecode $targetGpu.OptimalPartitionDecode `
-MinPartitionCompute $targetGpu.MinPartitionCompute `
-MaxPartitionCompute $targetGpu.MaxPartitionCompute `
-OptimalPartitionCompute $targetGpu.OptimalPartitionCompute
# Allow the VM to control cache types for MMIO access.
Set-VM -GuestControlledCacheTypes $true -VMName $vmName
# Set the lower MMIO space to 1 GB to allow sufficient MMIO space to be mapped.
# This amount is twice the amount that the device must allow for alignment. Lower
# MMIO space is the address space below 4 GB and is required for any device that has
# 32-bit BAR memory
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vmName
# Set the upper MMIO space to 32 GB to allow sufficient MMIO space to be mapped.
# This amount is twice the amount that the device must allow for alignment. Upper
# MMIO space is the address space above approximately 64 GB
Set-VM -HighMemoryMappedIoSpace 32GB -VMName $vmNameReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels