Plex hardware HEVC decoding not working with Quicksync (Multiple Graphics Adapters)

Wow, amazing find. I am having the same problem, I can encode with hw but not decode. My setup is different, though. I have a Windows 10 virtual machine running on Proxmox and I pass the intel GPU of my Xeon E3-1245 v6 through. PMS is not running as a service, obviously, as hardware decoding wouldn’t work otherwise.
Would you share your wrapper with a short tutorial, please?

Edit: I solved my issue by disabling the virtual graphics card provided by proxmox, so that hw decoding is done with the intel gpu. still, some people may be interested in your wrapper (I would love to see it as a coding exercise!)