Log in

View Full Version : MPC-HC + madVR HDR passthrough doesn't work when using dGPU


mpchelp10
11th August 2019, 03:54
MPC-HC 1.8.7
madVR - not sure which version but I installed via K-Lite Codec Pack
Windows 10 Laptop with 4k HDR (fake HDR, 8+2) screen
iGPU: Intel HD 630
dGPU: GTX 1050TI with Max-Q
NVIDIA settings shows that my laptop's screen is physically connected to iGPU

Files I am playing:
-Your name in 4K HDR
-Sony 4k HDR sword demo (https://4kmedia.org/sony-swordsmith-hdr-uhd-4k-demo/)

LAV settings: DXVA2 - Intel HD 630, no option (greyed out) to use NVIDIA dGPU
MadVR settings: Passthrough HDR to display, send HDR metadata to display

With these settings, I can "see the HDR" on both files. Your name more or less plays fine, but the Sony sword demo will visibly lag or be "slow".

When I try to get MPC-HC to use my GPU, I lose the HDR colors. I tried the following:
1. DXVA2 (native) + NVIDIA Control Panel Program Settings > MPC-HC > High-performance NVIDIA processor. After this, DXVA2 shows that it is using the dGPU
2. Change DXVA2 (native) to NVIDIA CUVID
Both of these options result in MPC-HC no longer showing "HDR colors".

How do I fix this?

clsid
11th August 2019, 16:00
You need to use DXVA2 copy-back. The HDR metadata isn't extracted when using CUVID.

mpchelp10
12th August 2019, 06:26
You need to use DXVA2 copy-back. The HDR metadata isn't extracted when using CUVID.
DXVA2 copy-back shows the HDR but my FPS for the sony uhd hdr demo file drops to 2-3 frames per second (as shown in MPC-HC).
Forcing MPC-HC to use my dGPU using NVIDIA Control Panel causes the HDR to "not be shown".

clsid
12th August 2019, 14:51
Then let madVR do the tone mapping instead of using HDR passthrough.

mpchelp10
12th August 2019, 17:15
Then let madVR do the tone mapping instead of using HDR passthrough.


DXVA2 native with iGPU & hdr passthrough
DXVA2 copy-back with iGPU & hdr passthrough

These two show the "full" HDR. The colors are really bright and intense.


DXVA2 native with dGPU & "let madVR decide tone mapping"
DXVA2 copy-back with dGPU & "let madVR decide tone mapping"

These two show "normal" colors, similar to what I'd see on a SDR screen.


CUVID
DXVA2 native with dGPU & hdr passthrough
DXVA2 copy-back with dGPU & hdr passthrough

These two show extremely washed out colors, not accurate at all.


It seems that setting the decoder to D3D11 and forcing MPC-HC to use my dGPU results in "full" HDR, but the performance of the D3D11 decoder + dGPU is comparable to DXVA2 + iGPU. Any idea on what to do? I'd like to use some of the scaling algorithms in madVR but my iGPU isn't strong enough to run any of them without severe stuttering or lag. (I don't want to lose HDR)

chros
13th August 2019, 09:57
It seems that setting the decoder to D3D11 and forcing MPC-HC to use my dGPU results in "full" HDR, but the performance of the D3D11 decoder + dGPU is comparable to DXVA2 + iGPU.
Are you talking about DXVA2 copyback or native?
https://forum.doom9.org/showthread.php?t=176642

mpchelp10
14th August 2019, 07:21
Are you talking about DXVA2 copyback or native?
https://forum.doom9.org/showthread.php?t=176642
Both DXVA2 copyback and DXVA2 native do not display HDR colors when I force MPC-HC to use my NVIDIA dGPU.

clsid
14th August 2019, 14:52
You may need to manually turn on HDR mode in the Windows settings.

Normally madVR does this automatically. But in case of a NVIDIA GPU it uses the NVIDIA API to do so instead of using OS API. I suspect this isn't working correctly on Optimus systems.

Trouble with Optimus is that the output of the dGPU flows through the iGPU which is connected to the screen. So both drivers also have to work together, which means more chance of bugs.

littleD
14th August 2019, 18:05
Hello mpchelp10.

You must have nvidia optimus. I have already tested this system, cause i own a laptop too.
Nvidia dGPU have not dxva capabilities to video decode. Just to present video. Well, i have only mjpeg dxva entry when testing nvidia by dxva checker application. But that is with laptop screen. I bet, there is only one video output connector, which is controlled by iGPU, so i dont think connecting to external display matters at all.

That way forget to force using NVIDIA by control panel because you dont use it anyway for hardware video decoding. If that is different for external screen, it would be nice to prove it.

Madvr may be bit too hard for iGPU. Depend on how much video resolution differs from display resolution. Bigger resolution change means more scaling methods involved hence more power needed.

DXVA2 Copy back mode is also killing for iGpu.

So, to operate correctly, install newest intel drivers. This is very important, with every new version drivers have HDR support improvements.
Also use newest klite if possible for max compatibility (its about lav filters).

D3d11 mode improved lately. It has better HDR support in windows system, as in dx11 mode operates Movies and TV application and whole other win10 stuff now.

Try for now remove "high performance" profile for mpchc from nvidia control panel. Or launch manually mpc-HC with internal GPU (default). Use right click on icon. In case missing menu, enable it in nvidia cpanel options. It is useful.

I use following setting to play files with mpc and madvr:
- launch player with iGPU
- enable in lavfilters d3d11 automatic
- enable in madvr>>rendering>>general settings option: use direct3d 11 for presentation
- you may also enable use separate device.... setting for performance. Also use faster scaling algorithms, even dxva scaling. People say its not so bad for intel
- use other option as suggested like transfer hdr to display or so..

Unfortunately, enabling dxva2 cb or d3d11 copy back (by choosing you gpu in lav filters) makes playback slooow on iGPU.

Even if you manage by options (i spend some time to get into it) to use iGPu for video decode and dGPu as gerenal procesing device like for madvr scaling, then it still gonna be slow due to bandwidth saturating or something similar can happen. Clsid said it in previous post.

So to make your iGPu well performant, have to stick to native in lav filters. My HDR samples play saturated on screen. I presume it will go same with external device.

Asmodian
14th August 2019, 19:55
Also use newest klite if possible for max compatibility (its about lav filters).

Why not simply install the newest LAV filters? No need for codec packs. :p

clsid
14th August 2019, 21:17
Doing manual installs is a waste of time :p
It isn't easier or better.

Asmodian
15th August 2019, 01:20
I always got messed up conflicting installs if I ever tried to update a single component of the pack. Perhaps klite has gotten better but there are only a few things I need and want to be able to update as soon as a fix/feature I am interested in is available without waiting for the pack to update.

Anyway, it is easy to get the newest LAV from the LAV thread. Why suggest a pack if all you want is the current version of LAV filters?

littleD
15th August 2019, 05:56
I always got messed up conflicting installs if I ever tried to update a single component of the pack. Perhaps klite has gotten better but there are only a few things I need and want to be able to update as soon as a fix/feature I am interested in is available without waiting for the pack to update.

Anyway, it is easy to get the newest LAV from the LAV thread. Why suggest a pack if all you want is the current version of LAV filters?I see noone was persuading to use codeckpacks. Original poster already use klite and that is probaly he/she already know its magnificence.:)

mpchelp10
15th August 2019, 06:45
You may need to manually turn on HDR mode in the Windows settings.

Normally madVR does this automatically. But in case of a NVIDIA GPU it uses the NVIDIA API to do so instead of using OS API. I suspect this isn't working correctly on Optimus systems.

Trouble with Optimus is that the output of the dGPU flows through the iGPU which is connected to the screen. So both drivers also have to work together, which means more chance of bugs.
I don't think I have an option to turn on HDR in Windows. The panel on my laptop isn't a "true 10bit panel", it is using Dolby Vision or something to achieve a "8+2 bit" depth or something.

Hello mpchelp10...
I will try updating to latest intel drivers.
D3D11 mode works great with Your name UHD 4k but the Sony UHD file has extremely low performance (<10fps) on D3D11 mode.
I am also on the latest MPC-HC, LAV, and madVR.

I see noone was persuading to use codeckpacks. Original poster already use klite and that is probaly he/she already know its magnificence.:)
I screwed up madvr settings and didn't see a reset option so I deleted everything and installed MPC-HC, LAV, and madVR manually.

