godotengine / godotengine/godot

`--gpu-index` is ineffective when using the Compatibility rendering method

Open
#87,763 2 comments 4 reactions 0 assignees View on GitHub
discussion topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in: 4.2.1.stable, 4.3.dev cae759949

### System information

Godot v4.3.dev (cae759949) - Fedora Linux 39 (KDE Plasma) - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4090 (nvidia; 545.29.06) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

### Issue description

`Engine.get_gpu_index()` isn't used in the `gl_manager_*` files, which means the `--gpu-index` command line argument is ignored when using the Compatibility rendering method.

This is because OpenGL doesn't offer as much control over GPU selection compared to Vulkan and Direct3D12.

@hpvb suggested we could implement support for `--gpu-index` when using EGL, but it probably can't be done when using GLX. In the meantime, we could print a warning when using `--gpu-index` with the Compatibility rendering method, but I don't know of a way to do this without having to modify *every* `gl_manager_*` file out there (since they don't inherit from a common class).

### Steps to reproduce

Start the project manager with `--gpu-index 0`, then `--gpu-index 1` and notice how the same GPU is always used, even on multi-GPU systems (or on systems with llvmpipe available).

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start by tracing Engine.get_gpu_index() and the gl_manager_* files used by the Compatibility renderer; compare how --gpu-index is handled in the Vulkan and Direct3D12 paths mentioned by the issue. Determine whether EGL can support selection and whether GLX cannot, then define and verify either the appropriate warning or support using --gpu-index 0 and 1 on a multi-GPU or llvmpipe system.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.