关闭需要直通的虚拟机
在虚拟机设置里关闭检查点
打开powshell 按照顺序执行如下6条命令
# 将win11改为自己虚拟机的名称
$vm = "win11"
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 2Gb -VMName $vm
Set-VM -HighMemoryMappedIoSpace 32GB -VMName $vm
复制驱动文件
到 宿主机位置:C:\Windows\System32\DriverStore\FileRepository
找到nv_开头的3个文件(一般只需要复制最新日期那个即可)
复制到
虚拟机C:\Windows\System32\HostDriverStore\FileRepository
HostDriverStore\FileRepository
虚拟机没有这个文件需要自己创建
复制共享库
将宿主机 C:\Windows\System32\
复制到虚拟机 C:\Windows\System32
重启虚拟机
关闭显卡直通
# 将win11改为自己虚拟机的名称
Get-VMGpuPartitionAdapter -VMName "win11" | Remove-VMGpuPartitionAdapter
在线测试显卡性能
http://gpu./
其它
Set-VMProcessor 虚拟机名字 -ExposeVirtualizationExtensions $true