Bug 2049627

Summary: switcherooctl does nothing on el9
Product: Red Hat Enterprise Linux 9 Reporter: Olivier Fourdan <ofourdan>
Component: redhat-releaseAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: lisas, pzatko, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: redhat-release-9.0-2.13.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:35:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Olivier Fourdan 2022-02-02 13:31:12 UTC
Description of problem:

When using an hybrid graphics (Intel + NVIDIA) on a el9 laptop, it's impossible to spawn a client on the discrete GPU from GNOME Shell because there is no option in the menu.

Running "switcherooctl list" from terminal return nothing.

Version-Release number of selected component (if applicable):

switcheroo-control-2.4-4.el9

How reproducible:

Always

Steps to Reproduce:
1. Install the NVIDIA proprietary driver on an hybrid graphics system
2. Make sure the nvidia driver module is loaded
3. From GNOME Shell activities overview, right click on a X11 graphics application
4. Open a terminal
5. type "switcherooctl list"

Actual results:

No option to spawn the client on the distrte GPU in the GNOME Shell menu,
"switcherooctl list" returns nothing

Expected results:

An option to spawn the client on the distrete GPU in the GNOME Shell menu,
"switcherooctl list" lists the GPUs available (or at the very least one)

Additional info:

The issue is the same on Xorg and Wayland.

I can run glxgears on the discrete GPU by setting the envvars "__NV_PRIME_RENDER_OFFLOAD=1" and "__GLX_VENDOR_LIBRARY_NAME=nvidia" prior to run glxgears or glxinfo so the issue is with switcheroo-control most likely.

Comment 1 Olivier Fourdan 2022-02-02 13:46:24 UTC
Note, if I stop the service and run switcheroo-control manually as root then it works:

  $ sudo systemctl stop switcheroo-control.service
  $ sudo /usr/libecxec/switcheroo-control

So possibly something wrong with the DBus or Systemd setup in the package.

Comment 2 Olivier Fourdan 2022-02-02 15:28:52 UTC
Looks like it's just a matter of the service not being enabled:

[ofourdan@centos-stream-9 ~]$ switcherooctl list
[ofourdan@centos-stream-9 ~]$ systemctl status switcheroo-control.service
○ switcheroo-control.service - Switcheroo Control Proxy service
     Loaded: loaded (/usr/lib/systemd/system/switcheroo-control.service; disabled; vendor preset: disabled)
     Active: inactive (dead)
[ofourdan@centos-stream-9 ~]$ sudo systemctl enable switcheroo-control.service
Created symlink /etc/systemd/system/graphical.target.wants/switcheroo-control.service → /usr/lib/systemd/system/switcheroo-control.service.
[ofourdan@centos-stream-9 ~]$ switcherooctl list
[ofourdan@centos-stream-9 ~]$ systemctl status switcheroo-control.service
○ switcheroo-control.service - Switcheroo Control Proxy service
     Loaded: loaded (/usr/lib/systemd/system/switcheroo-control.service; enabled; vendor preset: disabled)
     Active: inactive (dead)
[ofourdan@centos-stream-9 ~]$ sudo systemctl start switcheroo-control.service
[ofourdan@centos-stream-9 ~]$ systemctl status switcheroo-control.service
● switcheroo-control.service - Switcheroo Control Proxy service
     Loaded: loaded (/usr/lib/systemd/system/switcheroo-control.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2022-02-02 16:23:25 CET; 2s ago
   Main PID: 3174 (switcheroo-cont)
      Tasks: 4 (limit: 98111)
     Memory: 1.0M
        CPU: 12ms
     CGroup: /system.slice/switcheroo-control.service
             └─3174 /usr/libexec/switcheroo-control

Feb 02 16:23:24 centos-stream-9 systemd[1]: Starting Switcheroo Control Proxy service...
Feb 02 16:23:25 centos-stream-9 systemd[1]: Started Switcheroo Control Proxy service.
[ofourdan@centos-stream-9 ~]$ switcherooctl list
Device: 0
  Name:        Intel® UHD Graphics
  Default:     yes
  Environment: DRI_PRIME=pci-0000_00_02_0

Device: 1
  Name:        NVIDIA Corporation TU106GLM [Quadro RTX 3000 Mobile / Max-Q]
  Default:     no
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1
[ofourdan@centos-stream-9 ~]$ 

And once enabled, it works after a reboot.

Comment 3 Bastien Nocera 2022-02-02 15:37:25 UTC
This is a repeat of:
https://bugzilla.redhat.com/show_bug.cgi?id=2000134#c10
so reassigning.

Comment 5 Petr Zatko 2022-02-04 09:55:36 UTC
╭─[pzatko@Inn][~/Tmp]
╰─> rpm2cpio redhat-release-9.0-2.13.el9.x86_64.rpm | cpio -dimv
.....
./usr/lib/systemd/system-preset/85-display-manager.preset
./usr/lib/systemd/system-preset/90-default.preset
./usr/lib/systemd/system-preset/99-default-disable.preset
./usr/lib/systemd/user-preset/90-default-user.preset
./usr/lib/systemd/user-preset/99-default-disable.preset
./usr/share/doc/redhat-release/GPL
./usr/share/doc/redhat-release/GPL-source-offer
121 blocks


╭─[pzatko@Inn][~/Tmp]
╰─> grep switcheroo-control ./usr/lib/systemd/system-preset/90-default.preset
enable switcheroo-control.service

Verified: Tested

Comment 11 errata-xmlrpc 2022-05-17 15:35:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: redhat-release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3893