X Tutup
Skip to content

[Windows] Try reading GPU driver information directly from registry.#109346

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
bruvzg:win_drv_chk
Sep 16, 2025
Merged

[Windows] Try reading GPU driver information directly from registry.#109346
Repiteo merged 1 commit intogodotengine:masterfrom
bruvzg:win_drv_chk

Conversation

@bruvzg
Copy link
Member

@bruvzg bruvzg commented Aug 6, 2025

Fixes #109317

Reading registry is significantly faster (200-700 usec) than WMI (700000-1900000 usec). It returns the same value on all systems I have tested (NVIDIA and AMD GPUs), and might be more reliable (returns reasonable results on Wine, while WMI doesn't).

@bruvzg bruvzg added this to the 4.6 milestone Aug 6, 2025
@bruvzg bruvzg requested a review from a team as a code owner August 6, 2025 05:08
@bruvzg bruvzg added enhancement platform:windows topic:platforms cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Aug 6, 2025
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally on wine-staging 10.12 using the MRP linked in #109344, it works as expected. Code looks good to me.

Before

The line in the middle is a WINE debug print showing an error.

Getting driver information...
02c0:err:ole:com_get_class_object apartment not initialised
Driver: <null> <null>

After

Getting driver information...
Driver: NVIDIA GeForce RTX 5090 32.0.15.6094

It works with llvmpipe too (--gpu-index 1):

Getting driver information...
Driver: llvmpipe (LLVM 20.1.6, 256 bits) 31.0.10.1000

@adamscott
Copy link
Member

I wonder if this should be considered fixing a bug and be merged for 4.5

@bruvzg
Copy link
Member Author

bruvzg commented Aug 6, 2025

I wonder if this should be considered fixing a bug and be merged for 4.5

Maybe, my only concern it is not tested on a lot of hardware, but there's still fallback to the old code, so it's probably OK.

@clayjohn
Copy link
Member

clayjohn commented Aug 6, 2025

I wonder if this should be considered fixing a bug and be merged for 4.5

Maybe, my only concern it is not tested on a lot of hardware, but there's still fallback to the old code, so it's probably OK.

I agree, it would be nice to get more testing with this. If we are very happy with it, we can always cherry pick for 4.5.1

@Repiteo Repiteo merged commit 5316d12 into godotengine:master Sep 16, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Sep 16, 2025

Thanks!

@Repiteo
Copy link
Contributor

Repiteo commented Sep 16, 2025

Cherry-picked to 4.5

@Repiteo Repiteo removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Sep 16, 2025
@Repiteo
Copy link
Contributor

Repiteo commented Sep 16, 2025

Cherry-picked to 4.4

@Repiteo Repiteo removed the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_video_adapter_driver_info is extremely slow

5 participants

X Tutup