chros
15th August 2019, 08:42
You must have nvidia optimus. I have already tested this system, cause i own a laptop too.
Nvidia dGPU have not dxva capabilities to video decode. Just to present video.
...
That way forget to force using NVIDIA by control panel because you dont use it anyway for hardware video decoding. If that is different for external screen, it would be nice to prove it.

That is *not* true: I used optimus for years (MSI GE60-0NC (https://www.msi.com/Laptop/GE60_0NC/Specification)) and if you set dgpu for mpc-hc/be then lav and madvr *will* use the nvidia card for decoding and processing. Just fire up GPU-Z or nvidiainspector and you'll see :)

D3D11 mode works great with Your name UHD 4k but the Sony UHD file has extremely low performance (<10fps) on D3D11 mode.

D3D11 native is the most efficient (https://forum.doom9.org/showthread.php?p=1878815#post1878815) and issue-free mode, so stick to it.
The Sony demo is 60 fps while the other is 23 fps :) So, that's normal.

I screwed up madvr settings and didn't see a reset option so I deleted everything and installed MPC-HC, LAV, and madVR manually.

There's a reset to default batch file in madvr directory.

clsid
15th August 2019, 15:17
You can also reset settings of madVR with Codec Tweak Tool.

mpchelp10
16th August 2019, 03:30
I tried disabling iGPU completely in BIOS. When I played a HDR file, my screen went grayscale haha
I assume at this point my two choices are DXVA2 native with my iGPU or D3D11 with my dGPU if I want HDR passthrough. Unfortunately neither are great in terms of performance.

D3D11 native is the most efficient (https://forum.doom9.org/showthread.php?p=1878815#post1878815) and issue-free mode, so stick to it.
The Sony demo is 60 fps while the other is 23 fps :) So, that's normal.
DXVA2 native with iGPU gives better performance on the Sony demo than D3D11 with dGPU. Is this normal?

There's a reset to default batch file in madvr directory.
You can also reset settings of madVR with Codec Tweak Tool.
Installing madVR with KLite doesn't have the defaults.bat file.

littleD
16th August 2019, 06:09
DXVA2 native with iGPU gives better performance on the Sony demo than D3D11 with dGPU. Is this normal? Yes, It may be normal in one case. When dGPU cannot hardware decode cause of lacking dxva interface.
Please download dxva checkcer from here (https://onedrive.live.com/download?resid=8473139A4F3F636D!419&authkey=!AHmnxAnJHZ1zkDU) run it, then change at the bottom of the firts tab your GPU to nvidia. Then make a screenshot of first tab and show us. If it lacks entries then its not decoding capable.
Other explanation is saturating bandwidth, when for decoding are used both gpus somehow. Of course used to different tasks but simultanously.

For iGPU try dx11 Install very latest Intel drivers. Drivers are crucial. Only latest driver version improve dx11 path and makes high resolution files decoding somehow possible, at least on my laptop. Before, dxva2 native was fastest. Now fastest is dx11 automatic. Something changed in drivers.

mpchelp10
19th August 2019, 05:32
Yes, It may be normal in one case. When dGPU cannot hardware decode cause of lacking dxva interface.
Please download dxva checkcer from here (https://onedrive.live.com/download?resid=8473139A4F3F636D!419&authkey=!AHmnxAnJHZ1zkDU) run it, then change at the bottom of the firts tab your GPU to nvidia. Then make a screenshot of first tab and show us. If it lacks entries then its not decoding capable.
Other explanation is saturating bandwidth, when for decoding are used both gpus somehow. Of course used to different tasks but simultanously.

For iGPU try dx11 Install very latest Intel drivers. Drivers are crucial. Only latest driver version improve dx11 path and makes high resolution files decoding somehow possible, at least on my laptop. Before, dxva2 native was fastest. Now fastest is dx11 automatic. Something changed in drivers.
iGPU: https://i.imgur.com/lWBFMbc.png
dGPU: https://i.imgur.com/42ecHD7.png
Unfortunately I cannot install the latest Intel HD graphics drivers as it is "disallowed" by my laptop manufacturer. When I check for updates using my laptop manufacturer's update utility it says there are no updates.

littleD
20th August 2019, 06:32
Thanks for sharing screenshot. I was partially wrong about optimus implementation and dxva. Because, its depends on system chipset and drivers how it works. Your nvidia screenshot shows only dx11. So now You know why dxva2 is slow. It may even automatically fallback do dxva2 to iGPU. Additionally, in first post you wrote you would not see option in lav decoder for dxva for nvidia.
It would be also nice to check second tab "Processor device" of Nvidia if it have dx11 capabilities existing. Yoy can also open videos on DS/MF decoder tab to test decoding speed and playback speed (benchmarks) which gives you much data to understand.
Its a pity you cannot update drivers. Try on manufacturer site for actualization. Or maybe manual tricks but i dont know how system would react. How about Nvidia?
Well, you may once again choose dx11 nvidia in lav filters, and launch MPC-HC with nvidia context and see in some gpu tools like gpuz the video decoding usage, and other metrics. There is somewhere bootleneck. I believe for iGPU madvr advanced algoritms might be too heavy so try enabling even dxva scaling in madvr just for test on iGPU if that helps.