Open bl4ckb0ne opened 2 days ago
There's currently no way to override this behaviour.
There might be actually.
You can try to run Godot with DRI_PRIME=0
. It sounds like on your system the Intel GPU is DRI_PRIME=0
while the AMD one is DRI_PRIME=1
, which is counter to the usual "0 is integrated, 1 is discrete" understanding of this setting. If that doesn't work, I think DRI_PRIME
also supports passing the full PCI ID as an argument.
Another option is to force using Vulkan instead of OpenGL (GL is the default for the project manager), by running Godot with --rendering-driver vulkan
. When using Vulkan, you can then further specify which GPU to use with --gpu-index <number>
, and that number should be the GPU id you can find with vulkaninfo
, or running Godot with --rendering-driver vulkan --verbose
, which should print "Devices:" with a list of supported devices.
As for the problem, the Linux platform when using OpenGL has some heuristics in the detect_prime
method to find out what GPUs are available and rate their likely "priority" for gaming purposes. Up until now a setup with an Intel discrete GPU that's more powerful/relevant than an integrated GPU was unheard of, so this code systematically rates Intel lower than AMD and Nvidia. Sounds like this needs to be reviewed.
https://github.com/godotengine/godot/blob/master/platform/linuxbsd/x11/detect_prime_x11.cpp#L68-L78
DRI_PRIME=0
helped, but I get an error in a shader now, seems unrelated to this and more related to XR since this is an XR project.
--rendering-driver vulkan
renders something! It looks like it picks the Intel GPU by default. without requiring the gpu index.
The heuristic for OpenGL could definitely use an upgrade indeed.
Thanks for your quick answer
Tested versions
Found using
Godot_v4.3-stable_linux.x86_64
but I still see the issue in masterSystem information
Debian trixie (6.11.4-1), Godot 4.3
Issue description
On my system with 2 GPUs (Intel dGPU and AMD iGPU), Godot will prefer the AMD GPU over the Intel GPU based on the priority from the
vendor_map
here 1. My iGPU is not connected to anything, so Godot fails to create a surface to render to and crashes.There's currently no way to override this behaviour.
Steps to reproduce
-v
argumentMinimal reproduction project (MRP)
I've only tested with a single project but I'm sure this would occur on any project.