[Plugin] Intel-GVT-g


Recommended Posts

Intel GVT-g (only Unraid 6.9.2 and up)


What is Intel-GVT-g?

Intel-GVT-g is a technology that provides mediated device passthrough for Intel iGPUs (Broadwell and newer). It can be used to virtualize the iGPU for multiple guest virtual machines and also in Docker containers, effectively providing near-native graphics performance in the virtual machine and still letting your host use the virtualized iGPU normally. This is useful if you want accelerated graphics in Windows virtual machines running without dedicated GPUs for full device passthrough. (Similar technologies exist for NVIDIA and AMD GPUs, but they are available only in the "professional" GPU lines like Quadro, Radeon Pro and so on.)

 

What does this mean?

This means less power consumption, less heat output and better performance for your VM's.

 

On which CPUs does Intel-GVT-g work?

Client platforms: 5th, 6th, 7th, 8th, 9th and 10th Generation with Intel Core Processor Graphics

Server platforms: E3-v4, E3_v5, E3_v6, E-2xxx, W-12xx, W10xxx with Intel Processor Graphics

 

 

Instructions

For a full tutorial please go to the second post of this thread!

  1. Make sure that your iGPU is not bound to VFIO and also that no arguments are passed through in your syslinux.conf

  2. Make sure that your iGPU is set as the primary graphics adapter in your server's BIOS

  3. Make sure that you have actually connected a Monitor or at least a Dummy Plug to your iGPU if you have other dedicated GPU(s) installed in your system

  4. Make sure that your VM is set up with the latest Q35 machine type
  5. Make sure that the VM is stopped
  6. Go to the Intel-GVT-g plugin page
  7. Select the VM that you want to use with a vGPU along with the mode and click "Assign VM"
  8. Go back to the VM page and start the VM
  9. Go to the Intel Download Center: Link and download the latest driver inside your VM
    (Select "Graphics" -> and download the appropriate driver on the Intel Download Center)
  10. Install the driver and reboot
  11. After rebooting open Device Manager and you should see two Displays
    (the first should be the Intel iGPU and the second one should be the VNC display adapter)

 

Make sure that the iGPU is working:

  1. Open up Task Manager (right click the taskbar and select Task Manager -> in the bottom left click on "Show details" -> go to the "Performance" tab and see if the iGPU is listed on the bottom)
  2. Go to YouTube and play a video and check if the iGPU is actually used

 

If the iGPU isn't shown in Task Manager go to your Device Manager and expand the Display section and see if the iGPU is in an error state, if yes go to the Troubleshooting section below, if the solution isn't listed there reply in this thread.

 

Optional recommended steps:

  1. Enable RDP in Settings, install Parsec or your favourite kind of remote connection software and make sure that it working properly even after a restart
  2. Display output only on second screen (iGPU), please note that if you do this you will have no output on the VNC Remote and you are only able to see and connect to it remotely (you have to enable RDP or install your remote connection software in the first place!)

ATTENTION

Never add or remove a vGPU from a running VM, always make sure to stop the VM first!

Currently only VMs without symbols or special characters in the name are possible!

 

 

Troubleshooting

  • The plugin page lists no available Modes:
    Make sure that you have set the iGPU to the primary graphics adapter in the BIOS and have also connected a Monitor or a Dummy Plug to your iGPU.
     
  • The iGPU in Device Manger shows Code 43:
    Make sure that you have selected the latest Q35 Machine type in the VM settings
    Try to select OVMF instead of SeaBIOS or vice versa
     
  • "Execution error device not found: mediated device 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found":
    Go to the syslog in Unraid and look for a message that says:
    gvt: request xxMB avail 0MB max xxxMB taken xxxMB
    gvt: failed to create intel vgpu: -28
    If you find this message you are out of GPU memory. Likely because an old UUID failed to delete, or you are already running one or multiple VMs with a vGPU assigned and you are out of VRAM
    The amount of available vGPUs at the same time is dependent on your CPU and Motherboard.
     
  • Button "RESTORE QEMU CONFIGURATION":
    If you have any trouble starting VMs you can reset the configuration of your QEMU hooks with this button, please use this Button only as the last troubleshooting step!!!
     
  • RDP or remote connection software not working/installed in the first place, no display output or frozen display output over VNC Remote:
    Stop the VM, go to the Intel-GVT-g plugin page and remove the assigned vGPU and start the VM again, this should bring up the VNC Remote screen again.

 

 

