stride3d / stride3d/stride

discrete GPU is skipped on laptops (with optimus dual-graphics?)

Open
#707 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Graphics bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Release
Version: 4.0.0.1 beta2 0928
Platform(s): Windows

Describe the bug

On some laptops, Stride picks the slow integrated GPU even when there is a fast discrete GPU.

I believe this happens because on laptops with switchable graphics, only the "default" GPU has a display attached. Which is normally the integrated graphics. Stride checks for no display attached and skips that GPU in this code. Yet other game engines (in the user-report, Cryengine) still come up on the discrete GPU.

https://github.com/stride3d/stride/blob/273dfddd462fd3746569f833e1493700c070b14d/sources/engine/Stride.Games/GamePlatform.cs#L264-L269

I'll have to do more testing, but I think Stride should probably be using some method to get the default 3d device, instead of doing it's own picking algorithm based on the attached display. On D3D I believe this is to CreateDevice() with a D3DADAPTER_DEFAULT parameter. It could do this as part of the factory device enumeration, and then set some kind of default device flag in the enumerated device list.

To Reproduce
Steps to reproduce the behavior:

  1. Start Stride on a laptop with optimus style dual graphics, with the integrated graphics as default
  2. WITNESS: Stride starts on the integrated graphics GPU
  3. start some other heavy 3d application or game (Cryengine, Unreal, Blender)
  4. WITNESS: that other 3d app starts on the fast GPU

Expected behavior
Expected Stride to use the discrete GPU just like other games do.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sources/engine/Stride.Games/GamePlatform.cs at the linked lines that skip GPUs without an attached display. Reproduce on Windows with an Optimus-style laptop and inspect the factory's device enumeration and default-device selection. Done means Stride selects the discrete GPU in this setup instead of the integrated GPU.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.