openSUSE / SUSEPrime

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

Misleading 'bbswitch not loaded' output in nvidia and offload mode for 'get-current' option #76

Closed sith-on-mars closed 2 years ago

sith-on-mars commented 2 years ago

Nvidia G06 has been available in the Nvidia repository for OpenSUSE for a while. At the moment the G06 driver doesn't work with SUSE Prime. Would you consider to make SUSE Prime compatible with the G06 driver?

sndirsch commented 2 years ago

Thanks for the report. What do you mean with "doesn't work" exaclty? I'm using SUSE Prime with G06 drivers.

sith-on-mars commented 2 years ago

Sorry for not clarifying it. I mean my device can still boot normally. But seems I couldn't switch my graphic card at all. When I put sudo prime-select get-current in the terminal, it just shows bbswitch not loaded. NVIDIA modules are NOT loaded if you want energy saving bbswitch should be loaded in intel mode. I saw the same output even if I put sudo prime-select intel and I just couldn't switch to the intel card.

sndirsch commented 2 years ago

I think you are already in intel mode then. Are you using suse-prime package or did you install it from git or from some tarball? Which version? In case you use package please run rpm -q suse-prime

zombah commented 2 years ago

Sorry for not clarifying it. I mean my device can still boot normally. But seems I couldn't switch my graphic card at all. When I put sudo prime-select get-current in the terminal, it just shows bbswitch not loaded. NVIDIA modules are NOT loaded if you want energy saving bbswitch should be loaded in intel mode. I saw the same output even if I put sudo prime-select intel and I just couldn't switch to the intel card.

If you using Tumbleweed there is possible crash of Xorg on first run with backtrace like this, check your /var/log/Xorg.0.log:

[    36.737] (EE) Backtrace:
[    36.737] (EE) 0: /usr/bin/Xorg.bin (xorg_backtrace+0x85) [0x563b71258fc5]
[    36.737] (EE) 1: /usr/bin/Xorg.bin (0x563b71082000+0x1d8ac5) [0x563b7125aac5]
[    36.737] (EE) 2: /lib64/libc.so.6 (0x7ff0a7d00000+0x56420) [0x7ff0a7d56420]
[    36.737] (EE) 3: /lib64/libc.so.6 (0x7ff0a7d00000+0xa624c) [0x7ff0a7da624c]
[    36.737] (EE) 4: /lib64/libc.so.6 (raise+0x18) [0x7ff0a7d56356]
[    36.737] (EE) 5: /lib64/libc.so.6 (abort+0xd5) [0x7ff0a7d3f7d3]
[    36.737] (EE) 6: /lib64/libc.so.6 (0x7ff0a7d00000+0x3f6eb) [0x7ff0a7d3f6eb]
[    36.737] (EE) 7: /lib64/libc.so.6 (0x7ff0a7d00000+0x4e946) [0x7ff0a7d4e946]
[    36.738] (EE) 8: /usr/bin/Xorg.bin (0x563b71082000+0x83bc1) [0x563b71105bc1]
[    36.738] (EE) 9: /usr/lib64/xorg/modules/libglamoregl.so (glamor_init+0xcb) [0x7fea9ef6b6bb]
[    36.738] (EE) 10: /usr/lib64/xorg/modules/drivers/modesetting_drv.so (0x7fea9f252000+0xf3a1) [0x7fea9f2613a1]
[    36.738] (EE) 11: /usr/bin/Xorg.bin (AddGPUScreen+0x10e) [0x563b710e2d6e]
[    36.738] (EE) 12: /usr/bin/Xorg.bin (0x563b71082000+0xc6019) [0x563b71148019]
[    36.738] (EE) 13: /usr/bin/Xorg.bin (0x563b71082000+0xcd9f0) [0x563b7114f9f0]
[    36.738] (EE) 14: /usr/bin/Xorg.bin (0x563b71082000+0xc7361) [0x563b71149361]
[    36.738] (EE) 15: /usr/bin/Xorg.bin (config_init+0xbb) [0x563b7114955b]
[    36.738] (EE) 16: /usr/bin/Xorg.bin (InitInput+0x117) [0x563b7112a7b7]
[    36.738] (EE) 17: /usr/bin/Xorg.bin (0x563b71082000+0x4c2aa) [0x563b710ce2aa]
[    36.738] (EE) 18: /lib64/libc.so.6 (0x7ff0a7d00000+0x405c0) [0x7ff0a7d405c0]
[    36.738] (EE) 19: /lib64/libc.so.6 (__libc_start_main+0x7e) [0x7ff0a7d4067c]
[    36.738] (EE) 20: /usr/bin/Xorg.bin (_start+0x25) [0x563b710ceea5]

