<p dir="auto">Obviously I could export the app to an executable every time I make a change, then use Windows settings to force that executable to use the GPU I want to be used, but that would be extremely tedious. Is there some way through Electron I can force my dedicated GPU to be used rather than the CPU integrated graphics?</p>
<ul dir="auto">
<li>Electron version: 1.7.3</li>
<li>Operating system: macOS 10.12.5</li>
</ul>
<h3 dir="auto">Problem</h3>
<p dir="auto"><a href="https://github.com/sindresorhus/caprine">My app</a> uses the discrete GPU constantly which has a negative impact on battery life (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="237866759" data-permission-text="Title is private" data-url="https://github.com/sindresorhus/caprine/issues/238" data-hovercard-type="issue" data-hovercard-url="/sindresorhus/caprine/issues/238/hovercard" href="https://github.com/sindresorhus/caprine/issues/238">sindresorhus/caprine#238</a>). I would like to be able to force my app to only use the integrated GPU if available. Chrome has a flag for this: <code class="notranslate">--force_discrete_gpu=0</code>. This is different from the <code class="notranslate">app.disableHardwareAcceleration()</code> method as I don't want to disable hardware acceleration, just use the more power efficient GPU.</p>
<h3 dir="auto">Solution</h3>
<p dir="auto">Support it with <code class="notranslate">app.commandLine.appendSwitch()</code> or as a separate method <code class="notranslate">app.forceIntegratedGPU()</code>.</p>