If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Hardware acceleration in Windows VM on ESXi

sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass
edited January 17 in Tips, Tricks & How-Tos

Hi there,

I wasn't able to find an existing discussion and I'm not sure if it belongs right here in "Windows" but I decided to write it down here, because it's matching my environment.

I read the article about hardware acceleration and noted that this feature isn't possible in virtual machines due to not exposing "low-level video hardware to the guest operating system".

My PMS is running on a Windows Server 2012 R2 virtual machine on ESXi 6.0 and I do have a Intel Quick Sync compatible CPU (Xeon E3-1225 v5).

  1. I configured DirectPath I/O for the integrated Intel HD Graphics P530 in ESXi and rebooted the hypervisor. This mandatory for configuring a PCI passthrough.

  1. After that I added a "new" PCI-device (obviosly, the Intel HD Graphics P530) to this vm.

Additional tasks were to let Windows Update find and install a driver and enabling hardware acceleration in Plex configuration.

Correct me if I'm totally wrong here or this is just a "cosmetic" bug, but...
According to the "Now Playing Tab", hw acceleration is working inside of a virtual machine and it would be the same procedure with AMD or NVIDIA GPUs, I suppose.

edit:

Best Answer

«1

Answers

  • OttoKernerOttoKerner Posts: 30,229Members, Plex Pass, Plex Ninja Plex Ninja

    Your screenshot only shows that the encoding is done in hardware.
    The decoding of the MPEG2 stream is done in software.

    I'd verify with a H.264 video (8 bit color) to see if (hw) appears for both.

    Are you running Plex as a system service?

    Got help? Help others too - by reporting back with your results!
    Have you checked the Documentation before posting a question in the forums?
    Use the SEARCH function before starting a new thread!
    No PMs unless requested, please! Do not use 'verbose' logging
  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    Like this?

    No, it's not running as system service.

  • drinehartdrinehart Posts: 1,241Members, Plex Pass Plex Pass

    I wonder, do you have a monitor hooked up to it? You might need to put an hdmi dummy plug (CompuLab makes some - search Amazon for compulab 4k display emulator for an exampe) in your onboard hdmi out, assuming your server has that. But as mentioned, with pcie passthrough, hardware acceleration can work in a virtualized environment.

  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    There is no monitor hooked up, I don't need any output from the ESXi, just network connection.
    The server is a Dell Poweredge T30 and has an onboard HDMI out, but when plugged to a monitor you will see the ESXi booting until the passthrough is "loaded" and it will freeze. After booting up the vm there is still no video signal, but as I mentioned, this doesn't matter for me.

    I hope this is will answer your question. If you thought it will show the output of the vm...i thought so too, but that could be a behavior of the Intel HD Graphics, I don't know that for sure.

  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    @OttoKerner said:

    @sp4rt4n-i17 said:
    Like this?

    Perfect, that proves that both decoding and encoding are performed in hardware.

    Great, then maybe this should be added to the article, as this could help someone else.

  • AmazingRando24AmazingRando24 Posts: 1,068Members, Plex Pass Plex Pass

    Forgive the freshman question, but is there an advantage here? I mean, the work is still on the processor in the virtual environment. It's just tricked into thinking the hardware/QuickSync is there to support it, no? I'm not sure you gain any actual ground, do you?

    PMS Server: Intel i7-6700 16gb RAM Dedicated Windows 10 PC
    DVR Lineup: Dual HDHomeRun Extend Tuners
    NAS: Drobo 5n2-15tb / Drobo B800fs 24tb

    "It's amazing what replacing one faulty network cable will do for your Plex performance!"

  • drinehartdrinehart Posts: 1,241Members, Plex Pass Plex Pass

    @AmazingRando24 - why do you assume the work is still done on the CPU? If OP has successfully passed the GPU to the VM and the software is indicating hardware encode and decode, it is being done on the GPU, not the CPU. It appears to be working exactly as it should.

  • AmazingRando24AmazingRando24 Posts: 1,068Members, Plex Pass Plex Pass

    @drinehart said:
    @AmazingRando24 - why do you assume the work is still done on the CPU? If OP has successfully passed the GPU to the VM and the software is indicating hardware encode and decode, it is being done on the GPU, not the CPU. It appears to be working exactly as it should.

    I assumed virtual GPU. My bad. Makes perfect sense if it's physical.

    PMS Server: Intel i7-6700 16gb RAM Dedicated Windows 10 PC
    DVR Lineup: Dual HDHomeRun Extend Tuners
    NAS: Drobo 5n2-15tb / Drobo B800fs 24tb

    "It's amazing what replacing one faulty network cable will do for your Plex performance!"

  • Eds89Eds89 Posts: 47Members, Plex Pass Plex Pass

    I'm looking to rebuild my Plex server as an ESXi VM, and passthrough a GTX 760 to it to take advantage of hardware acceleration.

    Will this same process likely also work when passing through a GTX 760 in the same way?
    My CPU is an E5-2618l V2 which doesn't have an onboard GPU, so not sure if this will prevent hardware acceleration from working on the dedicated GPU as well?

  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    Sorry for the delay. There's no need for an onboard/on-sock GPU, as the feature used is Intel VT-d, which simply stands for PCI-passthrough. So should work the same way, as according to Intel ARK your CPU is supporting Intel VT-d. Just make sure to configure PCI passthrough under advanced hardware settings of ESXi and do a reboot, after that you can passthrough your GPU to the VM.
    Source: https://ark.intel.com/en/products/75788/Intel-Xeon-Processor-E5-2618L-v2-15M-Cache-2_00-GHz

  • Eds89Eds89 Posts: 47Members, Plex Pass Plex Pass

    No worries. Thanks for the reply.

    Yes passthrough should be ok, was just worried that not having the on die GPU was going to be an issue.

    My understanding is that software transcoding is still "better" in most scenarios, but given this is a VM with a reduced number of cores, and isn't the fastest in the world, it makes sense in my mind to give it a GPU to reduce load on the CPU.

    I tried 4k transcodes on this CPU before even with 12 cores assigned to my Plex VM, and it hated it. I am hoping the 760 will do a marginally better job of that, although I still suspect it will struggle haha.

  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    A VM is nearly as powerful as a native PC/server would be with the same hardware, there isn't a real downside except of real hw access in some special cases (like this one here).
    I wonder, is your hardware backing 12 "real" cores (no HT) for a vm and how many VMs are running? Because the more vCPUs isn't always the better.

    Please share your afforts with the 760 with us!

    Btw I was running pms a long time with only one vCPU, just changed my hw recently and increased to 2 vCPUs. However, I never tried any 4k videos in pms.

  • Eds89Eds89 Posts: 47Members, Plex Pass Plex Pass

    Generally I run the VM with 4 vCPUs, as the physical CPU is 6 cores with hyper threading (12 logical).
    It's slow though, at 2Ghz, which is where I suspect a lot of the problem comes from.

    Yes, appreciate over provisioning can introduce vwait time for CPU, so will monkey with the vCPU assignment slightly to see what the optimum is. I only have 3 other Windows 2016 VMs running, but nothing particularly high use.

    Yes will do. Got some new parts coming soon, so should be able to test and feedback.

    Cheers
    Eds

  • Eds89Eds89 Posts: 47Members, Plex Pass Plex Pass

    I've gotten my VM setup with a GTX 760 passed through, and now need to determine a way to test this out. How did you do this spartan?

    I have an H.264 video and am streaming to a Chrome player on the LAN, and forcing a lower video quality, but the activity still shows direct play.
    Does it only work to certain devices and is there some other way I can forcibly test this?

  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    You can just use the Plex app for android and start a video. When started, configure conversion.
    Let's say your video is 1080, configure 720 when playing, it should start to transcode and then you'll be able to check this in your Plex web interface.

  • Eds89Eds89 Posts: 47Members, Plex Pass Plex Pass

    Looks like it was working, the now playing UI just didn't update that quickly:

    What is the expected behaviour when it comes to audio? Doesn't look like that is being done on HW for some reason. Should I expect it to?

  • sp4rt4ni17sp4rt4ni17 Posts: 10Members, Plex Pass Plex Pass

    Thank you for the update.
    But I don't know about audio transcoding... just guessing it doesn't take up that much cpu performance and will be done in software.

  • Eds89Eds89 Posts: 47Members, Plex Pass Plex Pass

    I would be inclined to agree.

    Have you tried any 4K content? I have tried the Elysium 4K sample file, which when trying to direct play pins the VM CPU at 100% and it really struggles to buffer and play it.
    If I force conversion, it tries to buffer, but the player just quits out of the stream with no errors.

  • LatticeLattice Posts: 47Members, Plex Pass Plex Pass

    Have an older e3 here. HD accel works in Windows native, but in the esxi host it doesn't seem to. Device has a warning 'Windows has stopped this device because it has reported problems. (Code 43)' .

    In esxi the device is listed as 'Xeon E3-1200 v3 Processor Integrated Graphics Controller''.

    Anything missing?

«1
Sign In or Register to comment.