# Explicitly choosing which GPU to use

**URL:** <https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698>\
**Category:** Community & Industry Discussion\
**Tags:** gpu, settings, unreal-engine, UE4, question\
**Created:** [October 30, 2018, 1:15pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698 "2018-10-30T13:15:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanenkoa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanenkoa](https://forums.unrealengine.com/u/yanenkoa)\
**Post date:** [October 30, 2018, 1:15pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/1 "2018-10-30T13:15:38Z")

</div>

Basically I have a system with several dedicated NVIDIA graphics cards (not integraded-dedicated GPU setup for laptops), and I want to be able to tell Unreal which one to use on an per-launch basis. That means that I don’t want to change NVIDIA settings each time I want an app to run on a different GPU, and I definitely don’t want to go to BIOS. Is there any way to do this? I’ve seen games on other engines having an ability to choose GPU in their in-game settings, but none of them were running on any version of UE.

---

<div class="post-metadata">

**Author:** ![yanenkoa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanenkoa](https://forums.unrealengine.com/u/yanenkoa)\
**Post date:** [November 2, 2018, 10:45am UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/2 "2018-11-02T10:45:58Z")

</div>

Turns out, there is a console variable for that — `r.GraphicsAdapter`, set in `Engine.ini` or `DefaultEngine.ini` when in editor.

---

<div class="post-metadata">

**Author:** ![naikrovek\_work](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@naikrovek\_work](https://forums.unrealengine.com/u/naikrovek_work)\
**Post date:** [June 4, 2019, 6:16pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/3 "2019-06-04T18:16:30Z")

</div>

It would be nice if there were a way to specify the GPU to use at launch via the command line. Is that possible?

---

<div class="post-metadata">

**Author:** ![Punitiate](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Punitiate](https://forums.unrealengine.com/u/Punitiate)\
**Post date:** [June 6, 2019, 2:17am UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/4 "2019-06-06T02:17:19Z")

</div>

Hmm I’ve only seen -preferintel and -prefernvidia as command-line options (To switch between integrated and dedicated). But I haven’t gone deep into the code.

---

<div class="post-metadata">

**Author:** ![qhaas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@qhaas](https://forums.unrealengine.com/u/qhaas)\
**Post date:** [July 2, 2019, 12:51pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/5 "2019-07-02T12:51:31Z")

</div>

It would be quite handy to have a way to set this at runtime via command-line arguments or environment variable without having to edit an INI file for scripting purposes, especially in Linux.

EDIT: looks like adding `r.GraphicsAdapter=2` to CarlaUE4/Saved/Config/LinuxNoEditor/Engine.ini has no impact, CARLA (UE4 powered) is still running on GPU 0 on my Ubuntu 16.04 machine

EDIT 2: Other users are reporting the [r.GraphicsAdapter](https://forums.unrealengine.com/community/general-discussion/4068-multiple-graphics-adapters-related-to-4-1-qfe-very-low-fps-rendering?3905-Multiple-Graphics-Adapters-(related-to-4-1-QFE-very-low-fps-rendering)=) setting not working, tried it in ConsoleVariables.ini as well.

---

<div class="post-metadata">

**Author:** ![608Visuals](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@608Visuals](https://forums.unrealengine.com/u/608Visuals)\
**Post date:** [April 26, 2022, 8:55am UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/6 "2022-04-26T08:55:37Z")

</div>

I figured out how to select a specific gpu in UE5!!

![CleanShot 2022-04-26 at 00.31.15](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/b/b6be07acc83c6a5ad2675d30a44d3b462fb3380e.gif)

---

<div class="post-metadata">

**Author:** ![shaqualeek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@shaqualeek](https://forums.unrealengine.com/u/shaqualeek)\
**Post date:** [January 16, 2023, 6:44pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/7 "2023-01-16T18:44:02Z")

</div>

This is working only on a mac if I’m not mistaken ☹  
Does anyone have luck on win? I have 2 nvidias - old and new and I am not able to use the new one, since it is not the primary system GPU.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Slonopotamus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slonopotamus](https://forums.unrealengine.com/u/Slonopotamus)\
**Post date:** [June 5, 2023, 6:49pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/8 "2023-06-05T18:49:54Z")

</div>

[https://github.com/EpicGames/UnrealEngine/blob/5.2.0-release/Engine/Source/Runtime/VulkanRHI/Private/VulkanRHI.cpp#L612](https://github.com/EpicGames/UnrealEngine/blob/5.2.0-release/Engine/Source/Runtime/VulkanRHI/Private/VulkanRHI.cpp#L612)

Just do `-graphicsadapter=<number>` in commandline args.

---

<div class="post-metadata">

**Author:** ![uwu.ultr7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uwu.ultr7a](https://forums.unrealengine.com/u/uwu.ultr7a)\
**Post date:** [December 22, 2023, 11:36pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/9 "2023-12-22T23:36:12Z")

</div>

This answer changed my life!!  
Despite all 3 of my GPUs supporting Vulkan, I would get an error “could not find a compatible vulkan device that supports surface presentation”.

Specifying the third (external) gpu (index no. 2) was a miracle cure, and a miracle diet. I’ve lost 50lbs, and I have a new lease on life now.

---

<div class="post-metadata">

**Author:** ![YaroslavSol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YaroslavSol](https://forums.unrealengine.com/u/YaroslavSol)\
**Post date:** [February 23, 2024, 3:52pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/10 "2024-02-23T15:52:20Z")

</div>

That will not work on ubuntu, there’s no such plugin

 ![Screenshot from 2024-02-23 12-46-10](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/9/ab9629eb594c8f79170aeb1ba422537265e8d288.jpeg)

---

<div class="post-metadata">

**Author:** ![CauseOfBSOD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CauseOfBSOD](https://forums.unrealengine.com/u/CauseOfBSOD)\
**Post date:** [April 5, 2024, 6:58pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/11 "2024-04-05T18:58:02Z")

</div>

Can you use the DRI\_PRIME environment variable for the same effect? If the game is outputting over vulkan, you should be able to use DRI\_PRIME=n! to only expose graphics adapter n to the game.

---

<div class="post-metadata">

**Author:** ![CaptainMurder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CaptainMurder](https://forums.unrealengine.com/u/CaptainMurder)\
**Post date:** [November 19, 2025, 7:44pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/12 "2025-11-19T19:44:26Z")

</div>

I found old threads about this subject with varying degrees of success and relevancy. You _cannot_ set this variable in console cmdline arguments (e.g. `UnrealEditor.exe -ExecCmds="..."`), it is read-only once the engine starts.

For completeness, the files are

Project/Config/DefaultEngine.ini or Engine/Config/BaseEngine.ini

Add:

```auto
[SystemSettings]
r.GraphicsAdapter=0

```

or =1, 2, 3, etc.

Sources

[https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-console-variables-reference](https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-console-variables-reference)

[Console Variables C++ in Unreal Engine | Unreal Engine 5.7 Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/console-variables-cplusplus-in-unreal-engine#loadingconsolevariables)

---

<div class="post-metadata">

**Author:** ![McKraska](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@McKraska](https://forums.unrealengine.com/u/McKraska)\
**Post date:** [December 15, 2025, 3:58pm UTC](https://forums.unrealengine.com/t/explicitly-choosing-which-gpu-to-use/436698/13 "2025-12-15T15:58:48Z")

</div>

Could it be that this only works in 5.7 ? I’ve tried this, but it always only utilises the GPU that is being used for Display, on start-up of Unreal. ( Using 5.4 )

Possibly one has to add an extra line somewhere else ?
