Easy-GPU-PV icon indicating copy to clipboard operation
Easy-GPU-PV copied to clipboard

HEVC FOR VR

Open ya-boop opened this issue 2 years ago • 7 comments

hevc is not available in VM right now if use easy-gpu-pv script. there is a workaround for that, but it kinda not user-friendly. https://forum.level1techs.com/t/2-gamers-1-gpu-with-hyper-v-gpu-p-gpu-partitioning-finally-made-possible-with-hyperv/172234/92?page=9

The most popular streaming app, Virtual Desktop doesn’t access NVENC API directly, but rather through Microsoft Media Foundation. Since we copied GPU driver to the VM manually, we will also need to register NVENC MFT dlls to Media Foundation. There is a proper way to do it (MFTRegister function in mfapi.h) to do it, but I ended up just copy the following registry values from host: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MediaFoundation\Transforms\Categories\f79eac7d-e545-4387-bdee-d647d7bde42a\60F44560-5A20-4857-BFEF-D29773CB8040 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MediaFoundation\Transforms\Categories\f79eac7d-e545-4387-bdee-d647d7bde42a\966F107C-8EA2-425D-B822-E4A71BEF01D7 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\MediaFoundation\Transforms\Categories\f79eac7d-e545-4387-bdee-d647d7bde42a\60F44560-5A20-4857-BFEF-D29773CB8040 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\MediaFoundation\Transforms\Categories\f79eac7d-e545-4387-bdee-d647d7bde42a\966F107C-8EA2-425D-B822-E4A71BEF01D7 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MediaFoundation\Transforms\60F44560-5A20-4857-BFEF-D29773CB8040 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MediaFoundation\Transforms\966F107C-8EA2-425D-B822-E4A71BEF01D7 HKEY_CLASSES_ROOT\WOW6432Node\MediaFoundation\Transforms\60F44560-5A20-4857-BFEF-D29773CB8040 HKEY_CLASSES_ROOT\WOW6432Node\MediaFoundation\Transforms\966F107C-8EA2-425D-B822-E4A71BEF01D7 These have to also be copied but changing the path of the DLLs in InProcServer32 from C:\WINDOWS\System32\DriverStore\FileRepository... to C:\Windows\System32\HostDriverStore\FileRepository... as per step 2 in the instruction HKEY_CLASSES_ROOT\CLSID{60F44560-5A20-4857-BFEF-D29773CB8040} HKEY_CLASSES_ROOT\CLSID{966F107C-8EA2-425D-B822-E4A71BEF01D7} HKEY_CLASSES_ROOT\WOW6432Node\CLSID{60F44560-5A20-4857-BFEF-D29773CB8040}

ya-boop avatar May 28 '23 14:05 ya-boop

I tried this, the mftenum tool shows hevc as registered but when trying to connect with a vr headset using the hevc codec in virtual desktop vr, the host bluescreens every time

iamrizzle avatar Oct 24 '23 16:10 iamrizzle

if your end goal is to use the VM for playing VR games like me, then I was able to work around the problem by using ALVR (instead of using Virtual Desktop Streamer, since that didn't work)

(they mentioned this in the original post you linked. however i admit that it took me a couple of passes to actually understand what they said)

Oculus AirLink and ALVR both just works. The only problem is SteamVR is not rendering any menu, not sure why. The most popular streaming app, Virtual Desktop, however, doesn’t access NVENC API directly, but rather through Microsoft Media Foundation.

ericytsang avatar Apr 02 '24 06:04 ericytsang

@iamrizzle @ericytsang did you ever figure out how to fix the BSOD's?

I also keep getting REFERENCE_BY_POINTER BSOD's.

sschamp avatar Apr 30 '24 09:04 sschamp

That's the same BSOD as me.

I never figured it out. For me, it only BSOD when I shut down Steam VR on the VM after a VR headset was connected to it, so i just avoided doing that until I'm finished playing games....

However there was one time where it BSOD when i shut down a game on the VM (i don't remember which one)

ericytsang avatar Apr 30 '24 14:04 ericytsang

Simple workaround:

Force your Virtual Desktop to use H.264 (or H.264+) Encoding.

But I am continuing to look into fixing HEVC.

sschamp avatar Apr 30 '24 20:04 sschamp

Update, Windows 11 24H2 Insider Preview (Dev channel) with latest NVIDIA drivers use WDDM 3.2 instead of WDDM 3.1 Which fixes many of these memory issues.

sschamp avatar Jun 13 '24 11:06 sschamp

I also currently have this issue with the bluescreen (REFERENCE_BY_POINTER) on my host my machine. But only when i click the "Restart SteamVR" Button in ALVR or close SteamVR after i connect with ALVR.

Unfortunately changing to H264 (default on alvr) or HEVC didnt change anything :(

I also have to figure first out how to get an stream on my Quest 3. Either i get a green screen on my Quest 3 if connected via cable(using enhanced session) or i get an black screen when connected wireless.

awakeonlan avatar Jul 08 '24 19:07 awakeonlan