Vulkan: do not replace hardware GPU with software renderer#781
Open
IgorAlexey wants to merge 3 commits intoDiligentGraphics:masterfrom
Open
Vulkan: do not replace hardware GPU with software renderer#781IgorAlexey wants to merge 3 commits intoDiligentGraphics:masterfrom
IgorAlexey wants to merge 3 commits intoDiligentGraphics:masterfrom
Conversation
When no discrete GPU is present, SelectPhysicalDevice iterates all physical devices and keeps overwriting SelectedPhysicalDevice without breaking, because the break only fires for VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU. On Linux with Mesa, a CPU-type software renderer (llvmpipe) is always enumerated alongside the real hardware device. On a system with only an integrated GPU the loop would iterate past the iGPU, land on llvmpipe as the last entry, and silently return it as the selected device—making the application run entirely on software rendering with no warning. Fix this by skipping CPU-type devices when a hardware device has already been selected. A CPU-type device is still accepted as a last resort when no hardware GPU is found at all, so the fallback behavior is preserved. Tested on an Intel Core Ultra 7 258V (Lunar Lake, Arc 130V/140V iGPU) running Fedora 43 with Mesa 25.3.6.
Contributor
|
I am thinking, maybe make it even more reliable by prioritizing SOFTWARE < INTEGRATED < DISCRETE |
Author
I agree, makes things more predictable |
Author
|
Is this good? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When no discrete GPU is present, SelectPhysicalDevice iterates all physical devices and keeps overwriting SelectedPhysicalDevice without breaking, because the break only fires for VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU.
On Linux with Mesa, a CPU-type software renderer (llvmpipe) is always enumerated alongside the real hardware device. On a system with only an integrated GPU the loop would iterate past the iGPU, land on llvmpipe as the last entry, and silently return it as the selected device, making the application run entirely on software rendering with no warning.
Fix this by skipping CPU-type devices when a hardware device has already been selected. A CPU-type device is still accepted as a last resort when no hardware GPU is found at all, so the fallback behavior is preserved.
Tested on an Intel Core Ultra 7 258V (Lunar Lake, Arc 130V/140V iGPU) running Fedora 43 with Mesa 25.3.6.