How to use your NVidia Graphics Card in VMware Passthrough mode (Bypass Windows Error 43)

First of all, I have to credit the original author of the script which is sk1080 for his amazing work. Unfortunately on his github there is no full tutorial on how to use his work so I decided to write a full tutorial. Quote from github:

"So, the story so far: You have a VM that uses a passed-through NVIDIA graphics card
However, the driver errored out with code 43, or outright blue-screened your VM
This is because NVIDIA "Introduced a Bug" making their driver "Fail" on "Unsupported configurations", such as having a geforce, by "accidentally" detecting the presence of a hypervisor".

Of course we all know this is not a bug if it's this simple to solve, probably Nvidia is just disabling this feature to sell more high end graphic card with support for virtualization.
If you want to use your Nvidia graphics card, you first need to insert the card in your host when it's powered off and unplugged from the mains.

After inserting your graphics card, turn on your host and navigate to https://192.168.2.5/ui/#/host/manage/hardware/pci-devices (Host -> Manage -> Hardware -> PCI Devices)
Where 192.168.2.5 needs to be replaced with your host ip.

In this menu you have to Toggle Passthough on the wanted GPU, after this you have to reboot your host and when you visit the page above it should be stated as Active.

Now navigate to the VM you want to give access to your GPU, turn it off and and click Edit settings (the yellow explanation marks are shown because my host is managed by a vCenter server).

Click on Add other device and select PCI device:



Add as many PCI devices as you need and power on your VM if you are done.
Install Windows (in my case Windows 10 1803).
Run: bcdedit /set testsigning on

Reboot (shutdown -r -t 0)

Navigate to https://github.com/sk1080/nvidia-kvm-patcher and download the needed files (Green button Clone or download).


Download the newest (I suggest WHQL) driver for your graphics card on http://www.nvidia.com/Download/Find.aspx

Extract the content of the downloaded executable file with the archive program of your choice (I prefer 7-Zip). I placed the files in a subfolder like this:
nvidia-kvm-patcher-master
   gencert.ps1
   patcher.ps1
   TestSign.cer
└───DisplayDriver
        
├───Display.Driver
        
├───Display.NView
        
├───HDAudio
        
├───NV3DVision
        
├───NV3DVisionUSB.Driver
        
├───NvCamera
        
├───NVI2
        
└───NVWMI

Launch powershell as an Administrator and navigate to the nvidia-kvm-patcher-master folder. Run the command like this:
.\patcher.ps1 "C:\nvidia-kvm-patcher-master\DisplayDriver\Display.Driver"
Despites the red error you can see the driver is successfully signed.
Time to install the driver through setup.exe
After the installation of the driver we need to disable VMware SVGA 3D:
Turn off svga in VMware ESXi: Virtual Machines -> VM -> Actions -> Edit Settings -> VM Options -> Advanced-> Configuration Parameters -> Edit Configuration -> Set svga.present to FALSE:
You should now have your GPU working on your VM, let's check:

Comments

Popular posts from this blog

Let’s automate! Building an Application Delivery Portal (DEV-Process)