I have an Electron app and I'm trying to figure out if there's a way to programmatically force OS to run it on high-performance (discrete) GPU instead of the integrated GPU.
Is there a CLI command / hack that can force OS to do this (similarly to how games automatically run on discrete GPU)?
I found this thread, but I'm not sure how to apply it for Node.js:
// Enable dedicated graphics for NVIDIA:
extern "C"
{
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
}
// Enable dedicated graphics for AMD Radeon:
extern "C"
{
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}