Project

General

Profile

Actions

Emulator Issues #13704

open

Dolphin Flatpak unable to use dGPU unless dGPU previously initialized

Added by dreamsyntax 2 days ago. Updated 2 days ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

This bug is exclusive to the Dolphin Flatpak. Native builds do not have this issue.
I've been encountering this issue on/off even while using unofficial flatpaks (the issue is not recent).
I could never figure out why the behavior was inconsistent, until today.

Until a different program accesses the dGPU the Dolphin Flatpak can't properly use the dGPU.

System Info:
CachyOS (Arch based Linux)
Intel iGPU & NVIDIA dGPU 4080 Mobile on Driver 565.77 in the officially recommended default 'hybrid' nvidia configuration.
Note I've reproduced this on various distros including Linux Mint, and with various nvidia driver versions. I don't think this behavior is unique to any particular configuration.

Reproduce Steps:

  1. Reboot the system - this way nothing is directly accessing the dGPU.
  2. Immediately launch Dolphin flatpak, let initialization etc finish
  3. Open Graphics Window, Choose Vulkan, and pick the dGPU (NVIDIA in this case)
  4. Close the Graphics Window
  5. Launch a game.
  6. "Failed to create Vulkan swap chain." and "Failed to initialize video backend!" will appear, then the emulation will stop.
  7. Repeat 5-6, Close Dolphin, Re-open etc. Always reproducible.

Mitigation Steps:
Launch a process that can use the dGPU (I launched Steam, then launched a game. Waited 10 seconds, then quit. Repeated steps 2-5. Now the flatpak can use the dGPU.
I confirmed this happens for both the flathub flatpak and the dolphin repo flatpaks.
Alternatively, you can even use native Dolphin while set to use the dGPU.

Video showing this bug and using native Dolphin to demonstrate the mitigation:
https://youtu.be/elIi0IoyzKs

Actions #1

Updated by dreamsyntax 2 days ago

Additional info:

Running nvidia-smi is not sufficient to resolve the issue.
Additionally, OBS capturing while set to encode with NVENC (verifiable with nvidia-smi) also does not resolve the issue.
So the gpu 'not being awake' is not the problem.

| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 2839 C /usr/bin/obs 433MiB |
+-----------------------------------------------------------------------------------------+

Dolphin Logs:

49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:648 I[Video]: Available extension: VK_GOOGLE_user_type
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:656 I[Video]: Enabling extension: VK_KHR_swapchain
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:656 I[Video]: Enabling extension: VK_EXT_memory_budget
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message: Failed to find vkGetDeviceProcAddr in layer "libVkLayer_MESA_device_select.so"
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message: vkCreateDevice layer callstack setup to:
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message:    <Application>
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message:      ||
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message:    <Loader>
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message:      ||
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message:    <Device>
49:06:737 VideoBackends/Vulkan/VulkanContext.cpp:877 I[Host GPU]: Vulkan debug message:        Using "NVIDIA GeForce RTX 4080 Laptop GPU" with driver: "libGLX_nvidia.so.0"
49:06:870 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (SelectPresentMode:237) vkGetPhysicalDeviceSurfaceFormatsKHR failed:  (-13: UNKNOWN_VK_RESULT)
49:06:870 VideoBackends/Vulkan/VKMain.cpp:220 E[MASTER]: Warning: Failed to create Vulkan swap chain.
49:09:372 Core/Core.cpp:583 E[MASTER]: Warning: Failed to initialize video backend!
49:10:423 Core/Core.cpp:566 I[CONSOLE]: Stop [Video Thread 0]    Shutting down HW
49:10:439 Core/HW/Memmap.cpp:357 I[MI]: Memory system shut down.
49:10:440 Core/Core.cpp:568 I[CONSOLE]: Stop [Video Thread 0]    HW shutdown
Actions

Also available in: Atom PDF