itsmikethetech / Virtual-Display-Driver

Add virtual monitors to your windows 10/11 device! Works with VR, OBS, Sunshine, and/or any desktop sharing software.
1.94k stars 89 forks source link

Add support for picking render adapter #96

Closed Sajidur78 closed 1 month ago

Sajidur78 commented 1 month ago

This PR adds support for selecting the render adapter through a file located at C:\IddSampleDriver\adapter.txt. The feature is useful for devices with multiple GPUs (ie. laptops).

The behaviour is pretty straightforward. If the adapter specified is not found then it behaves the same way as it did before and leaves it up to the OS to select an adapter. And likewise if the running version of Windows doesn't support the API call.

Sample file: adapter.txt

ChimeraReyat commented 1 month ago

You're a lifesaver dude 🙏 This is EXACTLY what I needed on my Acer Predator, which has a very capable GPU letting me play a decent amount of games that support HDR out and could handle streaming them fine, but unfortunately the default behavior of this driver forced the adapter to be my igpu which doesn't support HEVC encoding. Now it works like a charm!!

Highly recommend this get merged ASAP, I checked around and quite a few people with laptop GPUs were hoping to use this for HDR streaming but were unable to. I did manage to stream HDR before this PR by disabling my igpu driver, which isn't ideal cuz that forced my nvidia to render both screens or i had to force the main monitor to not display anything. Plus I wasn't able to control the backlight of the monitor anymore. Glad I don't have to do that anymore!

zjoasan commented 1 month ago

First of all, a big thank you for your time, I've just started looking into it...

Sample file:

After looking at it, how would I rewrite it for another card, is it the friendly name of the gpu? What if you have multiples of the same card in the machine, how would you be able to chose which? Why isn't the file in the pr too? or commented on how to create it, since it's no part of the pr.

On a separate issue, there is a reference to a .bin file, which is missing in the pr too, or explanation of whet is in that binary file (I'm guessing a EDID file, but still not a complete pr?)

Sajidur78 commented 1 month ago

It's just the friendly name of the adapter as it seemed easier to use during configuration. Using Vendor ID and Device ID would probably be better for more specific selection. Maybe we can go with that instead?

Sajidur78 commented 1 month ago

As for multiple cards of the same model, I think Windows puts a number at the end of the adapter name to distinguish them if it sees same name. So the name method is probably fine.

zjoasan commented 1 month ago

Thanks for a quick reply, just wanted to make sure. We will be discussing internally, since I bet this is going to trigger a internal rush to get a new release with a good card solution out. Again thank you for this work.

Ps. Was I right about the .bin being a backup edid?

itsmikethetech commented 1 month ago

As for multiple cards of the same model, I think Windows puts a number at the end of the adapter name to distinguish them if it sees same name. So the name method is probably fine.

Thanks for your work on this! Testing and pushing ASAP. :)

Sajidur78 commented 1 month ago

The code with the bin reference is unused. It just gets written for me to verify if the OS picks the correct adapter haha. It's a binary dump of the DXGI_ADAPTER_DESC structure.

itsmikethetech commented 1 month ago

This has been highly requested. Huge thanks for this one. People are going to be very excited. Once it's out, I'll make an update video and post with credit and such showing the functionality you've added. :)

bud3699 commented 1 month ago

I can test the multiple gpu with the same gpu if needed. I dont mind. Although we definitely might need a different solution to selecting the render device. Its hard to do it without the companion app. Although if we set it with vendor and device id it may not be as easy for the unexperienced