just run display-manager service again and it will start fine. I don't think it's connected to nvidia package better with some drm stack update.

sith-on-mars commented 2 years ago

I'm using suse-prime package from the official repository. Here is the output of rpm -q suse-prime: suse-prime-0.8.5-1.2.noarch

I'm pretty sure that I'm not in the intel mode. Because I can still launch Nvidia settings, and my laptop battery drains a lot. If everything works correctly, I shouldn't see the output like bbswitch not loaded when I put sudo prime-select get-current.

sith-on-mars commented 2 years ago

I tried to reboot the device and put sudo prime-select intel and SUSE Prime works normally again. Maybe it's like @zombah said, Xorg crushed on the first run. Interesting...

sndirsch commented 2 years ago

Well, your assumptions are not correct. You can't have power saving enabled in intel mode without bbswitch. For saving energy either continue with intel mode and install bbswitch or make use of nVidia's DynamicPowerManagement and switch to suse-prime's nvidia or offload mode. But for the latter you nee a Turing GPU or later. See here for more details. You just have to have something which disables your nVidia GPU or enables its powersaving features.

I haven't tried it, but I guess nVidia settings doesn't need nVidia modules loaded to be started.

sith-on-mars commented 2 years ago

I think you're correct about them. Interestingly, no matter what mode I use, I always see the output bbswitch not loaded when using Nvidia G06, even SUSE Prime seems to work correctly. For example:

/usr/sbin/prime-select get-current
Driver configured: intel
bbswitch not loaded. NVIDIA modules are NOT loaded
if you want energy saving bbswitch should be loaded in intel mode
sndirsch commented 2 years ago

I seriously doubt this. Try prime-select nvidia and prime-select offload

sith-on-mars commented 2 years ago

With prime-select nvidia:

/usr/sbin/prime-select get-current
Driver configured: nvidia
bbswitch not loaded. NVIDIA modules are loaded

With prime-select offload:

/usr/sbin/prime-select get-current
Driver configured: offload
bbswitch not loaded. NVIDIA modules are loaded
sndirsch commented 2 years ago

Ok. I see. This output bbswitch not loaded is misleading in nvdiia/offload mode. There's no need for bbswitch in these modes. On Turing or later GPU families you will have DynamicPowerManagement. On older GPU families unfortunately there are no means for powersaving in these modes.

sndirsch commented 2 years ago

Reopen

sndirsch commented 2 years ago

I think this should clarify things.

diff --git a/prime-select.sh b/prime-select.sh
index 6022c63..1699678 100755
--- a/prime-select.sh
+++ b/prime-select.sh
@@ -144,10 +144,14 @@ function bbcheck {
     if ! [ $(modinfo bbswitch 2> /dev/null | wc -c) = 0 ]; then
         if ! [ "$(lsmod | grep bbswitch)" > /dev/null ]; then
             if [ "$(lsmod | grep nvidia_drm)" > /dev/null ]; then
-                echo "bbswitch not loaded. NVIDIA modules are loaded"
+                echo "NVIDIA modules are loaded"
             else
-                echo "bbswitch not loaded. NVIDIA modules are NOT loaded"
-                echo "if you want energy saving bbswitch should be loaded in intel mode"
+                echo "bbswitch not loaded"
+                echo ""
+                echo "If you want energy saving bbswitch should be loaded in intel mode."
+                echo "For this package 'bbswitch' needs to be installed on your system."
+                echo "Or make use of DynamicPowerManagement on Turing GPUs or later by"
+                echo "switching to suse-prime's 'offload' or 'nvidia' mode."
             fi
         else
             if grep OFF /proc/acpi/bbswitch > /dev/null; then
sndirsch commented 2 years ago

I've made a new release 0.8.6 with this change and also updated the SUSE package with this update. Closing