Using r.GraphicsAdapter inside Unreal Engine doesn't do anything

Someone knows how the console parameter r.GraphicsAdapter inside Unreal engine works ?

Repro

  • Open Unreal Engine 4.27
  • Open any Project
  • Open Window / Developer Tools / Output Log
  • Enter r.GraphicsAdapter=1
  • Press Enter
  • Nothing happens and Unreal still uses the wrong GPU
  • Enter r.GraphicsAdapter=0
  • Press Enter
  • Nothing happens and Unreal still uses the wrong GPU
  • Enter r.GraphicsAdapter=2
  • Press Enter
  • Nothing happens and Unreal still uses the wrong GPU
  • Enter r.GraphicsAdapter=3
  • Press Enter
  • Nothing happens and Unreal still uses the wrong GPU
  • Enter r.GraphicsAdapter=4
  • Press Enter
  • Nothing happens and Unreal still uses the wrong GPU
  • Execute r.GraphicsAdapter shows r.GraphicsAdapter = “-1” LastSetBy: Constructor
  • Execute r.GraphicsAdapter=1
  • Execute r.GraphicsAdapter shows again r.GraphicsAdapter = “-1” LastSetBy: Constructor

Seems setting r.GraphicsAdapter inside Unreal doesn’t do anything at all. Someone knows why and how to fix that ?

The only location I could find inside all Unreal Manuals is here nDisplay Configuration File Reference | Unreal Engine Documentation

And there is as less description as possible.

It needs to be set before the engine starts, i.e. either through command line parameters or default engine files. Once set in the default engine, you need to restart the game for it to work correctly.
However, in 4.27 it is bugged and doesn’t work, which is pretty major.

still bugged in 5.0.3, you see the change reflected on the output log inside the editor, but the engine still uses the wrong gpu

1 Like

This will work if placed in BaseEngine.ini (in your Engine/Config folder). This will make the change global for all projects opened in that Engine version on that PC.

You can put it in WindowsEngine.ini and it will only affect instances of the Editor opened on Windows PC’s.

You can alternatively put it in DefaultEngine.ini (in your Project/Config folder) to make it stick only to that project.

NOTE: In my tests, trying to switch GPU’s when they have SLI/NVLink enabled will technically work, but you’ll get warnings that your hardware doesn’t support DX12/SM6, so it actually doesn’t work.