Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup exported app with high performance GPU on hybrid or optimus systems #113

Open
tebjan opened this issue Feb 1, 2022 · 1 comment
Labels
enhancement New feature or request VL.Stride Wrapper for 3d game engine Stride

Comments

@tebjan
Copy link
Member

tebjan commented Feb 1, 2022

Problem: Exported apps start with low-power GPU by default.

Some discussion here: stride3d/stride#707

Possible with DXGI >= 1.6 according to: https://stackoverflow.com/questions/55435230/how-to-ensure-directx-11-app-use-the-discrete-gpu-on-a-dual-gpu-laptop-with-c

But SharpDX only has up to DXGI 1.5: https://github.com/sharpdx/SharpDX/tree/master/Source/SharpDX.DXGI

So we have to wait for: stride3d/stride#1123
Or hack it in some other way...

Considerations:
The ideal way to solve this is with a registry entry for the exe. If the exe itself requests the high-performance GPU the end-user cannot change it in the windows setting anymore.

@tebjan tebjan added the enhancement New feature or request label Feb 1, 2022
@tebjan tebjan changed the title Startup with high performance GPU on hybrid or optimus systems Startup exported app with high performance GPU on hybrid or optimus systems Feb 2, 2022
@joreg
Copy link
Member

joreg commented Jul 8, 2022

arturo wrote:

there's a way to force the integrated gpu by exporting some symbols in the app binary. In c and other systems languages, it's as simple as defining a variable with a specific name and mark it as dllexport:

__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;

never used it in c# but looking a bit there's some related results: http://lucasmagder.com/blog/2014/05/exporting-data-symbols-in-c-for-nvidia-optimus/
The first line forces integrated nvidia and the second one integrated amd. They can be both enabled at once and it's not a problem if they are used when an integrated card is not present or if there's no iGPU.
What I don't think is it can be enabled or disabled at runtime like via a command line parameter since it's just symbols defined in the binary. But probably you want vvvv to run by default on the integrated card anyway and most probably this can be overridden by the setting in the nvidia control panel

@joreg joreg transferred this issue from vvvv/VL.Stride Mar 1, 2023
@joreg joreg added the VL.Stride Wrapper for 3d game engine Stride label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request VL.Stride Wrapper for 3d game engine Stride
Projects
None yet
Development

No branches or pull requests

2 participants