本文介绍了如何在electron.js中强制使用离散GPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
更新:我还看到了文档和讨论,它必须始终使用离散GPU,但不是,此刻它始终使用内部GPU。
Update: I also saw documentation and discussions that it must always use discrete GPU but it is not, it always use internal one at the moment.
我需要如果有集成和离散的情况,请在electron.js应用程序中使用离散的GPU,如何在Electron中强制使用它?
I need to use discrete GPU in electron.js app in case there are integrated and discrete, how to force it in Electron?
在c ++中可以这样做:
In c++ it can be done like that:
extern "C"
{
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
如何在electron.js中做到这一点?
How to do that in electron.js?
推荐答案
对于当前的Electron.js / WebGL,没有任何机制可以强制执行此操作。但是,您不需要这样做,因为默认情况下在离散GPU上运行。
With current Electron.js/WebGL, there is no mechanism to enforce this. However, you shouldn't need to, because running on the discrete GPU is the default.
这篇关于如何在electron.js中强制使用离散GPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!