openSUSE / SUSEPrime

Provide nvidia-prime like package for openSUSE
64 stars 11 forks source link

prime-select.service does not exist #50

Closed felikskiszkurno closed 4 years ago

felikskiszkurno commented 4 years ago

Hi, I am trying to setup Nvidia GPU on my ThinkPad W541 with Quadro K1100M (legacy driver G04). I followed the guide but I run into two issues.

Fisrt one is when I tried to run

if [ ! test -s /etc/modprobe.d/09-nvidia-modprobe-bbswitch-G04.conf ]; then cp 09-nvidia-modprobe-bbswitch-G04.conf /etc/modprobe.d && dracut -f fi

I got error message:

bash: [: -s: binary operator expected

I worked around this issue by executing only:

cp 09-nvidia-modprobe-bbswitch-G04.conf /etc/modprobe.d && dracut -f

It seemed to work correctly, this was the feedback:

dracut: Executing: /usr/bin/dracut -f dracut: dracut module 'lvmmerge' will not be installed, because command 'lvm' could not be found! dracut: dracut module 'lvm' will not be installed, because command 'lvm' could not be found! dracut: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found! dracut: dracut module 'lvmmerge' will not be installed, because command 'lvm' could not be found! dracut: dracut module 'lvm' will not be installed, because command 'lvm' could not be found! dracut: *** Including module: bash *** dracut: *** Including module: systemd *** dracut: *** Including module: systemd-initrd *** dracut: *** Including module: i18n *** dracut: *** Including module: drm *** dracut: *** Including module: plymouth *** dracut: *** Including module: btrfs *** dracut: *** Including module: kernel-modules *** dracut: *** Including module: kernel-modules-extra *** dracut: *** Including module: resume *** dracut: *** Including module: rootfs-block *** dracut: *** Including module: suse-btrfs *** dracut: *** Including module: suse-xfs *** dracut: *** Including module: terminfo *** dracut: *** Including module: udev-rules *** dracut: Skipping udev rule: 40-redhat.rules dracut: Skipping udev rule: 50-firmware.rules dracut: Skipping udev rule: 50-udev.rules dracut: Skipping udev rule: 91-permissions.rules dracut: Skipping udev rule: 80-drivers-modprobe.rules dracut: *** Including module: dracut-systemd *** dracut: *** Including module: haveged *** dracut: *** Including module: ostree *** dracut: *** Including module: usrmount *** dracut: *** Including module: base *** dracut: *** Including module: fs-lib *** dracut: *** Including module: shutdown *** dracut: *** Including module: suse *** dracut: *** Including module: suse-initrd *** dracut: *** Including modules done *** dracut: *** Installing kernel module dependencies *** dracut: *** Installing kernel module dependencies done *** dracut: *** Resolving executable dependencies *** dracut: *** Resolving executable dependencies done *** dracut: *** Hardlinking files *** dracut: *** Hardlinking files done *** dracut: *** Stripping files *** dracut: *** Stripping files done *** dracut: *** Generating early-microcode cpio image *** dracut: *** Constructing GenuineIntel.bin *** dracut: *** Store current command line parameters *** dracut: Stored kernel commandline: dracut: resume=UUID=26a6efb7-befe-4d4b-8378-829e13434679 dracut: root=UUID=f0f25ea0-db10-424c-a865-41716f374ad6 rootfstype=btrfs rootflags=rw,relatime,ssd,space_cache,subvolid=266,subvol=/@/.snapshots/1/snapshot,subvol=@/.snapshots/1/snapshot dracut: *** Creating image file '/boot/initrd-5.5.9-1-default' *** dracut: *** Creating initramfs image file '/boot/initrd-5.5.9-1-default' done *** Next step would be executing:

if [ ! -s /usr/lib/systemd/system/prime-select.service ]; then cp prime-select.service /usr/lib/systemd/system && \ systemctl enable prime-select fi

but this command ended with error:

cp: cannot stat 'prime-select.service': No such file or directory Output from prime-select get-current:

'Driver configured: intel [bbswitch] NVIDIA card is ON'

Output from nvidia-smi:

'Tue Mar 24 21:18:22 2020
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 390.132 Driver Version: 390.132 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Quadro K1100M Off | 00000000:01:00.0 Off | N/A | | N/A 48C P8 N/A / N/A | 5MiB / 1999MiB | 0% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+ ' I can switch from Intel to Nvidia, however Nvidia will always remain turned on.

Is it normal that prime-select seem to work correctly without prime-select.service running? Have I done something wrong during setup?

Please let me know if more information is required

Thanks, felikssartorius

EDIT: I have created the service file manually.

After reboot Nvidia GPU is still on even though intel is selected.

Feedback from:

systemctl status prime-select

is:

`● prime-select.service - SUSEPrime systemd service Loaded: loaded (/usr/lib/systemd/system/prime-select.service; enabled; vendor preset: disabled) Active: inactive (dead) since Tue 2020-03-24 21:55:07 CET; 1min 12s ago Main PID: 1040 (code=exited, status=0/SUCCESS)

Mar 24 21:55:06 GeoPad systemd[1]: Starting SUSEPrime systemd service... Mar 24 21:55:07 GeoPad suse-prime[1155]: Boot: setting-up intel card Mar 24 21:55:07 GeoPad rpm[1288]: Libgcrypt warning: missing initialization - please fix the application Mar 24 21:55:07 GeoPad suse-prime[1461]: trying switch OFF nvidia: [bbswitch] NVIDIA card is ON Mar 24 21:55:07 GeoPad systemd[1]: prime-select.service: Succeeded. Mar 24 21:55:07 GeoPad systemd[1]: Started SUSEPrime systemd service. `

sndirsch commented 4 years ago

if [ ! test -s /etc/modprobe.d/09-nvidia-modprobe-bbswitch-G04.conf ]; then cp 09-nvidia-modprobe-bbswitch-G04.conf /etc/modprobe.d && dracut -f fi I got error message: bash: [: -s: binary operator expected

Sorry. "test" should not be there at all. Just fixed in git master.

dracut: Executing: /usr/bin/dracut -f dracut: dracut module 'lvmmerge' will not be installed, [...] resume=UUID=26a6efb7-befe-4d4b-8378-829e13434679 dracut: root=UUID=f0f25ea0-db10-424c-a865-41716f374ad6 rootfstype=btrfs rootflags=rw,relatime,ssd,space_cache,subvolid=266,subvol=/@/.snapshots/1/snapshot,subvol=@/.snapshots/1/snapshot dracut: *** Creating image file '/boot/initrd-5.5.9-1-default' *** dracut: *** Creating initramfs image file '/boot/initrd-5.5.9-1-default' done ***

Hmm. This looks weird, but "dracut -f" shold work in general and is unrelated to SUSEPrime.

if [ ! -s /usr/lib/systemd/system/prime-select.service ]; then cp prime-select.service /usr/lib/systemd/system && \ systemctl enable prime-select fi cp: cannot stat 'prime-select.service': No such file or directory Output from prime-select get-current:

Hmm. prime-select.service is part of the git sources, so it should exist in your checked out git tree.

I can switch from Intel to Nvidia, however Nvidia will always remain turned on.

Not sure whether I understand this question correctly. You can only switch off NVIDIA GPU, when you don't use it.

felikskiszkurno commented 4 years ago

Removing test works. Now both files 09-nvidia-modprobe-bbswitch-G04.conf and prime-select.service are placed where they belong to. However the issue with prime-select service is not resolved.

Not sure whether I understand this question correctly. You can only switch off NVIDIA GPU, when you don't use it.

I am sorry, I have formulated it a bit wrongly. I can switch both ways: Nvidia to Intel and Intel to Nvidia. Switching works smoothly. The issue is that when I switch to intel, Nvidia remains active.

After a reboot prime-select.service status is failed and when I try to force it to start it changes into inactive.

Here is the log from prime-select:

##SUSEPrime logfile## [ 21:03:16 ] Adding support for NVIDIA Prime Render Offload [ 21:03:16 ] Intel card correctly set [ 21:55:07 ] Boot: setting-up intel card [ 21:55:07 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 21:55:07 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 21:55:07 ] Intel card correctly set [ 22:01:41 ] Boot: setting-up intel card [ 22:01:42 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 22:01:42 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 22:01:42 ] Intel card correctly set [ 08:51:21 ] Boot: setting-up intel card [ 08:51:22 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 08:51:22 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 08:51:22 ] Intel card correctly set [ 08:53:32 ] trying switch ON nvidia: [bbswitch] NVIDIA card is ON [ 08:54:36 ] Boot: setting-up intel card [ 08:54:36 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 08:54:36 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 08:54:36 ] Intel card correctly set [ 08:55:31 ] user_logout_waiter: started [ 08:56:27 ] Boot: setting-up intel card [ 08:56:27 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 08:56:27 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 08:56:27 ] Intel card correctly set [ 09:33:43 ] Boot: setting-up intel card [ 09:33:44 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 09:33:44 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 09:33:44 ] Intel card correctly set [ 09:39:55 ] Boot: setting-up intel card [ 09:39:55 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 09:39:55 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 09:39:55 ] Intel card correctly set [ 09:41:29 ] user_logout_waiter: started [ 09:41:41 ] user_logout_waiter: X restart detected, preparing switch to nvidia [ boot_state > S ] [ 09:41:43 ] trying switch ON nvidia: [bbswitch] NVIDIA card is ON [ 09:41:44 ] NVIDIA card correctly set [ 09:41:44 ] HotSwitch: starting Display Manager [ boot_state > N ] [ 09:42:33 ] user_logout_waiter: started [ 09:42:45 ] user_logout_waiter: X restart detected, preparing switch to intel [ boot_state > S ] [ 09:42:50 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 09:42:50 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 09:42:50 ] Intel card correctly set [ 09:42:50 ] HotSwitch: starting Display Manager [ boot_state > N ]

Result is the same when I use prime-select command and when I run cloned script from git.

EDIT: Output from systemctl status prime-select changed to:

`● prime-select.service - SUSEPrime systemd service Loaded: loaded (/usr/lib/systemd/system/prime-select.service; enabled; vendor preset: disabled) Active: inactive (dead) since Wed 2020-03-25 11:10:21 CET; 23s ago Process: 1033 ExecStart=/usr/sbin/prime-select systemd_call (code=exited, status=0/SUCCESS) Main PID: 1033 (code=exited, status=0/SUCCESS)

Mar 25 11:10:11 GeoPad systemd[1]: Starting SUSEPrime systemd service... Mar 25 11:10:12 GeoPad rpm[1339]: Libgcrypt warning: missing initialization - please fix the application Mar 25 11:10:12 GeoPad suse-prime[1385]: trying switch OFF nvidia: [bbswitch] NVIDIA card is ON Mar 25 11:10:12 GeoPad sudo[1441]: root : TTY=unknown ; PWD=/ ; USER=kubakiszkurno ; COMMAND=/bin/bash -c eval echo\ -n\ $HOME Mar 25 11:10:21 GeoPad sudo[2478]: root : TTY=unknown ; PWD=/ ; USER=kubakiszkurno ; COMMAND=/usr/bin/sed -i -r s/(ScreenScaleFactors=)eDP-1-1|eDP-1|eDP1> Mar 25 11:10:21 GeoPad systemd[1]: prime-select.service: Succeeded. Mar 25 11:10:21 GeoPad systemd[1]: Started SUSEPrime systemd service. `

I tried installing libgcrypt (if I understand it correctly, some library is missing) but it didn't help.

Checking the service status with:

prime-select service check

results in:

'prime-select: service is set correctly'

I tried restoring it with 'prime-select service restore'. It is successfully completed but it doesn't change anything.

sndirsch commented 4 years ago

@simopil Can you help here?

@felikssartorius I should mention that using bbswitch and prime-select service is only needed when you want to use intel GPU only and save energy by disabling NVIDIA GPU.

felikskiszkurno commented 4 years ago

@felikssartorius I should mention that using bbswitch and prime-select service is only needed when you want to use intel GPU only and save energy by disabling NVIDIA GPU.

That's exactly what I am trying to achieve.

felikskiszkurno commented 4 years ago

Since there is a reasonable chance, that I have done something wrong during installation, I tried to verify if I have all the necessary packages and files installed:

Packages:

nvidia installed: kernel-firmware-nvidia, nvidia-computeG04, nvidia-gfxG04-kmp-default, nvidia-glG04, x11-video-nvidiaG04 nvidia not installed: nvidia-gfx-kmp-pae, pcp-pmda-nvidia-gpu, nvidia-texture-tools

bbsiwtch installed: bbswitch, bbswitch-kmp-default bbswitch not installed: bbswitch-kmp-pae, suse-prime-bbswitch

prime installed: plasma5-applet-suse-prime, suse-prime prime not installed: suse-prime-bbswitch, suseprime-appindicator

Everything that is installed, has been installed automatically. I didn't install any packages manually.

Files:

In /etc/X11/xorg.conf.d I have following files: 90-intel.conf xorg-intel-intel.conf xorg-intel.conf xorg-nvidia.conf

I tried renaming 90-intel.conf to remove it, but it keeps coming back after a reboot.

In /etc/modprobe.d 09-nvidia-modprobe-bbswitch-G04.conf

I have found here follwoing files, that I have disabled by appending .bak to file name: 50-nvidia-default.conf 50-nvidia-default.conf.rpmsave nvidia-default.conf

renaming those files hasn't changed anything and they did not reappear after a reboot.

In /usr/lib/systemd/system: prime-select.service

Is there anything else that I should check? Am I missing anything? Is there something that I did wrong?

sndirsch commented 4 years ago

Ok. nvidia package list looks ok to me.

First you need to decide whether you want to use the RPM packages (x)or git sources. I suggest to try with packages first. In your case this would be suse-prime-bbswitch for disabling NVIDIA GPU if switched to Intel (only). Try to get rid of the files you copied manually to the system by following the README.md in git first.

felikskiszkurno commented 4 years ago

I removed all the files I have created.

Than I installed suse-prime-bbswitch (which forced deinstallation of suse-prime). It didn't change anything. Status of prime-select is loaded/inactive(dead) and Nvidia remains turned on after switching to intel. I tried rebooting multiple times, switching from intel to nvidia, and than from nvidia to intel. I set default boot driver to intel. But nvidia still remained turned on.

Additionally I have tried removing everything that had anything to do with nvidia drivers and suse-prime packages (including files in X11 and systemd folders). And following the installation instruction again but installing suse-prime-bbswitch instead of suse-prime. Afterwards I didn't edit any files manually (entry in systemd exist so I assume I don't have to create prime-select.service manually). File 09-nvidia-modprobe-bbswitch-G04.conf has been created as well. However in /etc/X11/xorg.conf.d there are only: 00-keyboard.conf (unrelated I assume) and 90-intel.conf. Should I add three xorg files from repo manually?

sndirsch commented 4 years ago

No need to create any files if using the RPMs. My guess is currently, that switching off the NVIDIA GPU on your system simply does not work.

felikskiszkurno commented 4 years ago

I am sure the hardware does work that way. I was using PopOs before and switching worked. So I think the hardware is not an issue.

felikskiszkurno commented 4 years ago

I just realised, that after switching to Nvidia and logging out, I can't log in to KDE again. I get kicked out to command line. I have to reboot back to intel to get GUI back.

This is the log from prime-select: [ 11:53:17 ] user_logout_waiter: started [ 11:53:36 ] user_logout_waiter: X restart detected, preparing switch to nvidia [ boot_state > S ] [ 11:53:38 ] trying switch ON nvidia: [bbswitch] NVIDIA card is ON [ 11:54:44 ] Boot: setting-up intel card [ 11:54:44 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 11:54:45 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 11:54:45 ] Intel card correctly set [ 11:54:51 ] updated /home/kubakiszkurno/.config/kdeglobals [ 11:55:27 ] user_logout_waiter: started [ 11:55:38 ] user_logout_waiter: X restart detected, preparing switch to nvidia [ boot_state > S ] [ 11:55:41 ] trying switch ON nvidia: [bbswitch] NVIDIA card is ON [ 11:56:28 ] Boot: setting-up intel card [ 11:56:28 ] NVIDIA card will be switched off, NVIDIA offloading will not be available [ 11:56:28 ] trying switch OFF nvidia: [bbswitch] NVIDIA card is ON [ 11:56:28 ] Intel card correctly set [ 11:56:34 ] updated /home/kubakiszkurno/.config/kdeglobals

sndirsch commented 4 years ago

I ran into the same problem on openSUSE Leap 15.1 on my sytem, i.e I could not disable NVIDIA GPU. Seems the issue is that two extra kernel modules prevent the script from unloading nvidia kernel modules: ipmi_msghandler and ipmi_devintf

Try to add these lines to /etc/modprobe.d/09-nvidia-modprobe-bbswitch-G04.conf:

blacklist ipmi_msghandler blacklist ipmi_devintf

Run 'mkinitrd' afterwards and replace the following line in /usr/sbin/prime-select

nvidia_modules="nvidia_drm nvidia_modeset nvidia_uvm nvidia"

with

nvidia_modules="ipmi_devintf nvidia_drm nvidia_modeset nvidia_uvm nvidia ipmi_msghandler"

Then reboot your machine and try again.

felikskiszkurno commented 4 years ago

I have run some tests. There is some progress.

Now I can smoothly switch from intel to nvidia and back to intel. I don't end up stuck in command line anymore.

However when intel is selected, nvidia gpu remains on.

Is there any log, additional diagnostics, informations that I could share with you that might help identifying what is the problem?

sndirsch commented 4 years ago

Ok. In Intel mode after relogin check if still any nvidia modules are loaded:

lsmod | grep nvidia

Try to get rid of them (and any other depending on them) if there are still any. Let me know if there are more than ipmi_devintf and ipmi_msghandler on your system.

sndirsch commented 4 years ago

Background: You can't switch off your NVIDIA GPU as long as any nvidia module is still loaded.

bubbleguuum commented 4 years ago

No issue here on latest Tumbleweed, NVIDIA driver 440.64, latest suse-prime-bbswitch for the NVIDIA GPU to be off with the presence of the ipmi modules and without any change to the script...

felikskiszkurno commented 4 years ago

Ok. In Intel mode after relogin check if still any nvidia modules are loaded:

lsmod | grep nvidia

Try to get rid of them (and any other depending on them) if there are still any. Let me know if there are more than ipmi_devintf and ipmi_msghandler on your system.

nvidia 14733312 3 ipmi_msghandler 73728 2 ipmi_devintf,nvidia

my /etc/modprobe.d/09-nvidia-modprobe-bbswitch-G04.conf

blacklist nvidia blacklist nvidia-drm blacklist nvidia-modeset blacklist nouveau blacklist ipmi_msghandler blacklist ipmi_devintf options nvidia-drm modeset=1

I have followed your instruction very carefully. I am not sure why those modules are still loaded.

Are there any other files I should disable in modeprobe? Any potential for conflict there? There are 50-nvidia-default.conf and nvidia-default.conf Currently they are renamed by appending .bak to their names. Could those files be causing conflicts? They don't get recreated after a reboot.

sndirsch commented 4 years ago

These modprobe files shouldn't be an issue here. Try to get rid of the remaining modules manually via rmmod. Then run "echo OFF > /proc/acpi/bbswitch". Then "prime-select get-current" should give you NVIDIA GPU off hopefully.

felikskiszkurno commented 4 years ago

I removed successfully only ipmidevintf. Since rmmode gives not positive feedback, I rerun the command and this was the result

rmmod: ERROR: Module ipmi_devintf is not currently loaded So I assume, that this one was removed successfully. The other ones, couldn't get removed

Output from rmmod ipmi_msghandler rmmod: ERROR: Module ipmi_msghandler is in use by: nvidia

Output from rmmod nvidia rmmod: ERROR: Module nvidia is in use

Output from lsmod | grep nvidia: nvidia 14733312 3 ipmi_msghandler 73728 1 nvidia

Output from prime-select get-current: Driver configured: intel [bbswitch] NVIDIA card is ON I have executed all commands as su.

sndirsch commented 4 years ago

Please make sure that nvdia kernel moule is no longer been used. Maybe there is still an Xserver active which is still using it ...

felikskiszkurno commented 4 years ago

I am sorry. This might be a stupid question, but I am not sure how to do it. I don't know much about Xserver. Actually nothing apart from how to use X config files and xrandr.

I tried using command w and who and to list active sessions, but I am not sure how to interpret it regarding existence of Xserves.

In process manager I can find only one Xsession process for my user (marked as zombie) and one X process for root.

I am the only user of this pc. There is one account, that I use and one root account. Is there an Xserver specific command to list active ones? I tried looking in manual but I couldn't find it.

sndirsch commented 4 years ago

You could use 'fuser /dev/nvidia*' to figure out the process id of the program which accesses the nvidia device. Then search for this program with 'ps aux|grep "process-id"'. Then try to kill this process with 'kill -9 "process-id"'.

felikskiszkurno commented 4 years ago

result from fuser /dev/nvidia*: /dev/nvidiactl: 4235 Result from ps aux|grep 4235 root 4235 2.6 0.2 765460 72852 tty7 Ssl+ 16:24 0:03 /usr/bin/X -nolisten tcp -auth /run/sddm/{2ffb4077-84a7-486d-8929-ab1b361db1f0} -background none -noreset -displayfd 18 -seat seat0 vt7 kubakis+ 5321 0.0 0.0 6120 2180 pts/1 S+ 16:26 0:00 grep --color=auto 4235

I tried killing process 4235, but it thrown me back to the login screen, so I assume, that it is my own session process.

Apart from this, actually there were two apps that were using nvida: skype and jetbrains toolbox.

I tried switching to command line only in order to kill the X (4235) process and remove modules afterwards, but I was send back to the login screen as well.

sndirsch commented 4 years ago

Yeah. Looks like you didn't manage to switch to intel mode yet (still in nvidia mode). I suggest to boot in runlevel 3 and switch to intel mode. Maybe you even need to uninstall all nvidia RPMs, reboot again and then run 'prime-select intel' to achieve this in the end.

Once you have managed that you can install again the NVIDIA packages and try switching between Intel (with disabled NVIDIA GPU) and NVIDIA mode again.

felikskiszkurno commented 4 years ago

In runlevel 3 I have killed all processes that were listed by fuser /dev/nvidia*, next I rmmod all modules that you have listed. and exectudet echo OFF > /proc/acpi/bbswitch. Feedback from prime-select get-current indicated that nvidia is still on, so I reboot and tried all the steps again. IT failed again, so I removed all nvidia packages. Now when I try to switch to nvidia mode, I receive follwoing error message: /usr/sbin/prime-select: line 219: nvidia-xconfig: command not found Reconfiguration failed Restoring previous configuration: intel It makes sens, Nvidia drivers are gone, but why bbswitch refuses to turn off? All the modules are unloaded.

sndirsch commented 4 years ago

Seems nvidia modules are still in your initrd, which is weird since initrd is recreated when uninstalling nvidia packages.

felikskiszkurno commented 4 years ago

I rebuild initrd and rebooted. After a reboot problem remains.

This is a list of loaded modules from lsmod: Module Size Used by ccm 20480 6 bnep 28672 2 fuse 139264 7 af_packet 53248 12 scsi_transport_iscsi 126976 1 xt_tcpudp 20480 11 ip6t_REJECT 16384 11 nf_reject_ipv6 20480 1 ip6t_REJECT ip6t_rpfilter 16384 1 ipt_REJECT 16384 2 nf_reject_ipv4 16384 1 ipt_REJECT xt_conntrack 16384 19 ebtable_nat 16384 1 ebtable_broute 16384 1 ip6table_nat 16384 1 ip6table_mangle 16384 1 ip6table_raw 16384 1 ip6table_security 16384 1 iptable_nat 16384 1 nf_nat 53248 2 ip6table_nat,iptable_nat iptable_mangle 16384 1 iptable_raw 16384 1 iptable_security 16384 1 nf_conntrack 172032 2 xt_conntrack,nf_nat nf_defrag_ipv6 24576 1 nf_conntrack nf_defrag_ipv4 16384 1 nf_conntrack ip_set 57344 0 nfnetlink 16384 1 ip_set ebtable_filter 16384 1 ebtables 40960 3 ebtable_nat,ebtable_filter,ebtable_broute uvcvideo 114688 0 rmi_smbus 16384 0 rmi_core 94208 1 rmi_smbus videobuf2_vmalloc 20480 2 rmi_core,uvcvideo videobuf2_memops 20480 1 videobuf2_vmalloc videobuf2_v4l2 28672 2 rmi_core,uvcvideo videobuf2_common 57344 3 rmi_core,videobuf2_v4l2,uvcvideo videodev 266240 4 rmi_core,videobuf2_v4l2,uvcvideo,videobuf2_common mc 57344 4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common vboxnetadp 28672 0 vboxnetflt 32768 0 ip6table_filter 16384 1 ip6_tables 32768 7 ip6table_filter,ip6table_raw,ip6table_nat,ip6table_mangle,ip6table_security btusb 65536 0 iptable_filter 16384 1 btrtl 24576 1 btusb ip_tables 32768 5 iptable_filter,iptable_security,iptable_raw,iptable_nat,iptable_mangle btbcm 16384 1 btusb btintel 32768 1 btusb intel_rapl_msr 20480 0 x_tables 49152 16 ebtables,ip6table_filter,xt_conntrack,ip6table_raw,iptable_filter,iptable_security,ip6t_rpfilter,xt_tcpudp,ip6_tables,ipt_REJECT,iptable_raw,ip_tables,ip6table_mangle,ip6table_security,ip6t_REJECT,iptable_mangle intel_rapl_common 32768 1 intel_rapl_msr bpfilter 36864 0 bluetooth 626688 11 btrtl,btintel,btbcm,bnep,btusb ecdh_generic 16384 1 bluetooth x86_pkg_temp_thermal 20480 0 ecc 36864 1 ecdh_generic intel_powerclamp 20480 0 coretemp 20480 0 kvm_intel 319488 0 vboxdrv 528384 2 vboxnetadp,vboxnetflt dmi_sysfs 20480 0 iwlmvm 454656 0 kvm 811008 1 kvm_intel tun 57344 0 irqbypass 16384 1 kvm mac80211 991232 1 iwlmvm msr 16384 0 libarc4 16384 1 mac80211 iTCO_wdt 16384 0 crct10dif_pclmul 16384 1 iTCO_vendor_support 16384 1 iTCO_wdt crc32_pclmul 16384 0 iwlwifi 339968 1 iwlmvm snd_hda_codec_realtek 126976 1 ghash_clmulni_intel 16384 0 snd_hda_codec_generic 94208 1 snd_hda_codec_realtek snd_hda_codec_hdmi 73728 2 mei_me 45056 0 aesni_intel 368640 4 snd_hda_intel 57344 8 crypto_simd 16384 1 aesni_intel cfg80211 835584 3 iwlmvm,iwlwifi,mac80211 cryptd 24576 2 crypto_simd,ghash_clmulni_intel e1000e 294912 0 joydev 28672 0 snd_intel_dspcfg 28672 1 snd_hda_intel pcspkr 16384 0 mei 122880 1 mei_me glue_helper 16384 1 aesni_intel snd_hda_codec 163840 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek wmi_bmof 16384 0 i2c_i801 36864 0 lpc_ich 28672 0 snd_hda_core 106496 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek snd_hwdep 16384 1 snd_hda_codec thinkpad_acpi 110592 0 snd_pcm 155648 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core ledtrig_audio 16384 3 snd_hda_codec_generic,snd_hda_codec_realtek,thinkpad_acpi rfkill 28672 10 bluetooth,thinkpad_acpi,cfg80211 thermal 28672 0 snd_timer 40960 1 snd_pcm snd 110592 25 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,thinkpad_acpi,snd_pcm ac 16384 0 soundcore 16384 1 snd ie31200_edac 16384 0 xfs 1482752 1 binfmt_misc 24576 1 uas 32768 0 usb_storage 81920 1 uas hid_generic 16384 0 usbhid 65536 0 btrfs 1503232 1 blake2b_generic 20480 0 libcrc32c 16384 4 nf_conntrack,nf_nat,btrfs,xfs xor 24576 1 btrfs i915 2461696 21 raid6_pq 122880 1 btrfs i2c_algo_bit 16384 1 i915 drm_kms_helper 233472 1 i915 xhci_pci 20480 0 syscopyarea 16384 1 drm_kms_helper xhci_hcd 286720 1 xhci_pci sysfillrect 16384 1 drm_kms_helper sysimgblt 16384 1 drm_kms_helper fb_sys_fops 16384 1 drm_kms_helper drm 544768 12 drm_kms_helper,i915 ehci_pci 20480 0 ehci_hcd 98304 1 ehci_pci crc32c_intel 24576 2 sdhci_pci 57344 0 cqhci 32768 1 sdhci_pci usbcore 315392 9 xhci_hcd,ehci_pci,usbhid,usb_storage,uvcvideo,ehci_hcd,btusb,xhci_pci,uas sdhci 73728 1 sdhci_pci mmc_core 184320 3 sdhci,cqhci,sdhci_pci serio_raw 20480 0 wmi 32768 1 wmi_bmof battery 24576 1 thinkpad_acpi video 53248 2 thinkpad_acpi,i915 button 24576 0 sg 40960 0 dm_multipath 36864 0 dm_mod 159744 1 dm_multipath scsi_dh_rdac 16384 0 scsi_dh_emc 16384 0 scsi_dh_alua 20480 0 bbswitch 20480 0

sndirsch commented 4 years ago

Hmm. This looks good. No nvidia module is loaded and bbswitch module is loaded. So disabling NVIDIA GPU should work in principal. And is no longer blocked by a loaded nvidia module.

felikskiszkurno commented 4 years ago

I am not sure, if we are on the same page. I might have misunderstood you.

Just to clarify: I currently have no nvidia drivers installed, I have removed them after unloading them with rmmod failed. Then I tried to change the /proc/acpi/bbswitch to OFF. Since there are no nvidia modules loaded (they are removed), it should work, correct? Or should I install nvidia drivers again? The default driver is set to intel and nvidia modules are blacklisted, so they shouldn't be loaded after I reinstall them, hence bbswitch should be able to tunr the gpu off.

Do I get something wrong?

sndirsch commented 4 years ago

No. We're on the same page. Meanwhile I'm afraid that on your system the NVIDIA GPU cannot be disabled. :-( (problem in bbswitch module) nouveau wasn't in your kernel module list either. So this can't be the reaons why things are not working for you. Unfortunately I'm not an export for bbswitch ... I'm sorry.

felikskiszkurno commented 4 years ago

Ok, thank you very much.

So I will assume, that bbswitch is the problem here not suse-prime.

I will open an issue at bbswitch github and close this one. Thank you very much for your time and help.

sndirsch commented 4 years ago

Thanks for reporting and your patience during testing everyhing thourougly! I meanwhile made a new release with the fixes I suggested in https://github.com/openSUSE/SUSEPrime/issues/50#issuecomment-605084071

Thanks for opening an issue against bbswitch! Feel free to let me know about the issue number there! Could be that a complete NVIDIA GPU family is affected by this ...

sndirsch commented 4 years ago

I'm already subscribed on the bbswitch issue. :-)