Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRI_PRIME is not Respected in NVidia Hybrid Setup #3464

Open
autumnontape opened this issue Feb 10, 2023 · 0 comments
Open

DRI_PRIME is not Respected in NVidia Hybrid Setup #3464

autumnontape opened this issue Feb 10, 2023 · 0 comments
Labels
api: vulkan Issues with Vulkan platform: wayland Issues with integration with linux/wayland platform: x11 Issues with integration with linux/x11 type: enhancement New feature or request

Comments

@autumnontape
Copy link

Description
My Linux PC has an integrated GPU and a discrete GPU. The discrete GPU drives the monitor, and the compositor runs on it. If I have Vulkan drivers installed for both and don't set any environment variables, initialize_adapter_from_env_or_default selects the integrated GPU.

Repro steps
On a device with integrated and discrete GPUs, plug the monitor into the discrete GPU and configure it in your BIOS as the boot GPU, leaving the integrated GPU enabled. Install Vulkan drivers for both GPUs. Run one of the wgpu examples and check which adapter it uses.

Expected vs observed behavior
It selects the integrated GPU, regardless of DRI_PRIME. I would expect it to choose the first physical device from vkEnumeratePhysicalDevices, which is normally "the one used by Wayland/Xorg or the one connected to a display."

I would make the case that this should be the behavior when a low power preference is requested, too. A discrete GPU will probably be powered on anyway if the compositor is using it, and choosing the integrated GPU in this case will cause the framebuffer to be copied to the discrete GPU every frame. I'd be interested to hear other opinions on that, though. (This would mean the integrated GPU would never be selected by default, which is what I would prefer. The only reason I have a Vulkan driver installed for it is so I can test applications on both devices.)

Platform
OS: Arch Linux
wgpu commit: 5b8c55c
Integrated and discrete GPUs both use Mesa drivers.

@teoxoy teoxoy added type: enhancement New feature or request api: vulkan Issues with Vulkan labels Feb 21, 2023
@teoxoy teoxoy added this to the WebGPU Specification V1 milestone Feb 24, 2023
@cwfitzgerald cwfitzgerald changed the title Too eager to choose an integrated GPU over a discrete GPU DRI_PRIME is not Respected in NVidia Hybrid Setup Apr 29, 2024
@cwfitzgerald cwfitzgerald added platform: x11 Issues with integration with linux/x11 platform: wayland Issues with integration with linux/wayland labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vulkan Issues with Vulkan platform: wayland Issues with integration with linux/wayland platform: x11 Issues with integration with linux/x11 type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants