VM GPU Passthrough

VM GPU Passthrough

About

I ran into the problem of not being able to use my GPU inside the VM. This post documents how to pass it through to it.

With Windows 10 going out of support, some software like Autodesk’s Fusion360 no longer supports it. Unfortunately, years ago I chose this POS software for 3D modeling, and I’m right now wishing I instead spent my time learning something different, like FreeCAD, SolidWorks, or something.

So, to keep using it, I would have to upgrade to Windows 11, and there is no way in hell I’m doing that(the only OS upgrade I will be making in the future is Linux), so a VM it was.

Important Note: When you update your GPU drivers, you will have to copy over the drivers again.

For this reason and to make things even easier for you, I have created a PowerShell script you can run that will do everything I do in the post below automatically. You just fill in the name of your VM and its hard-drive location.

PowerShell script · run as Administrator

Passthrough Setup

First, open up your VM’s settings and make sure checkpoints are disabled; otherwise, the VM might boot from one of them instead of the hard drive.

Then go to your VMs vhdx file location and mount it.

In my case, the drive was mounted as E: drive so I needed to create a folder called HostDriverStore inside System32 and located at E:\Windows\System32\HostDriverStore

Then open up C:\Windows\System32\DriverStore on your host machine and copy all of its contents to your VM’s HostDriverStore folder.

Next, go to the System32 folder on your host machine and copy over all the files that start with “nv”. These are NVIDIA drivers.
Now unmount/eject the drive.
Finally, run this PowerShell script on your host as an administrator. Fill in your VM name.
$vm = "your VM name"

if (Get-VMGpuPartitionAdapter -VMName $vm -ErrorAction SilentlyContinue) {
        Remove-VMGpuPartitionAdapter -VMName $vm
}

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

Add-VMGpuPartitionAdapter -VMName $vm
Now your GPU should be available inside your VM:

Leave a Reply

Your email address will not be published. Required fields are marked *

The following GDPR rules must be read and accepted:
This form collects your name, email and content so that we can keep track of the comments placed on the website. For more info check our privacy policy where you will get more info on where, how and why we store your data.