Can’t support Vulkan?
Tired of typing -opengl4 every time you want to open UE4.25?
Don’t want to edit -opengl4 into the generated desktop files so you can launch it without the terminal?
Want to be able to launch directly from the project?
You’re in luck! There’s a very simple way to enable OpenGL while disabling Vulkan.

Chances are, you’re here becuase you’re getting the error message;

Trying to force OpenGL RHI but the project does not have it in TargetedRHIs list.

So how do I enable OpenGL?

You just need to uncomment one line in the BaseEngine.ini file located here:

Engine/Config/BaseEngine.ini

Then search for, and uncomment the line

+TargetedRHIs=GLSL_430

At the time of me writing this, this can be found on line 2191.

You’ll now be able to launch Unreal by using the -opengl4 argument. But what if you don’t want to include the argument? That’s simple! You just comment this line above it:

+TargetedRHIs=SF_VULKAN_SM5

As the comment directly above it states:

When neither -vulkan nor -opengl4 are passed on the commandline, the engine will default to the first targeted RHI.

By default, the first targeted RHI is Vulkan.

After the edits, the Linux Target Settings in your BaseEngine.ini should look like this:

[/Script/LinuxTargetPlatform.LinuxTargetSettings]
; When neither -vulkan nor -opengl4 are passed on the commandline, the engine will default to the first targeted RHI.
; +TargetedRHIs=SF_VULKAN_SM5

; OpenGL4 is deprecated, you can comment this back in to add it to your targeted RHI list
+TargetedRHIs=GLSL_430

Congrats! Unreal can now be launched without the -opengl4 argument.

You will be met with a new warning message every time you launch. Just click “Ok” and Unreal will continue launching. It may be worth getting a new computer soon though as I doubt UE5 will support OpenGL.

If you’re reading this then you’ve probably already compiled the source for Unreal but if you haven’t, you can do that here: Compiling Unreal Engine 4 from source on Windows and Linux.