Dedicated GPU

1. Introduction

Many laptops come with 2 graphics cards (GPUs):

  1. a slower one, that consumes less battery,

  2. and a "dedicated" GPU consuming more battery but more powerful. It is faster, esp. with non-trivial 3D data.

Our editor and your applications automatically use the "dedicated" GPU.

Note
There’s generally no need to do anything for new projects to activate this. Project DPR / LPR file will contain appropriate code automatically. To make sure this is active, and follows our template, use the engine editor menu item "Code → Regenerate Project".

2. Disable using dedicated GPU

Applications created using our engine will automatically use dedicated GPU by default on Windows, as this is a much better default for games. However you can choose to disable it, and let system choose the default GPU (which may or may not be the faster one).

To do this, compile the project with CASTLE_NO_FORCE_DEDICATED_GPU symbol defined. We recommend to define it in CastleEngineManifest.xml, like this:

...
  <compiler_options>
    <defines>
      <define>CASTLE_NO_FORCE_DEDICATED_GPU</define>
    </defines>
  </compiler_options>

To update Lazarus LPI with new symbol, be sure to use "Code → Regenerate Project" menu item in CGE editor (otherwise compiling from Lazarus IDE would not use the new symbol).

Warning

The mechanism to request dedicated GPU only works on Windows. We’re not aware of a way to request dedicated GPU on other systems.

Users can request using dedicated GPU on their side. E.g. in GNOME 3 (Linux, FreeBSD etc.), you can right-click on the application and select "Run with Dedicated Graphics Card". You can also use prime-run command line tool if provided.


To improve this documentation just edit this page and create a pull request to cge-www repository.