No keyboard input after switching to suse-prime-bbswitch

Tumbleweed (dup performed on 15/3)

My laptop is an MSI GS73VR 7RG with dual graphics (GTX 1070 & Intel 630).

I installed bbswitch so I could select which card to use, and all was well. Then I decided to change to suse-prime-bbswitch, which informed me that I had to remove suse-prime.

I accepted that but on reboot I am now not able to enter my home partition encryption password, or even switch to a console. The keyboard works in the Grub2 menus, but after that there is no response. I tried a multitude of options to boot to single user mode, none of which worked and I ended up booting a read-only recovery thing and the keyboard works.

I believe it has something to do with the keyboard still being assigned to the old xorg.conf file (…or whatever the modern equivalent is).

My question is: which file do I need to edit to restore my keyboard’s functionality?

I managed to boot to single user mode by adding init=/bin/sh to the linux line and I get to a working shell prompt.

I decided that I need to uninstall the following packages:
bbswitch
suse-prime-bbswitch

…but the filesystem is in RO mode.

I’m now trying to learn how to switch to RW mode.

To remount 7 as RW: boot to single user mode (…by adding init=/bin/sh to the end of the linux line) and run: mount -0 remount,rw /

I removed bbswitch & suse-prime-bbswitch - and it’s all back to normal now.

I wrote all this so I had a log of what I did, and also maybe to help another lost soul with the same problem.

If the Devs wish to delete this entire thread - I have no objections ;).

Hi
Does the system recognize both cards as providers?


xrandr --listproviders

If it shows the Nvidia device in the output then going forward you can use switcherooctl or just offload from the command line…

Thanks for the reply Malcolm, here is the output:

msi:/home/me # xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x47; cap: 0xb (Source Output, Sink Output, Sink Offload); crtcs: 4; outputs: 4; associated providers: 1; name: Intel
output eDP1
output DP1
output HDMI1
output VIRTUAL1
Provider 1: id: 0x222; cap: 0x2 (Sink Output); crtcs: 4; outputs: 3; associated providers: 1; name: NVIDIA-G0
output HDMI-1-0
output DP-1-0
output DP-1-1

W̶h̶a̶t̶’̶s̶ ̶"̶s̶w̶i̶t̶c̶h̶e̶r̶o̶o̶c̶t̶l̶"̶?̶ ̶I̶ ̶s̶e̶a̶r̶c̶h̶e̶d̶ ̶b̶u̶t̶ ̶c̶o̶u̶l̶d̶n̶’̶t̶ ̶f̶i̶n̶d̶ ̶i̶t̶.̶

EDIT: I found it, it’s called switcheroo-control. No idea what it does though, even after reading the supplied documentation.

Hmm,

switcherooctl list

returns nothing,even after rebooting :frowning:

Hi
OK, can you confirm listproviders still shows the nvidia card?

If so, then try;


__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 glxinfo | egrep "OpenGL vendor|OpenGL renderer"
or
__NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo|egrep "OpenGL vendor|OpenGL renderer"

Ref: Chapter 35. PRIME Render Offload

Yes, it still works:

me@msi:~> xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x47; cap: 0xb (Source Output, Sink Output, Sink Offload); crtcs: 4; outputs: 4; associated providers: 1; name: Intel
output eDP1
output DP1
output HDMI1
output VIRTUAL1
Provider 1: id: 0x222; cap: 0x2 (Sink Output); crtcs: 4; outputs: 3; associated providers: 1; name: NVIDIA-G0
output HDMI-1-0
output DP-1-0
output DP-1-1

me@msi:~> __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 glxinfo | egrep “OpenGL vendor|OpenGL renderer”
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 1070 with Max-Q Design/PCIe/SSE2

kev2@msi:~> __NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo|egrep “OpenGL vend
or|OpenGL renderer”
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 1070 with Max-Q Design/PCIe/SSE2
me@msi:~>

Hope that’s interesting :).

Hi
So you can launch your applications using the environment variable, no logout/login required.

Question is the switcherooctl service running?


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 Mon 2021-03-15 15:49:51 CDT; 24h ago
   Main PID: 690 (switcheroo-cont)
      Tasks: 3 (limit: 4915)
     CGroup: /system.slice/switcheroo-control.service
             └─690 /usr/libexec/switcheroo-control

Mar 15 15:49:51 grover systemd[1]: Starting Switcheroo Control Proxy service...
Mar 15 15:49:51 grover systemd[1]: Started Switcheroo Control Proxy service.

If not running, start and check switcherooctl list again.

Else you can alias the above to launch an application from the command line…

Thanks for your help & patience, it’s much appreciated.

Most of what you advise is sadly way over my head though!

My original goal was to find a way to easily select which graphic card KDE uses for the main display. I’d like to use the Intel by default, but be able to switch to Nvidia to use VBox or suchlike. The reason being that it uses a lot of power when running the Nvidia card.

Here’s the result of your last suggestion:

me@msi:~> 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)

Regards.

Hi
So you need to start that service and check switcherooctl list. Then you should just be able to start your application using the selected nvidia card.

It’s easier in the likes of GNOME, it offers a menu option to use it (Launch using discrete graphics card)…

Hah, looking good:

me@msi:~> sudo systemctl start switcheroo-control.service
me@msi:~> sudo switcherooctl list
Device: 0
Name: Intel® HD Graphics 630
Default: yes
Environment: DRI_PRIME=pci-0000_00_02_0

Device: 1
Name: NVIDIA Corporation GP104M [GeForce GTX 1070 Mobile] (GeForce GTX 1070 Max-Q)
Default: no
Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1

It says that the Intel is default, so I’m guessing that’s right. Usually the power button lights up red when the Intel is in use, and it goes orange when the Nvidia is in use. It’s staying orange, but that might not be a big deal.

Thanks for all your help. Regards :).

Hi
Good deal :slight_smile: So just use -g 1 eg;


 switcherooctl launch -g 1 glxinfo | egrep "OpenGL vendor|OpenGL render"

OpenGL vendor string: AMD
OpenGL renderer string: Radeon RX550/550 Series (POLARIS12, DRM 3.40.0, 5.11.6-1-default, LLVM 11.0.1)

switcherooctl launch -g 2 glxinfo | egrep "OpenGL vendor|OpenGL render"

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 1030/PCIe/SSE2

Note that there is a bug open for Intel/Nvidia and prime-select/bbswitch: http://bugzilla.opensuse.org/show_bug.cgi?id=1182666
Maybe you are affected as well?

Hi
My observations have shown two different iterations of hybrid laptops, if the user can see the card in xrandr output, use switcherooctl, if not then need prime/bbswitch.