DarthAffe / ScreenCapture.NET

Fast and easy to use screen-capturing
GNU Lesser General Public License v2.1
68 stars 12 forks source link

Crashes if I set the application to use a specific GPU #27

Open SouljaVR opened 9 months ago

SouljaVR commented 9 months ago

Hi,

Thank you for your work, it has been quite useful. However I have one small issue with it. For some reason if I set my application to use a specific GPU in the Windows 11 settings (Graphics settings > Browse > Add application to the list then set it to use a non-primary GPU) it will crash. This is the error I get:

Exception thrown: 'SharpGen.Runtime.SharpGenException' in SharpGen.Runtime
Exception thrown: 'System.NullReferenceException' in SharpGen.Runtime
Object reference not set to an instance of an object.

Extracted embedded document "/_/src/Vortice.Direct3D11/obj/SharpGen-dlpP0O1fxIg71ru7toZjEspM3SEWycxI33HTG2U0-wg/SharpGen.Bindings.g.cs" to "C:\Users\redacted\AppData\Local\Temp\.vsdbgsrc\b59c979149b9e423f798cdf58884ed5deffddeab2a0edf36fe51751a9333ed2c\SharpGen.Bindings.g.cs"

I am using a 4090 as the primary GPU and 3060 as the secondary, so both should be fully compatible with this. I am able to set 99% of applications I work with to any GPU without any issues so I assume this is just a bug of some kind. I have a feeling that when I set the application to use the second GPU, it still tries to access the first one causing it to crash or something. Honestly not sure. But to my understanding I cant specify which GPU to use within the API itself. I hope this all makes sense anyway, thank you once again for your work.