Thanks to @lnxd for proofreading

and @alturismo for parts from his Qemu hook script

  • Like 4
  • Thanks 1
Link to comment

Tutorial (Windows 10 VM)

 

First of all we will create a new VM with the latest Q35 "Machine" type (you can also use an existing VM but make sure that it actually set to to the latest Q35 "Machine"). But don't assign a vGPU just yet, first we will install Windows and after everything is installed we will actually assign a vGPU.

 

Both SeaBIOS and OVMF will work fine with vGPU's.

 

Please note this is just one way to set up your vGPU, you don't have to enable RDP like in this tutorial, and you can also set up Parsec or any other kind of remote connection software that you want to.

This tutorial is written for less experienced users and should be seen as a step-by-stepwalk through.

 

  1. These are the basic settings for this tutorial (you can assign as much RAM and as many CPU cores as you want) :
    1.png.9feb326620aec83e18492076585e5905.png

     
  2. Install Windows as usual and make sure that you create a password for your User (this is really important for the RDP connection in this tutorial, otherwise you can't connect to the VM via RDP) :
    2.thumb.png.8e3207dd4ed9d7f3db17c4e9e6be6749.png

     
  3. After installing Windows go to your Device Manger (right click the "Start" button -> Device Manger) install all missing drivers for Ethernet, and the the other devices from the VirtIO Drivers ISO and it should look like this:
    3.thumb.png.7d6aa34aec9991a85ea7dbcf768f5951.png

     
  4. Shutdown the VM and go to the Intel-GVT-g plugin page and select the "Mode" that you want to use and the VM you want to assign a vGPU to click "Assign VM" (please make sure that the VM isn't running when you do this!) :
    grafik.png.a29adfa072d60a68b1221ce75343005a.png

     
  5. Start the VM and go again to the Device Manager and see if the vGPU is displayed in the VM:
    4.png.cab164827dd88223fa99a0eeefe51439.png

     
  6. Download the Intel Driver for your iGPU in your VM from here: Click and install it.

     
  7. After the installation is complete you should see that your vGPU is recognized correctly in the Device Manager. Once done, reboot once more:
    7.thumb.png.8e4e79f67ae93fa4252167776496455b.png

     
  8. Enable the RDP service from Windows itself by going to the Settings and searching for "Remote Desktop", switch "Enable Remote Desktop" from "Off" to "On" and confirm that you want enable it and close the Settings Window again:
    12.png.c18451d0c8a0bce869aa9d34c6358cf9.png

     
  9. Now we are going to check the VM's IP address. Right click on the Network icon in the lower right corner and select "Open Network & Internet settings":
    13.png.bb7a956f797261e9b73e9598c9087d1a.png

     
  10. In the following window, click on "Change adapter options":
    14.png.eef6422f358b2e51f5d9ed61302b30cc.png

     
  11. In the following window, right click on your Ethernet connection and select "Status":
    15.png.32be4474f0b7b8d9d93adda0a40da58e.png

     
  12. In the following window click on "Details...":
    16.png.77d1731d17a81e8c9d0337624cf002fd.png

     
  13. And finally in the following window you will see your IP here:
    grafik.png.f69447cf53ec0cb22a4b984db50e3058.png

     
  14. Write that IP down so that we can actually can connect to it later from our local computer, smartphone,...

     
  15. Now we disable the output to the QXL Display Adapter and display everything on the vGPU Adapter, right click somewhere on the Desktop and select "Display settings":
    grafik.png.97aa59d3ddb0d69aff484aeb65faa0d7.png

     
  16. Scroll down a little down to the "Multiple displays" section and select "Show only on 2" (PLEASE NOTE, that you don't get any VNC output after doing this!) and press on time on the "TAB" Key grafik.png.778fdbb4e2b250db519ca6a8b60e890d.png once and then on "Return" grafik.png.0d2116f5def2f5669ee4992336fd08cc.png once:
    11.png.3e28c42848d8ca479827e7add932fee7.png

     
  17. After that, close the VNC Remote window and on your local computer search for "Remote Desktop Connection" in the Start menu and open it up:
    grafik.png.ab668bf6c6cacaa3d7e0ccbfd0ff3628.png

     
  18. In the next window enter the IP from Step 14 here and click on "Connect":
    grafik.png.dd4cf28d82a5f50fdd639fe947e502d9.png

     
  19. In the next window enter the credentials for the VM/User that you created when setting up the VM and click "OK":

     
  20. You should be greeted with the Desktop from your VM. Now right click somewhere on the Task Bar and select "Task Manager":
    grafik.png.108d5fd84708442340d651f327eda971.png

     
  21. In the next window click on "More details":
    8.png.f4781184acb16c66486a9e06abf8c969.png

     
  22. Got to the "Performance" tab and you should see your vGPU at the bottom:
    9.png.355dc2c91628312264c1f991e0491744.png
     
  23. To test if everything is working correctly simply open up a browser and play a video on YouTube and check your vGPU's utilization in Task Manager:
    18.thumb.png.526770b617ed68bf8d094775fe9e6177.png
     
  24. Have fun with your HW accelerated VM! :)

 

Now you can install your favorite kind of Remote Connection software (Parsec, TeamViewer,...) and make use of the vGPU. If something isn't working, you have always the ability to connect via RDP (please not if you use Parsec for streaming, unlike RDP, that you actually have to pass through a Audio Device to the VM otherwise you will get no sound output, the onboard audio or a cheap USB audio adapter will do the job just fine).

  • Like 3
  • Thanks 1
Link to comment
37 minutes ago, Daniel Sippel said:

Great work. Would this also work with macinabox?

Eventually but I'm not really sure since I'm not a OSX user.

 

@giganode can you help out or at least share you opinion if that's possible?

The best place to ask would be on the macinabox support thread.

 

38 minutes ago, Daniel Sippel said:

A tutorial would be awesome!

I don't think it would be any different from the tutorial above until to Step 4, Step 5 would be to get the vGPU working in OSX.

Link to comment
I don't think it would be any different from the tutorial above until to Step 4, Step 5 would be to get the vGPU working in OSX.

Yes, you can actually use gvt-g with a macOS vm. There are some extra things to do if I remember correctly, but yes it does work!


Gesendet von iPhone mit Tapatalk
  • Like 1
Link to comment
10 minutes ago, tampasmix said:

is it possible to use a gtv-g gpu as the main graphics output?

Do you mean for Unraid as the main graphics output (console or Unraid GUI mode)? Then yes.

 

Or do you mean to display the output from the VM? Then no, at least partially...

You can set up a DisplayLink device (for exemple a USB one), install the drivers in the VM and set the Display to "mirror output" then you have the abbility to display the output on a physical monitor with the accelerated vGPU.

 

Hope that makes sense to you.

Link to comment
8 hours ago, ich777 said:

Do you mean for Unraid as the main graphics output (console or Unraid GUI mode)? Then yes.

 

Or do you mean to display the output from the VM? Then no, at least partially...

You can set up a DisplayLink device (for exemple a USB one), install the drivers in the VM and set the Display to "mirror output" then you have the abbility to display the output on a physical monitor with the accelerated vGPU.

 

Hope that makes sense to you.

I really mean the VM output. 

 

Thanks for the answer, and for this awesome work. I've been realy waiting for this to enable Mac+Win+ArchLinux VMs on my NUC. I will only need the output from windows or linux, since it will be connected to a TV. The other ones will be acessed by RDP/VNC/Apple Remote.

 

I supose that i will need also a dummy plug, since the actual integrated HDMI port will be disconnected.

 

Link to comment
2 minutes ago, tampasmix said:

Mac

Is really difficult on Unraid but I will investigate further.

 

3 minutes ago, tampasmix said:

I supose that i will need also a dummy plug, since the actual integrated HDMI port will be disconnected.

A dummy plug and a DisplayLink device are two different things.

 

A display link device is like a USB graphics card with a HDMI or VGA or whatever output on it and you will only need it if you want to output the video signal. You simply have to pass the DisplayLink device through to the VM and mirror the GVT-g iGPU screen so that you get a output hope that makes sense...

 

image.png.64beadd76e8bf183475d582efeb4c904.png

 

A dummy plug for the iGPU is only needed if your iGPU isn't initialized properly when booting Unraid.

Link to comment

I think i misread your guide

"Make sure that your actually plugged in a Monitor or at least a Dummy Plug to your iGPU if you got other dedicated GPU's installed in your system"

The dummy Plug is only needed if the system has more than one gpu. That's not my case.

 

Still working on the GVT-G passtrough to the Macos VM, no luck yet!

Link to comment
15 minutes ago, tampasmix said:

The dummy Plug is only needed if the system has more than one gpu. That's not my case.

Exactly.

 

15 minutes ago, tampasmix said:

Still working on the GVT-G passtrough to the Macos VM, no luck yet!

This won't work by now, please don't try it any further, this is a dead end for now.

I will report back if I got some news for you.

  • Like 2
Link to comment

I'm having issues with the Windows 10 VM Blue Iris NVR that I installed this on last night. It ran for about 16 hours problem free until today I noticed that CPU/GPU usage was reporting 0 on the cores I assigned to it. Log is full of the following gvt errors, "Infrastructure kernel: gvt: guest page write error, gpa". I wasn't able to recover the VM without having to do a full reboot of the unraid server. After the system came back up it ran for another hour before locking up and filling the log with gvt errors again and forcing a server restart to recover. There are no errors in the system log within the Windows VM. I'm hoping someone can help resolve this as it drops CPU load by a good 20% using hardware acceleration.

System:

Supermicro X11SCZ-F

24GB ram

i7-8700k

Unraid 6.9.2

Windows VM setup

4 cores assigned - 21% load with gvt

8gb allotted - 3.5gb in use

cameras are decoding with intel+VPP

igpu driver is the latest. During processing it's only utilizing around 35-38% of the GPU. It's the only VM utilizing gvt on this unraid.

Link to comment
8 minutes ago, STGMavrick said:

I'm having issues with the Windows 10 VM Blue Iris NVR that I installed this on last night. It ran for about 16 hours problem free until today I noticed that CPU/GPU usage was reporting 0 on the cores I assigned to it. Log is full of the following gvt errors, "Infrastructure kernel: gvt: guest page write error, gpa". I wasn't able to recover the VM without having to do a full reboot of the unraid server. After the system came back up it ran for another hour before locking up and filling the log with gvt errors again and forcing a server restart to recover. There are no errors in the system log within the Windows VM. I'm hoping someone can help resolve this as it drops CPU load by a good 20% using hardware acceleration.

System:

Supermicro X11SCZ-F

24GB ram

i7-8700k

Unraid 6.9.2

Windows VM setup

4 cores assigned - 21% load with gvt

8gb allotted - 3.5gb in use

cameras are decoding with intel+VPP

igpu driver is the latest. During processing it's only utilizing around 35-38% of the GPU. It's the only VM utilizing gvt on this unraid.

Are you on the latest W10?

 

There are issues logged on the Intel git hub for this error also, so its likely to be a bug outside of ich777s control.

 

https://github.com/intel/gvt-linux/issues/120

https://github.com/intel/gvt-linux/issues/153

  • Thanks 1
Link to comment
24 minutes ago, xruchai said:

Hi, after installing the plugin, transcoding in Emby no longer works, the GPU is no longer displayed. Under Preferred Hardware Decoders / Encoders nothing is shown anymore to set. I hope someone can help me ^^'

What have you done exactly?

Installed the plugin, reboot, assigned a vGPU to a VM?

Can you also share your Diagnostics (Tools -> Diagnostics -> Download -> drop the downloaded file here in the text box)?

 

I run a Windows 10 VM and Emby still just fine without any issue.

 

13 minutes ago, STGMavrick said:

Infrastructure kernel: gvt: guest page write error, gpa"

Can you please double check if "Put computer to sleep" is set to "Never" in your Power Options in the Guest VM? Eventually also try to set "Turn off display" to "Never".

Also please share your Diagnostics if possible (Tools -> Diagnostics -> Download -> drop the downloaded file here in the text box)?

Link to comment
8 minutes ago, SimonF said:

Are you on the latest W10?

 

There are issues logged on the Intel git hub for this error also, so its likely to be a bug outside of ich777s control.

 

https://github.com/intel/gvt-linux/issues/120

https://github.com/intel/gvt-linux/issues/153


I found those same problem threads but this VM is on Win 10 20H2, which is the latest.

 

3 minutes ago, ich777 said:

Can you please double check if "Put computer to sleep" is set to "Never" in your Power Options in the Guest VM? Eventually also try to set "Turn off display" to "Never".

Also please share your Diagnostics if possible (Tools -> Diagnostics -> Download -> drop the downloaded file here in the text box)?


Sleep settings never, screen off is Never. Sure, see attached.

infrastructure-diagnostics-20210518-0351.zip

Link to comment
19 minutes ago, STGMavrick said:

Sure, see attached.

Thank you!

First of all remove that from your "go" file:

#Setup drivers for hardware transcoding
modprobe i915
chmod -R 777 /dev/dri

Since the plugin thake's care of that and even if you don't use the GVT-g plugin anymore I recommend to use the Intel GPU TOP plugin that also takes care of that end enables to install the GPU Statistics plugin from @b3rs3rk to see the utilization from your iGPU on the Unraid Dasboard (btw if you want to see the utilization you can install the Intel GPU TOP plugin along with the GVT-g plugin and then install the GPU Statistics plugin).

Oh now I saw that you already installed the plugins already... :D

 

Which mode have you selected for the VM? 4 or 8?

Eventually try to only use only one vGPU for your VM's for now for testing purposes... (I see that the other VM also have a vGPU assigned from the Diagnostics).

 

It could also be the case that BlueIris or some other software inside the VM is causing this, have you any issues with the other VM and GVT-g?

(Keep in mind these are all guesses...)

  • Thanks 1
Link to comment
2 minutes ago, ich777 said:

Thank you!

First of all remove that from your "go" file:


#Setup drivers for hardware transcoding
modprobe i915
chmod -R 777 /dev/dri

Since the plugin thake's care of that and even if you don't use the GVT-g plugin anymore I recommend to use the Intel GPU TOP plugin that also takes care of that end enables to install the GPU Statistics plugin from @b3rs3rk to see the utilization from your iGPU on the Unraid Dasboard (btw if you want to see the utilization you can install the Intel GPU TOP plugin along with the GVT-g plugin and then install the GPU Statistics plugin).

Oh now I saw that you already installed the plugins already... :D

 

Which mode have you selected for the VM? 4 or 8?

Eventually try to only use only one vGPU for your VM's for now for testing purposes...

 

It could also be the case that BlueIris or some other software inside the VM is causing this, have you any issues with the other VM and GVT-g?

(Keep in mind these are all guesses...)

 

Haha, the go file was remnants from trying to manually pass through the igpu before I found the gvtg plugin. I'll remove those!

I've currently selected 4 and it is the only VM using it. The other VM is an HMI that controls my septic system so there was no need to have igpu support on it. So unfortunately I can't isolate it to one system as the root cause.

Link to comment
7 minutes ago, STGMavrick said:

I've currently selected 4 and it is the only VM using it.

Eventually try to select 8 for testing purposes.

 

We can try to disable GuC and see if that helps (such freezes are mostly because of GuC), but I haven't built in an option to do that yet but please try first to select mode 8 and see if that helps.

  1. Shutdown the VM
  2. Go to the GVT-g Plugin page
  3. Delete the existing assignment
  4. Create a new assignment with mode 8
  5. Start the VM

 

Report back about your findings.

Link to comment
3 minutes ago, ich777 said:

Eventually try to select 8 for testing purposes.

 

We can try to disable GuC and see if that helps (such freezes are mostly because of GuC), but I haven't built in an option to do that yet but please try first to select mode 8 and see if that helps.

  1. Shutdown the VM
  2. Go to the GVT-g Plugin page
  3. Delete the existing assignment
  4. Create a new assignment with mode 8
  5. Start the VM

 

Report back about your findings.

 

Done and Done! I'm also keeping the log window open to let it collect more incase the server requires a force restart.

  • Like 1
Link to comment
1 minute ago, STGMavrick said:

Done and Done! I'm also keeping the log window open to let it collect more incase the server requires a force restart.

Nice thank you, I don't know when I have time to build the GuC Enable/Disable function into the plugin but we can also do that manually only requires one restart of Unraid.

 

Please keep me updated or write me short PM and we can edit the file for now manually that Enables/Disables GuC. :)

Link to comment
1 hour ago, ich777 said:

Nice thank you, I don't know when I have time to build the GuC Enable/Disable function into the plugin but we can also do that manually only requires one restart of Unraid.

 

Please keep me updated or write me short PM and we can edit the file for now manually that Enables/Disables GuC. :)

 

Will do!

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.