Public bug reported:
[Impact]
On systems with NVIDIA Optimus (hybrid graphics), after using plasma-
optimus (or prime-select nvidia) to select the NVIDIA discrete GPU,
kwin_wayland continues to run on the integrated GPU rather than the
selected NVIDIA card.
This occurs because KWin on Wayland uses DRM to enumerate graphics
devices and defaults to the first card it finds, which is typically the
integrated GPU. It does not consult prime-select at all.
Users expect, when plasma-optimus selects the Nvidia gpu as prime, for
kwin_wayland to run on the discrete gpu. kwin_wayland respects the
KWIN_DRM_DEVICES environment variable to specify an ordered list of DRM
devices (/dev/dri/cardX:/dev/dri/cardY). This variable is not set by
anything in the session startup when prime-select is nvidia.
Fix: Install plasma-optimus-kwin-drm.sh, which is sourced by
startplasma-wayland before kwin_wayland is launched. The script detects
the NVIDIA and integrated card paths from sysfs PCI vendor IDs and
exports KWIN_DRM_DEVICES accordingly, but only when prime-select query
returns nvidia and the session type is Wayland.
[Test Case]
* Have a system with NVIDIA Optimus (hybrid Intel+NVIDIA or AMD+NVIDIA
graphics).
* Use plasma-optimus (or prime-select nvidia) to switch to the NVIDIA GPU and
reboot.
* Log into a Plasma Wayland session.
* Run prime-select query — it returns nvidia.
* Run cat /sys/class/drm/card*/device/vendor and note that the NVIDIA card
exists.
* Run kwin_wayland --version or check kwin_wayland's DRM device in use.
Expected behavior: After selecting the NVIDIA GPU via plasma-optimus,
kwin_wayland should use the NVIDIA card as its primary DRM device.
Actual behavior: kwin_wayland ignores the prime-select setting and
renders on the integrated GPU.
[What could go wrong]
The most likely real-world regression is on multi-GPU or AMD+NVIDIA
systems where vendor ID matching may not uniquely identify the intended
card. The fix for that, if it becomes necessary, would be to cross-
reference /sys/class/drm/cardN/device/subsystem_vendor or use nvidia-smi
--query-gpu=pci.bus_id to pin the exact device path. However, this is
unlikely.
** Affects: plasma-optimus (Ubuntu)
Importance: High
Assignee: Erich Eickmeyer (eeickmeyer)
Status: In Progress
** Affects: plasma-optimus (Ubuntu Resolute)
Importance: Medium
Assignee: Erich Eickmeyer (eeickmeyer)
Status: Fix Committed
** Affects: plasma-optimus (Ubuntu Stonking)
Importance: High
Assignee: Erich Eickmeyer (eeickmeyer)
Status: In Progress
** Also affects: plasma-optimus (Ubuntu Resolute)
Importance: Undecided
Status: New
** Also affects: plasma-optimus (Ubuntu Stonking)
Importance: High
Assignee: Erich Eickmeyer (eeickmeyer)
Status: In Progress
** Changed in: plasma-optimus (Ubuntu Resolute)
Status: New => In Progress
** Changed in: plasma-optimus (Ubuntu Resolute)
Importance: Undecided => High
** Changed in: plasma-optimus (Ubuntu Resolute)
Importance: High => Medium
** Changed in: plasma-optimus (Ubuntu Resolute)
Status: In Progress => Fix Committed
** Changed in: plasma-optimus (Ubuntu Resolute)
Assignee: (unassigned) => Erich Eickmeyer (eeickmeyer)
** Description changed:
[Impact]
On systems with NVIDIA Optimus (hybrid graphics), after using plasma-
optimus (or prime-select nvidia) to select the NVIDIA discrete GPU,
kwin_wayland continues to run on the integrated GPU rather than the
selected NVIDIA card.
This occurs because KWin on Wayland uses DRM to enumerate graphics
devices and defaults to the first card it finds, which is typically the
integrated GPU. It does not consult prime-select at all.
Users expect, when plasma-optimus selects the Nvidia gpu as prime, for
kwin_wayland to run on the discrete gpu. kwin_wayland respects the
KWIN_DRM_DEVICES environment variable to specify an ordered list of DRM
devices (/dev/dri/cardX:/dev/dri/cardY). This variable is not set by
anything in the session startup when prime-select is nvidia.
Fix: Install plasma-optimus-kwin-drm.sh, which is sourced by
startplasma-wayland before kwin_wayland is launched. The script detects
the NVIDIA and integrated card paths from sysfs PCI vendor IDs and
exports KWIN_DRM_DEVICES accordingly, but only when prime-select query
returns nvidia and the session type is Wayland.
[Test Case]
* Have a system with NVIDIA Optimus (hybrid Intel+NVIDIA or AMD+NVIDIA
graphics).
* Use plasma-optimus (or prime-select nvidia) to switch to the NVIDIA GPU and
reboot.
* Log into a Plasma Wayland session.
* Run prime-select query — it returns nvidia.
* Run cat /sys/class/drm/card*/device/vendor and note that the NVIDIA card
exists.
- * Run kwin_wayland --version or check kwin_wayland's DRM device in use — it
is the integrated GPU.
+ * Run kwin_wayland --version or check kwin_wayland's DRM device in use.
Expected behavior: After selecting the NVIDIA GPU via plasma-optimus,
kwin_wayland should use the NVIDIA card as its primary DRM device.
Actual behavior: kwin_wayland ignores the prime-select setting and
renders on the integrated GPU.
[What could go wrong]
The most likely real-world regression is on multi-GPU or AMD+NVIDIA
systems where vendor ID matching may not uniquely identify the intended
card. The fix for that, if it becomes necessary, would be to cross-
reference /sys/class/drm/cardN/device/subsystem_vendor or use nvidia-smi
--query-gpu=pci.bus_id to pin the exact device path. However, this is
unlikely.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2156191
Title:
[SRU] kwin_wayland does not use the NVIDIA GPU on Wayland when prime-
select is set to nvidia
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/plasma-optimus/+bug/2156191/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs