You are not logged in.

#26 2018-07-06 15:44:25

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Look at this discussion as well: https://github.com/Bumblebee-Project/Bu … issues/764, in particular a comment by dosyoyas, there seems to be a workaround to make bumblebee work with this card.

Offline

#27 2018-07-06 23:13:07

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I had a systemfreeze indeed when running lspci, but that was before bios 1.2.2 / Linux 4.17. Right now without overrides I have no issue.

Anyways, michelesr, which acpi_calls are you using to turn the card off? Since I think bbswitch can turn on/off the system for me, I just have issues loading nvidia after I do. If we can switch to using ACPI calls (this is an option with bumblebee btw), then we can start using that.

Offline

#28 2018-07-07 22:41:03

Zeben
Member
Registered: 2015-08-26
Posts: 6

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I have the same issues with Dell Vostro 5459 with its dGPU and recent ( > 4.16.11) Linux kernels.
The answer I described is here, in bbswitch's issue tracker: https://github.com/Bumblebee-Project/bb … -403246647
TL;DR:
1. bbswitch module fails with traceback in dmesg when I try to restart bumblebeed;
2. optirun stops working after AC adapter unglugging;
3. dGPU enables and keeps working after I starting VLC, watching some videos and even after closing VLC. When I'm trying to restart bumblebeed - the module falls again and dGPU keeps powered on.
C: as a temporary conclusion for me at the time is just rollback to Linux 4.16.12 with nvidia-dkms module.

Offline

#29 2018-07-09 10:55:29

LazyLucretia
Member
Registered: 2016-01-28
Posts: 39

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

michelesr wrote:

Look at this discussion as well: https://github.com/Bumblebee-Project/Bu … issues/764, in particular a comment by dosyoyas, there seems to be a workaround to make bumblebee work with this card.

dosyoyas has stated that he's been using kernel version 4.15 with Ubuntu 18.04, this might be why it is working for them.

Offline

#30 2018-07-10 14:06:33

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I have indeed been keeping an eye on the conversations, though I have not had time to fiddle myself. dosyoyas solution is based on Ubuntu, an older kernel, and I don't think it will work for me, though setting library path might be something to keep in mind. And his acpi_osi settings and the GLX setting could work for us (once I figure out what they do).

I had a short chat with Lekensteyn on IRC, which suggests that the pm-rework branch is working fine for us, and we should start looking at the module loading by bumblebee / nvidia-xrun.

[13:41] <IngeniousDox> Lekensteyn: Your pm-rework branch without the last commit, is that basically everything that is needed to use runtime-pm for newer nvidia cards? I mean is it finished or were you planning to do more work on it?
[13:43] <IngeniousDox> I have a Dell XPS15 9570 and we are trying to figure out what is needed to make it work with newer 4.17 kernel, since normal bbswitch doesn't.
[13:44] <Lekensteyn> IngeniousDox: yes it should work
[13:44] <IngeniousDox> (Not looking to bugreport it here, just ruling out incomplete implementation / production readyness)
[13:44] <IngeniousDox> https://bbs.archlinux.org/viewtopic.php?id=238389
[13:44] <Lekensteyn> I originally wanted to make it compatible with configurations that have a HDMI/DP audio function (hence the vgaswitcheroo integration), but I never finished that
[13:45] <Lekensteyn> do you actually want to combine with bumblebeed?
[13:45] <IngeniousDox> Yeah, it doesn't compile / work on Arch, so I make a PKGBUILD without that last commit. bbswitch seems to work. (I'm new at laptops with it, so still learning)
[13:46] <Lekensteyn> ok, I am using nouveau w/o bumblebee/bbswitch atm since it integrates nicely
[13:46] <IngeniousDox> However, getting some issues with modules that can't be loaded unloaded. Something about nvlink / ipmi. I think setting acpi_osi=XXX might fix that...I'll check on that further.
[13:46] <Lekensteyn> before xorg 1.20 multi monitor worked too, but since 1.20 something unfortunately broke (somewhere on the todo list)
[13:47] <Lekensteyn> I've no idea about nvlink/ipmi, sorry :/
[13:47] <Lekensteyn> since you mentioned the XPS, at least with the XPS 9560 you had to boot with acpi_osi=... as a workaround
[13:47] <IngeniousDox> Does bbswitch unload nvidia modules?
[13:47] <Lekensteyn> bbswitch does not unload nvidia, that is done by bumblebeed
[13:47] <Lekensteyn> bbswitch is the kernel module which is controlled by the bumblebeed userspace program
[13:48] <IngeniousDox> Aha, then there we go, the issue might be in bumblebee and your new pm-rework works fine. 
[13:49] <IngeniousDox> I tested a lot of different acpi_osi= with normal bbswitch, I'm going to retry them with pm-rework.
[13:50] <IngeniousDox> And there is a lot of info about other people having issues with 4.17, that are either not using bbswitch anymore (just using pm-suspend from TLP / LMT). etc etc... I'll keep fiddling.
[13:52] <Lekensteyn> seems reasonable, for newer devices, runtime PM should be enough
[13:52] <IngeniousDox> Its just bumblee then that has trouble unloading nvidia modules, since they are being used by another module I guess..and enabling fails perhaps due to similar reasons.
[13:52] <IngeniousDox> I guess thats where the acpi_osi=XXX comes in, that might not load those modules.
[13:53] <Lekensteyn> bumblebee needs to be updated to use that runtime PM approach. The issue is that older devices do not work with that approach and need something like bbswitch
[13:54] <Lekensteyn> if unloading kernel modules fails with "module still in use", then using acpi_osi will probably not make a difference in solving that problem
[13:54] <Lekensteyn> my guess is that Xorg is somehow using it (you can check with lsof against the device nodes in /dev/)
[13:54] <Lekensteyn> the acpi_osi addition is needed to workaround an issue where the hardware fails to power on and causes a hang/lockup in the ACPI subsystem in the kernel
[13:55] * Lekensteyn lunch
[13:55] <IngeniousDox> I'll have to look into this more, but that information is available. Thx for your time.
[13:55] <IngeniousDox> We will figure it out.

I won't have time to test more till this weekend, but I want to confirm with powertop (and /sys/ output) that bbswitch correctly sets dGPU in suspend. I think this is the case though, it would confirm our problem no longer is in bbswitch, but with bumblebee itself, specifically the loading/unloading of modules. I figure our solution will end up being one of these:

1) Use older kernel (lts perhaps), disable pcie_port_pm, and normal bbswitch. (This option I do not want to use)

2) Use current kernel, and bbswitch with pm-suspend. Figure out why nvlink / ipmi modules are loaded, then make sure nvidia module loads correctly. Things to check: Library path? acpi_osi=XXX? acpi_rev_override=? Blacklisting certain modules?

3) Use current kernel, without bbswitch, but with LMT/TLP to manage pm-suspend. Load/unload nvidia modules by hand, or by bumblebee (it should be possible), when we want to use it. Not sure if this will work with X-run since that still seems to be using bbswitch, but I guess we can turn that off somehow.

I would prefer to get 2) or 3) working myself. If you have time to look it before me, and figure it out, please let me know. wink


Dox


PS: I'm also looking at https://aur.archlinux.org/packages/nvidia-prime/ which, though outdated, could be OK as well. Perhaps update it so it uses v0.8.8. Though this means nvidia-gpu is always on when you select PRIME, but at least you can easily switch between everything on iGPU with dGPU off, and nvidia PRIME.

PS2: https://github.com/Fincer/nvidia-xrun/b … vidia-xrun is a fork of nvidia-xrun that is in the process of being integrated with nvidia-xrun, this is an improvement that is interesting since it provides an alternative to using "optirun" that can be run in the current X environment.

Last edited by IngeniousDox (2018-07-10 14:17:05)

Offline

#31 2018-07-11 09:21:39

LazyLucretia
Member
Registered: 2016-01-28
Posts: 39

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I don't know much about internal workings of the kernel, drivers, modules, bumblebee and other stuff involved in this issue. However, my understanding is that, one cannot unload nvidia modules without completely terminating the GUI since it's utilizing those modules. When I tried to do it manually, I had to log out, swıtch to a tty and terminate all GUI sessions before unloading nvidia and loading back nouveau. How did Bumblebee achive this in older kernels, is a complete mistery for me.

Offline

#32 2018-07-11 09:41:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,209

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Bumblebee achieves this because it opens up another "hidden" xserver where the graphics card renders into, the result of that is then copied over to the x server displayed on your intel card. If you close the window being rendered by that hidden x server bumblebee can cleanup that connection and unload the nvidia module. There's some more specific magic going on as to how it is able to copy the buffers, however the gist of how it works is as explained.

FWIW if the underlying issue is that you get a freeze with modern pcie pm when trying to load the nvidia driver, you can simply blacklist the PCI bus the nvidia card is on. E.g. TLP will do that by default, so that bbswitch and co can use the traditional method to disable power (that still works on many systems, Dells seem to be a special outlier here)

FWIW in regards to that, nvidia-xrun (or nvidia-prime for that matter) won't make a difference, nvidia-xrun doesn't do anything that isn't explained in https://wiki.archlinux.org/index.php/NV … ing_nvidia already. It simply redelegates that to a specifically started x server. None of these approaches have anything to do with/or have differences in handling the power management problem.

Offline

#33 2018-07-15 20:28:03

LazyLucretia
Member
Registered: 2016-01-28
Posts: 39

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

IngeniousDox wrote:

I had a systemfreeze indeed when running lspci, but that was before bios 1.2.2 / Linux 4.17. Right now without overrides I have no issue.

Anyways, michelesr, which acpi_calls are you using to turn the card off? Since I think bbswitch can turn on/off the system for me, I just have issues loading nvidia after I do. If we can switch to using ACPI calls (this is an option with bumblebee btw), then we can start using that.

I went ahead and tried using acpi_call to turn card off dGPU as described in here: https://wiki.archlinux.org/index.php/hy … _acpi_call And I got this output when I ran 'sudo /usr/share/acpi_call/examples/turn_off_gpu.sh':

Trying \_SB.PCI0.P0P1.VGA._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P2.VGA._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB_.PCI0.OVGA.ATPX: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB_.PCI0.OVGA.XTPX: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P3.PEGP._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P2.PEGP._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P1.PEGP._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.MXR0.MXM0._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG1.GFX0._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG0.GFX0.DOFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG1.GFX0.DOFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG0.PEGP._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
works!
Trying \_SB.PCI0.XVR0.Z01I.DGOF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEGR.GFX0._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG.VID._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG0.VID._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P2.DGPU._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P4.DGPU.DOFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.IXVE.IGPU.DGOF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.RP00.VGA._PS3: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.RP00.VGA.P3MO: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.GFX0.DSM._T_0: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.LPC.EC.PUBS._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P2.NVID._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.P0P2.VGA.PX02: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB_.PCI0.PEGP.DGFX._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB_.PCI0.VGA.PX02: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.PEG0.PEGP.SGOF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed
Trying \_SB.PCI0.AGP.VGA.PX02: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
failed

tl;dr:

Trying \_SB.PCI0.PEG0.PEGP._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
works!

and the rest has failed.
However, when I checked with powertop, my dGPU was still on. It's worth mentioning that I ran this script while I was using nvidia with bumblebee and without bbswitch. I will try without bumblebee or with nvidia-xrun as soon as possible.

Last edited by LazyLucretia (2018-07-15 20:30:29)

Offline

#34 2018-07-17 14:23:32

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Yes, V1del, nvidia-xrun or prime shouldn't make a difference, but we were discussing it because this thread was first named slightly more general at first. Then we changed the name since we thought our issue was with bbswitch. Which it in fact was, till we started using the pm-suspend branch. Perhaps it is time to rename it again. Since our issue now is with loading/unloading nvidia modules.

Anyways, back to business: Confirming that using bbswitch with the pm-suspend branch actually works for our XPS15 9570. I have just had time to check it. bbswitch correctly disables / enables the nvidia dGPU (checked with Powertop).

I'm using Bumblebee to disable it on boot. On top of that, I have TLP running and I don't even Blacklist the pci-e of the nvidia driver, it seems TLP isn't disabling the dGPU again after I turn it on with bbswitch, so this is working nicely together it seems.

Now I'm going to work on the module problem, since Bumblebee doesn't actually work yet. But I wanted to post, since you were trying out ACPI calls, and I don't think we need to look that way anymore.

Offline

#35 2018-07-22 12:07:16

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

tl;dr:

Trying \_SB.PCI0.PEG0.PEGP._OFF: /usr/share/acpi_call/examples/turn_off_gpu.sh: line 39: warning: command substitution: ignored null byte in input
works!

and the rest has failed.
However, when I checked with powertop, my dGPU was still on. It's worth mentioning that I ran this script while I was using nvidia with bumblebee and without bbswitch. I will try without bumblebee or with nvidia-xrun as soon as possible.

After recent updates, using this still works for me:

# echo "\_SB.PCI0.PEG0.PEGP._OFF" > /proc/acpi/call && cat /proc/acpi/call
0x0called

I can see a power consumption drop in powertop. In contrast with previous kernel and driver versions, now when you do this the nvidia module gets unloaded, and the kernel doesn't hang anymore on lspci or lshw, but the ACPI call to bring it on basically doesn't allow you to reuse the card even if it gets powered (you can see that from the power consumption that increases in powertop).

# echo "\_SB.PCI0.PEG0.PEGP._ON" > /proc/acpi/call && cat /proc/acpi/call
0xffalled%                

So far, after turning the card off, the only way to use it again for me is by rebooting.

You can also use bbswitch to turn off the card if the nvidia module is not loaded, but then when you turn it on again it will refuse to change from status D3. As far as I know, there's no way to put the card in a fully operating state without going through reboot.

Last edited by michelesr (2018-07-22 12:10:05)

Offline

#36 2018-07-22 21:23:37

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Thats sounds like the same behavior that bbswitch is getting with the PM-rework branch we are testing. I think it has to do with this:

[ 1604.981868] nvidia-nvlink: Nvlink Core is being initialized, major device number 237
[ 1604.982029] NVRM: This is a 64-bit BAR mapped above 4GB by the system
               NVRM: BIOS or the Linux kernel, but the PCI bridge
               NVRM: immediately upstream of this GPU does not define
               NVRM: a matching prefetchable memory window.
[ 1604.982030] NVRM: This may be due to a known Linux kernel bug.  Please
               NVRM: see the README section on 64-bit BARs for additional
               NVRM: information.

Like stated earlier in this forumthread, the PCI bridge code was changed, to do something different when you unload the dGPU modules. It doesn't seem to work even with the new BBswitch branch. So I think not using BBswitch at all is the best bet, and focus on just loading / unloading modules.

Anyways, to test just unloading the modules by hand I did the following:

  1. Build a kernel without IPMI support, since I couldn't unload the nvidia module with them on.

  2. I still couldn't unload the module. Even though I thought nothing else was using it. I stopped SDDM and was able to unload the module. And then I was able to unload/load. (So I'm not sure step 1 was needed, haven't had time to check)

  3. Unloading the module showed that dGPU went into suspend. Loading the module showed it came back up without issues.

  4. Created the xorg below, installed the xf86-video-dummy, and use xf86-video-intel instead of modesetting. I think modesetting was keeping the nvidia gpu active.

  5. Now I can use bumblebee with setting PMMethod=none. However, it still doesn't unload the nvidia modules after I use bumblebee. I think I might have to create a similar xorg.conf for bumblebee to use. I hope to find time for this during the week...but with this extreme heatwave I might just not want to tinker.

The xorg.conf:

Section "ServerLayout"
        Identifier      "Layout0"
        Screen          0 "intel"
        Inactive        "nvidia"
EndSection

Section "Monitor"
        Identifier      "Monitor0"
        Option          "DPMS"
EndSection

Section "Device"
        Identifier      "nvidia"
        Driver          "dummy"
        BusID           "PCI:1:0:0"
EndSection

Section "Device"
        Identifier      "intel"
        Driver          "intel"
#       Driver          "modesetting"
        Option          "TearFree" "true"
        Option          "DRI" "3"
        BusID           "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier      "nvidia"
        Device          "nvidia"
EndSection

Section "Screen"
        Identifier      "intel"
        Device          "intel"
        Monitor         "Monitor0"
EndSection

Offline

#37 2018-07-24 01:31:44

mony
Member
Registered: 2013-03-07
Posts: 32

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Try booting with "pcie_port_pm=off", and make sure you don't have any power saving tool that disables PCIe PM like "powertop --auto-tune" or TLP.

Offline

#38 2018-07-24 09:27:10

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

A dirty hack to disable the graphic card before Xorg starts is:

# echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
$ lspci | grep -i nvidia

This will hide the PCIe bus and prevent the nvidia module to be loaded.

To restore you can force a rescan:

# echo 1 > /sys/bus/pci/rescan
$ lspci | grep -i nvidia
1:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)

For some reason the rescan is able to restore the Nvidia card bus only if AC is plugged.

Last edited by michelesr (2018-07-24 10:16:28)

Offline

#39 2018-07-24 11:16:41

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

@michelesr that is because pm suspend probably suspends the bus on battery, but not on AC. On battery loading nvidia fails because the PCI bridge doesn't have state for the nvidia card (if I understand it correctly). It is also why the preferred method to disabling the nvidia gpu seems to be just unloading the nvidia modules, or making sure they don't get loaded in the first place. I figure it sets up the correct state, and allows the card to turn on / off correctly.

See: https://github.com/torvalds/linux/commit/abf92f86361b

I think bbswitch (and the acpi call?) actually disable the PCI port in a matter that doesn't go past that code, so the state is never saved. So on resuming the nvidia dGPU, it cannot restore the state, and the nvidia gpu give the error I showed again in the previous post.

Offline

#40 2018-07-24 11:33:33

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

@michelesr that is because pm suspend probably suspends the bus on battery, but not on AC. On battery loading nvidia fails because the PCI bridge doesn't have state for the nvidia card (if I understand it correctly). It is also why the preferred method to disabling the nvidia gpu seems to be just unloading the nvidia modules, or making sure they don't get loaded in the first place.

In my case I can't simply get rid of the nvidia module if it's loaded by X or Gnome... by disabling the bus I'm able to start X without loading the module, so the card won't power.

The best thing would be to find a way to tell Xorg not to load the module. Is there any X configuration that works with modesetting driver and allows you to load X without loading the nvidia module?

Offline

#41 2018-07-24 12:02:32

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I haven't found it, yet. I switched to using xf86-video-intel for now, with the Xorg configuration above. However, now I get black screen with after resume from hibernation, so I need to either fix that or find a way to not load nvidia with modesetting.

Offline

#42 2018-07-24 14:34:54

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

@michelesr that is because pm suspend probably suspends the bus on battery, but not on AC.

That could be the reason, although I'm not sure that pm suspend can control the device once the bus is removed from the kernel. It could be also the firmware that detects that the card is not used at all so it turns that off when on battery.

Offline

#43 2018-07-24 15:52:26

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Right, just my observations of the day:

- Modprobe -r works to unload the modules just fine. Even on the standard kernel (IPMI wasn't holding me back at all it seems, just modesetting)
- Optirun works, so does primusrun again. However they don't unload the modules after they are used.
- Switching to Bumblebee-git for the new method of unloading modules didn't help either.

I'm not sure what else to try to get Bumblebee to unload modules, so I might have to ask on IRC again.

Last edited by IngeniousDox (2018-07-24 16:01:36)

Offline

#44 2018-07-24 19:13:30

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Gnome shell will load the nvidia module even if you're using the xf86-video-intel driver.

https://bbs.archlinux.org/viewtopic.php?id=234531

Offline

#45 2018-07-25 10:05:11

IngeniousDox
Member
Registered: 2018-06-24
Posts: 25

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Even if you explicitly set nvidia to dummy? SDDM / xorg would start using the dGPU when I specified nothing. But setting it to dummy driver for that PCI:1:0:0 explicitly sets it to something else. Highlighting the part in the xorg.conf above to point out what I mean:

Section "Device"
        Identifier      "nvidia"
        Driver          "dummy"
        BusID           "PCI:1:0:0"
EndSection

Last edited by IngeniousDox (2018-07-25 10:35:57)

Offline

#46 2018-07-25 12:34:14

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

Even if you explicitly set nvidia to dummy?

Yes, that won't help cuz is a Gnome related behavior... I tried that with awesome wm and intel driver and the nvidia module doesn't get loaded.

Offline

#47 2018-07-25 14:06:50

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I'm trying to customize nvidia-xrun to use the bus remove/rescan method instead of using bbswitch:

Does anyone know how to make the rescan work on battery? If I could fix that this could be a proper workaround (at least for me), coupled with a systemd service to disable the bus at boot.

I tried disabling TLP and PM suspend from powertop, but that didn't help.

---

Edit: while I can confirm that the card gets turned off on battery if you remove the device (cuz I notice a power consumption drop), there's no way to confirm that while AC is plugged; the reason for which the card can be rescanned could simple be because is fully powered on AC. So in order to make sure to suspend that properly, you need to find a way to keep it loaded (and available in lspci) but with the nvidia module unloaded: this can be achieved by removing the bus before starting X, rescan again, and enable power management suspend for the card:

# before X start
sudo tee /sys/bus/pci/devices/0000:01:00.0/remove <<<1

# after X start
sudo tee /sys/bus/pci/rescan <<<1
sudo tee /sys/bus/pci/devices/0000:01:00.0/power/control <<<auto

Last edited by michelesr (2018-07-26 09:34:08)

Offline

#48 2018-08-05 11:58:44

spomeg
Member
Registered: 2017-07-28
Posts: 9

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

So if I wanted to just use the intel integrated graphics card without the nvidia card until bumblebee/bbswitch works properly, what would be the best way to do that in terms of package installation and configuration settings?

Offline

#49 2018-08-05 14:55:14

yaworski
Member
Registered: 2018-08-05
Posts: 41

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I have a fully upgraded Arch (at the moment of writing this) and I've just updated firmware to the latest 1.3.0 version, available on Dell's website. I don't know if this is because the new firmware or something has been upgraded earlier with pacman, but I've tested now with one of the methods described above.

I've set power control to "auto" for NVIDIA card:

echo auto | sudo tee /sys/bus/pci/devices/0000:01:00.0/power/control 

My system doesn't load nvidia module automatically (I'm using cinnamon with lightdm), so the card turns off. Previously I wasn't able to turn it back on by loading nvidia modules or changing the power control to "on". Both optirun and primusrun have been reporting error when trying to initialise the card. I'd have to reboot without setting the power control to "auto".

I've re-tested this after upgrading firmware and now bumblebee is able to successfully turn the card back on by loading nvidia modules and properly initialise the card. I've run some number of cycles of unloading nvidia modules and then running optirun/primusrun, all successful, while monitoring the powertop Device stats tab and the card switches between 0% and 100%. Also the battery power consumption drops significantly when the card powers down.

I haven't tried any other approach described here nor the bbswitch after the firmware upgrade.

---edit---

If I set the power control to auto for the NVIDIA card, then the nvidia module is not being loaded by xorg/lightdm/cinnamon. But if I change the power control to auto on system boot (by using /etc/tmpfiles.d or even my own systemd unit file which I've set to run after lightdm.service), then the module is loaded and can't be unloaded (I get "Module nvidia is in use" error).
Also if I set the power control manually and then logout and log back in, then the nvidia module is loaded automatically with the same issue that it can't be unloaded anymore.

Last edited by yaworski (2018-08-05 15:58:22)

Offline

#50 2018-08-05 19:09:57

michelesr
Member
Registered: 2016-02-04
Posts: 67

Re: [SOLVED] Dell XPS 9570 bbswitch not working, Nvdia won't power off/on

I've re-tested this after upgrading firmware and now bumblebee is able to successfully turn the card back on by loading nvidia modules and properly initialise the card.

I'm running bios version 1.3.0 and full up-to-date Arch system, but bbswitch still fails with the usual error (card refused to change power state).

If I set the power control to auto for the NVIDIA card, then the nvidia module is not being loaded by xorg/lightdm/cinnamon.

This doesn't work for me. If I start Xorg it will load the driver even if the card power control is set to "auto". I'm running GNOME.

Offline

Board footer

Powered by FluxBB