Summary: | Discrete graphics card not detected for dual-DPU setup with no /sys/kernel/debug/vgaswitcheroo/switch file on disk | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | yuri6037 |
Component: | general | Assignee: | David Edmundson <kde> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dave, deadlion.a.k, kdelibs-bugs, me, natalie_clarius, nate, nicolas.fella, plasma-bugs, putr4.s, xaver.hugl |
Priority: | NOR | ||
Version: | 5.86.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kio/-/commit/d270ba449fd59d374637a64a4ba4bf11d8ac9b10 | Version Fixed In: | 5.109 |
Sentry Crash Report: |
Description
yuri6037
2022-01-24 22:06:40 UTC
Looks like the code in KIO does a Solid DBus call to determine the presence or absence of a discrete GPU. Can you run `qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement hasDualGpu` in a terminal window and paste the output? If it says, "false", then the issue is either in Solid, or deeper down the stack. If it says true, the issue in KIO. Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! Hello, Sorry for the really late answer, I didn't see your message before. I still have the computer however I no longer use PopOS 21.10 but instead I use Kubuntu. I'll check if Kubuntu have the exact same issue and I'll try checking this qdbus command this weekend as I currently have no access to the proper hardware. Thanks in advance Hi, I have just tried again on the same hardware but with Kubuntu and I still have the same problem the GPU options are still missing from "Edit Application">Application>"Advanced Options". The new OS configuration is as follows: Operating System: Kubuntu 22.04 KDE Plasma Version: 5.24.7 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 Kernel Version: 6.2.6-76060206-generic (64-bit) Graphics Platform: X11 Output of qdbus: yuri@yuri-oryp7:~$ qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement hasDualGpu false Output of nvidia-smi: yuri@yuri-oryp7:~$ nvidia-smi Sat May 13 14:51:10 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.105.17 Driver Version: 525.105.17 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A | | N/A 36C P3 N/A / 55W | 5MiB / 6144MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 1527 G /usr/lib/xorg/Xorg 4MiB | +-----------------------------------------------------------------------------+ Update: If this file: https://invent.kde.org/plasma/powerdevil/-/blob/master/daemon/backends/upower/discretegpuhelper.cpp is still up to date and used in the current version of KDE then it's normal it can't work because there is no vgaswitcheroo on my system, what this software should do instead is lspci, "lsmod | grep nvidia_modeset" or check the existance of "nvidia-smi" and if nvidia_modeset is present it should run apps on the dGPU by setting 2 environment variables before running the target software: "__NV_PRIME_RENDER_OFFLOAD=1" and "__GLX_VENDOR_LIBRARY_NAME=nvidia" Nice find! It sounds like we should be checking multiple conditions here; not only should we look for /sys/kernel/debug/vgaswitcheroo/switch, but also something else, maybe what you said. *** Bug 464423 has been marked as a duplicate of this bug. *** It looks like gnome checks this by asking switcheroo-control over dbus[0], and switcheroo-control reads the cards from udev[1]. Then for launching with the selected GPU, it uses environment variables chosen by switcheroo-control[2], rather than just setting DRI_PRIME like KDE does. [0] https://github.com/GNOME/gnome-shell/blob/dec26b7da2ee61641eac8909d0fc2a9f8985216d/js/ui/appMenu.js#L163 [1] https://gitlab.freedesktop.org/hadess/switcheroo-control/-/blob/master/src/switcheroo-control.c [2] https://github.com/GNOME/gnome-shell/blob/dec26b7da2ee61641eac8909d0fc2a9f8985216d/src/shell-app.c#L1342 On my Intel/Nvidia box I can see that switcheroo-control's dbus service can indeed see my GPUs, as well as how to select each one: $ gdbus call --system --dest net.hadess.SwitcherooControl --object-path /net/hadess/SwitcherooControl --method org.freedesktop.DBus.Properties.Get net.hadess.SwitcherooControl HasDualGpu (<true>,) $ gdbus call --system --dest net.hadess.SwitcherooControl --object-path /net/hadess/SwitcherooControl --method org.freedesktop.DBus.Properties.Get net.hadess.SwitcherooControl GPUs (<[{'Name': <'NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q]'>, 'Environment': <['__GLX_VENDOR_LIBRARY_NAME', 'nvidia', '__NV_PRIME_RENDER_OFFLOAD', '1']>, 'Default': <false>}, {'Name': <'IntelĀ® UHD Graphics 630'>, 'Environment': <['DRI_PRIME', 'pci-0000_00_02_0']>, 'Default': <true>}]>,) A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/195 A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1330 Nate Graham do you think you could help me find someone to review? Thank you very much for that. I will do so today. Let's follow up in the merge request's comments section. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1332 Git commit c13421078014035d290650c4db850fad83a819ba by Nicolas Fella, on behalf of Dave Vasilevsky. Committed on 12/07/2023 at 00:12. Pushed by nicolasfella into branch 'master'. Use switcheroo-control to find discrete GPUs Previously, we only asked powerdevil, and it did not work on Nvidia GPUs. M +7 -0 CMakeLists.txt A +13 -0 cmake/FindSwitcherooControl.cmake M +1 -0 src/gui/CMakeLists.txt A +119 -0 src/gui/gpudetection.cpp [License: LGPL(v3.0) LGPL(v2.0)] A +28 -0 src/gui/gpudetection_p.h [License: LGPL(v3.0) LGPL(v2.0)] M +13 -22 src/gui/kprocessrunner.cpp M +5 -27 src/widgets/kpropertiesdialog.cpp https://invent.kde.org/frameworks/kio/-/commit/c13421078014035d290650c4db850fad83a819ba Git commit d270ba449fd59d374637a64a4ba4bf11d8ac9b10 by Nicolas Fella, on behalf of Dave Vasilevsky. Committed on 12/07/2023 at 00:40. Pushed by nicolasfella into branch 'kf5'. Use switcheroo-control to find discrete GPUs Previously, we only asked powerdevil, and it did not work on Nvidia GPUs. (cherry picked from commit c13421078014035d290650c4db850fad83a819ba) M +7 -0 CMakeLists.txt A +13 -0 cmake/FindSwitcherooControl.cmake M +1 -0 src/gui/CMakeLists.txt A +119 -0 src/gui/gpudetection.cpp [License: LGPL(v3.0) LGPL(v2.0)] A +28 -0 src/gui/gpudetection_p.h [License: LGPL(v3.0) LGPL(v2.0)] M +13 -22 src/gui/kprocessrunner.cpp M +5 -27 src/widgets/kpropertiesdialog.cpp https://invent.kde.org/frameworks/kio/-/commit/d270ba449fd59d374637a64a4ba4bf11d8ac9b10 |