You are not logged in.

#76 2018-09-10 21:02:49

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

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

I opened one at Bumblebee and one at nvidia-xrun. So both bumblebee and nvidia-xrun simply don't use bbswitch. There are working solutions already for both, you can see it in this thread and on the bugtrackers.

Offline

#77 2018-09-11 05:39:44

OdinEidolon
Member
From: Belluno - Italy
Registered: 2011-01-31
Posts: 498

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

IngeniousDox wrote:

I opened one at Bumblebee and one at nvidia-xrun. So both bumblebee and nvidia-xrun simply don't use bbswitch. There are working solutions already for both, you can see it in this thread and on the bugtrackers.

Thanks. Can you link them here, also for other's use? There are many related issues on bumblebee github's and I'm not sure which one I should follow. To be honest some of them seem somewhat connected to the noob's eye.

In the case of this laptop bbswitch not working is an issue of bbswitch, or is it coming from bumblebee? Might collect some info and open a bug report for bbswitch just to make sure that the devs are aware of it.


Hardware: 2016 Dell XPS15 - matte FullHD - i5-6300HQ - 32GB DDR4 - Nvidia GTX960M - Samsung 840EVO 250GB SSD - 56Wh
Software: Plasma 5 - rEFInd - linux-ck - preload - prelink - verynice - psd - bumblebee

Offline

#78 2018-09-11 09:48:13

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

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

I believe it is already in this thread, but I'll do it again:

Bumblebee: https://github.com/Bumblebee-Project/Bu … issues/978

If you are not going to use bbswitch, it has to be changed in Bumblebee, someone has already done that, you can find the result in the pull request someone made: https://github.com/Bumblebee-Project/Bumblebee/pull/98

Nvidia-xrun: https://github.com/Witko/nvidia-xrun/issues/67
Fincer's nvidia-xrun: https://github.com/Bumblebee-Project/Bu … issues/978

michelesr created it for nvidia-xrun: https://github.com/michelesr/nvidia-xru … vidia-xrun

Offline

#79 2018-09-11 09:48:54

OdinEidolon
Member
From: Belluno - Italy
Registered: 2011-01-31
Posts: 498

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

IngeniousDox wrote:

I believe it is already in this thread, but I'll do it again:

Bumblebee: https://github.com/Bumblebee-Project/Bu … issues/978

If you are not going to use bbswitch, it has to be changed in Bumblebee, someone has already done that, you can find the result in the pull request someone made: https://github.com/Bumblebee-Project/Bumblebee/pull/98

Nvidia-xrun: https://github.com/Witko/nvidia-xrun/issues/67
Fincer's nvidia-xrun: https://github.com/Bumblebee-Project/Bu … issues/978

michelesr created it for nvidia-xrun: https://github.com/michelesr/nvidia-xru … vidia-xrun

Thanks!


Hardware: 2016 Dell XPS15 - matte FullHD - i5-6300HQ - 32GB DDR4 - Nvidia GTX960M - Samsung 840EVO 250GB SSD - 56Wh
Software: Plasma 5 - rEFInd - linux-ck - preload - prelink - verynice - psd - bumblebee

Offline

#80 2018-09-12 12:07:27

maxiix3
Member
Registered: 2018-09-12
Posts: 2

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

yaworski wrote:

I've found a way to prevent Xorg from loading nvidia module on boot. I've created a /etc/X11/xorg.conf.d/01-noautogpu.conf file with

Section "ServerFlags"
	Option "AutoAddGPU" "off"
EndSection

Then the iGPU needs to be added manually. I've created a /etc/X11/xorg.conf.d/20-intel.conf file with:

Section "Device"
	Identifier "Intel Graphics"
	Driver "intel"
EndSection

I've tested this multiple times and now the nvidia module is not loaded by the Xorg at all.

I don't use bbswitch. Instead I've created /etc/tmpfiles.d/nvidia_pm.conf file with:

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

This switches on the kernel power management for the NVidia card. It depends on whether the nvidia module is loaded or not. The bumblebee loads the module, turning on the card when the optirun/primusrun is executed, but unfortunately it doesn't even try to unload it if bbswitch is not installed. But after manually unloading the module, the card turns off. The card is turned off after boot by default.

I have a question about this part. Intel drivers is installed with xf86-video-intel, right? Your solution work here only when the xf86-video-intel package is uninstalled. Dell xps 15 9570 her also. I'm using the forceunload branch you made a pullrequest with.
Many of you would ask why I want the xf86-video-intel package installed, but it looks like it is the only way my computer gets under 10W with powertop.
With xf86-video-intel I somehow get the known «pci 0000:01:00.0: Refused to change power state, currently in D3». Without that I understand how this should do something with the nvidia card.

Edit: it looks like xorg starts starts the nvidia driver if I don't mention a driver in 20-intel.conf. without xf86-video-intel the intel module is not found and I can't start a x. If I delete the 20-intel.conf X starts, but with nvidia module loaded

Last edited by maxiix3 (2018-09-12 19:16:14)

Offline

#81 2018-09-12 20:16:49

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

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

maxiix3 wrote:
yaworski wrote:

I've found a way to prevent Xorg from loading nvidia module on boot. I've created a /etc/X11/xorg.conf.d/01-noautogpu.conf file with

Section "ServerFlags"
	Option "AutoAddGPU" "off"
EndSection

Then the iGPU needs to be added manually. I've created a /etc/X11/xorg.conf.d/20-intel.conf file with:

Section "Device"
	Identifier "Intel Graphics"
	Driver "intel"
EndSection

I've tested this multiple times and now the nvidia module is not loaded by the Xorg at all.

I don't use bbswitch. Instead I've created /etc/tmpfiles.d/nvidia_pm.conf file with:

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

This switches on the kernel power management for the NVidia card. It depends on whether the nvidia module is loaded or not. The bumblebee loads the module, turning on the card when the optirun/primusrun is executed, but unfortunately it doesn't even try to unload it if bbswitch is not installed. But after manually unloading the module, the card turns off. The card is turned off after boot by default.

I have a question about this part. Intel drivers is installed with xf86-video-intel, right? Your solution work here only when the xf86-video-intel package is uninstalled. Dell xps 15 9570 her also. I'm using the forceunload branch you made a pullrequest with.
Many of you would ask why I want the xf86-video-intel package installed, but it looks like it is the only way my computer gets under 10W with powertop.
With xf86-video-intel I somehow get the known «pci 0000:01:00.0: Refused to change power state, currently in D3». Without that I understand how this should do something with the nvidia card.

Edit: it looks like xorg starts starts the nvidia driver if I don't mention a driver in 20-intel.conf. without xf86-video-intel the intel module is not found and I can't start a x. If I delete the 20-intel.conf X starts, but with nvidia module loaded

I have the xf86-video-intel driver installed. The error you're getting (refused to change power state) is caused by bbswitch, which you probably still have installed. Either uninstall it or blacklist it. I've started playing with nvidia-xrun which requires bbswitch to be installed, so I've had to blacklist it in the end by creating a file /etc/modprobe.d/bbswitch.conf with following content:

blacklist bbswitch
install bbswitch /usr/bin/false

The install line is needed because nvidia-xrun loads the bbswitch anyway. If you don't want to play with nvidia-xrun, then just uninstall bbswitch.

Offline

#82 2018-09-12 20:28:04

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

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

BTW, a little off topic question: what GPU clock speeds do you get on dGPU? I've opened nvidia-settings while running unigine-heaven benchmark and the GPU clock seems to oscillate around 370 MHz. Only sometimes goes as high as 410 MHz. The performance level in powermizer is set to 3. I also get the same behaviour when using nvidia-xrun with whole session running on dGPU. My system is fully up to date (nvidia 396.54).

Last edited by yaworski (2018-09-12 20:29:17)

Offline

#83 2018-09-12 23:19:36

supremecoconut
Member
Registered: 2018-05-06
Posts: 11

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

And what if I only needed to make it work with CUDA, for tensorflow scripts? What would be the best way?

Offline

#84 2018-09-17 06:44:40

maxiix3
Member
Registered: 2018-09-12
Posts: 2

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

yaworski wrote:
maxiix3 wrote:
yaworski wrote:

I've found a way to prevent Xorg from loading nvidia module on boot. I've created a /etc/X11/xorg.conf.d/01-noautogpu.conf file with

Section "ServerFlags"
	Option "AutoAddGPU" "off"
EndSection

Then the iGPU needs to be added manually. I've created a /etc/X11/xorg.conf.d/20-intel.conf file with:

Section "Device"
	Identifier "Intel Graphics"
	Driver "intel"
EndSection

I've tested this multiple times and now the nvidia module is not loaded by the Xorg at all.

I don't use bbswitch. Instead I've created /etc/tmpfiles.d/nvidia_pm.conf file with:

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

This switches on the kernel power management for the NVidia card. It depends on whether the nvidia module is loaded or not. The bumblebee loads the module, turning on the card when the optirun/primusrun is executed, but unfortunately it doesn't even try to unload it if bbswitch is not installed. But after manually unloading the module, the card turns off. The card is turned off after boot by default.

I have a question about this part. Intel drivers is installed with xf86-video-intel, right? Your solution work here only when the xf86-video-intel package is uninstalled. Dell xps 15 9570 her also. I'm using the forceunload branch you made a pullrequest with.
Many of you would ask why I want the xf86-video-intel package installed, but it looks like it is the only way my computer gets under 10W with powertop.
With xf86-video-intel I somehow get the known «pci 0000:01:00.0: Refused to change power state, currently in D3». Without that I understand how this should do something with the nvidia card.

Edit: it looks like xorg starts starts the nvidia driver if I don't mention a driver in 20-intel.conf. without xf86-video-intel the intel module is not found and I can't start a x. If I delete the 20-intel.conf X starts, but with nvidia module loaded

I have the xf86-video-intel driver installed. The error you're getting (refused to change power state) is caused by bbswitch, which you probably still have installed. Either uninstall it or blacklist it. I've started playing with nvidia-xrun which requires bbswitch to be installed, so I've had to blacklist it in the end by creating a file /etc/modprobe.d/bbswitch.conf with following content:

blacklist bbswitch
install bbswitch /usr/bin/false

The install line is needed because nvidia-xrun loads the bbswitch anyway. If you don't want to play with nvidia-xrun, then just uninstall bbswitch.

Never understood why it didn't work earlier, uninstalled bbswitch and everything and it didn't work. After a clean new arch install I had the same problem. I gave up. Tried again a day later and it worked, tried later the same day, it had stop working again. Started to wonder if I have to connect the computer to a charger? even if I disable tlp I get the same error. Big part of my testing have been at home without a charger connected.

About the clock speed I get a lot higher than you! I ran unigine-heaven and it oscillated around 1615-1620 MHz (???). Looks like they gave me the normal gtx1050 ti and not the MAX-Q version?

Edit: A new restart fixed it and made it work on battery....

Last edited by maxiix3 (2018-09-17 07:00:23)

Offline

#85 2018-09-18 07:49:50

setzer22
Member
Registered: 2014-07-26
Posts: 47

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

I can confirm the exact same problem happens on the new Dell G5 15 laptop. I was able to fix the issue by following the suggestions in this thread. Now I can use optirun/primusrun/nvidia-xrun and the nvidia card will get stopped when it's not necessary anymore. I'll leave a summary of the steps I followed because it took me a while to figure them out by just reading the thread.

- Removed bbswitch from the system
- Installed the forceunload branch of https://github.com/yawor/Bumblebee, replacing bumblebee from the official repositories. To do so, I used the following PKGBUILD adapted from AUR bbswithch-git: https://paste.pound-python.org/show/df1 … I4AzFxscj/
- Installed michelesr fork of nvidia-xrun using the PKGBUILD: https://paste.pound-python.org/show/Uax … Ve5U11ixm/
- Followed yaworski's suggestions, creating two files in xorg.conf.d and another in  tmpfiles.d, quoted below:

I've found a way to prevent Xorg from loading nvidia module on boot. I've created a /etc/X11/xorg.conf.d/01-noautogpu.conf file with

Section "ServerFlags"
    Option "AutoAddGPU" "off"
EndSection

Then the iGPU needs to be added manually. I've created a /etc/X11/xorg.conf.d/20-intel.conf file with:

Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
EndSection

I've tested this multiple times and now the nvidia module is not loaded by the Xorg at all.

I don't use bbswitch. Instead I've created /etc/tmpfiles.d/nvidia_pm.conf file with:

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

This switches on the kernel power management for the NVidia card. It depends on whether the nvidia module is loaded or not. The bumblebee loads the module, turning on the card when the optirun/primusrun is executed, but unfortunately it doesn't even try to unload it if bbswitch is not installed. But after manually unloading the module, the card turns off. The card is turned off after boot by default.

Offline

#86 2018-10-07 10:29:54

cdutsov
Member
Registered: 2018-10-07
Posts: 11

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

I have followed all the steps from the suggestions in the thread. That is:

-Removed bbswitch, installed forceunload branch of yawor's Bumblebee fork and created the xorg.conf.d and tmpfiles.d files. I see that this thread is for  Dell XPS 15 9570 laptops, but I seem to have the same problem on my Asus N580VD laptop with Nvidia GTX 1050 card. I have tried all possible packages: nvidia, nvidia-dkms, nvidia-39xx but haven't managed to run anything with optirun. I get the following errors in dmesg after trying to start optirun:

[  156.922085] ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20180531/nsarguments-66)
[  160.922402] NVRM: RmInitAdapter failed! (0x31:0xffff:842)
[  160.922493] NVRM: rm_init_adapter failed for device bearing minor number 0
[  168.651853] NVRM: RmInitAdapter failed! (0x31:0xffff:842)
[  168.651899] NVRM: rm_init_adapter failed for device bearing minor number 0

I have also tried all variations of the kernel parameters: rcutree.rcu_idle_gp_delay=1 pcie_port_pm=off pcie_aspm=force modeprobe.blacklist=nouveau acpi_osi=Linux acpi=force acpi_enforce_resources=lax.
No matter what I try I get the following error:

118 [   168.643] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0.  Please
119 [   168.643] (EE) NVIDIA(GPU-0):     check your system's kernel log for additional error
120 [   168.643] (EE) NVIDIA(GPU-0):     messages and refer to Chapter 8: Common Problems in the
121 [   168.643] (EE) NVIDIA(GPU-0):     README for additional information.
122 [   168.643] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
123 [   168.643] (EE) NVIDIA(0): Failing initialization of X screen 0

Could you please help me understand whats going on. Thanks!

PS: sorry for invading the thread with my Asus, but it seems to have similar hardware.

Offline

#87 2018-10-19 08:39:44

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

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

yaworski wrote:

I've found a way to prevent Xorg from loading nvidia module on boot. I've created a /etc/X11/xorg.conf.d/01-noautogpu.conf file with

Section "ServerFlags"
	Option "AutoAddGPU" "off"
EndSection

Then the iGPU needs to be added manually. I've created a /etc/X11/xorg.conf.d/20-intel.conf file with:

Section "Device"
	Identifier "Intel Graphics"
	Driver "intel"
EndSection

'
I've tested this multiple times and now the nvidia module is not loaded by the Xorg at all.

I don't use bbswitch. Instead I've created /etc/tmpfiles.d/nvidia_pm.conf file with:

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

This switches on the kernel power management for the NVidia card. It depends on whether the nvidia module is loaded or not. The bumblebee loads the module, turning on the card when the optirun/primusrun is executed, but unfortunately it doesn't even try to unload it if bbswitch is not installed. But after manually unloading the module, the card turns off. The card is turned off after boot by default.

Unfortunately, this did not work for me. Nvidia is still loaded at boot. I'm using forceunload branch, xf86-video-intel and sddm. No bbswitch, tlp or nvidia-xrun is installed.

Update: I disabled SDDM and booted into a tty. Nvidia GPU was off. I started SDDM with 'systemctl start sddm', Nvidia was still off. Then I logged in to Gnome and gpu immediately turned on. Also tried logging in to Plasma, same result. I logged out, switched to tty, stopped sddm and card was still on. Had to manually unload nvidia with 'modprobe -r nvidia' to turn it off.

Update 2: I tried uninstalling xf86-video-intel. Now sddm does not start. 'Failed to read display number from pipe' error popped up in journalctl.

Update 3: I installed and logged in to cinnamon desktop. This time, nvidia module was not loaded and NVIDIA usage in powertop was 0%. I do not understand why there is a difference like this between Gnome/Plasma and Cinnamon.

Last edited by LazyLucretia (2018-10-21 12:11:28)

Offline

#88 2018-10-21 13:16:11

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

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

yaworski wrote:

Ok, I've rewritten my modification to Bumblebee. Instead of providing a dummy PM method like before, I've added a AlwaysUnloadKernelDriver configuration option, which should be added to driver-nvidia section in bumblebee.conf. It takes true or false. If not present or false, then Bumblebee works as before. If true, then Bumblebee tries to unload the driver even if there's no active PM method (for example no bbswitch installed in the system). This version is in forceunload branch in my fork. I've also created a pull request against the develop branch of the official Bumblebee git repo:
https://github.com/Bumblebee-Project/Bumblebee/pull/983
I've also referenced this thread in the PR.

Even though I got the driver to be unloaded on boot under cinnamon, I still cannot use Bumblebee. I installed this forceunload branch, added 'AlwaysUnloadKernelDriver=true' to /etc/bumblebee/bumblebee.conf and tried to run 'optirun glxgears'. Same infamous '[ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0.' error popped up and the nvidia module was still loaded. I was able to unload it manually with 'modprobe -r nvidia'.

'journalctl -xe | grep bumblebeed' :

-- Subject: Unit bumblebeed.service has finished start-up
-- Unit bumblebeed.service has finished starting up.
Eki 21 14:14:31 umut-xps-15 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bumblebeed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Eki 21 14:14:31 umut-xps-15 bumblebeed[507]: Module 'bbswitch' not found.
Eki 21 14:14:31 umut-xps-15 bumblebeed[507]: No switching method available. The dedicated card will always be on.
Eki 21 14:14:31 umut-xps-15 bumblebeed[507]: /usr/bin/bumblebeed 3.2.1-54-g554e84e started
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (WW) Warning, couldn't open module mouse
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0.  Please
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) NVIDIA(GPU-0):     check your system's kernel log for additional error
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) NVIDIA(GPU-0):     messages and refer to Chapter 8: Common Problems in the
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) NVIDIA(GPU-0):     README for additional information.
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) NVIDIA(0): Failing initialization of X screen 0
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) Screen(s) found, but none have a usable configuration.
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE)
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) no screens found(EE)
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE)
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE)
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: [XORG] (EE) Server terminated with error (1). Closing log file.
Eki 21 14:29:35 umut-xps-15 bumblebeed[507]: X did not start properly

(partial) dmesg output :

[  908.168168] ipmi message handler version 39.2
[  908.171132] ipmi device interface
[  908.188882] audit: type=1130 audit(1540121374.328:55): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  908.188901] audit: type=1131 audit(1540121374.328:56): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  908.255113] nvidia: module license 'NVIDIA' taints kernel.
[  908.255114] Disabling lock debugging due to kernel taint
[  908.267491] nvidia-nvlink: Nvlink Core is being initialized, major device number 237
[  908.415294] pci 0000:01:00.0: Refused to change power state, currently in D3
[  908.460908] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[  908.561227] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  410.57  Tue Sep 18 23:25:09 CDT 2018 (using threaded interrupts)
[  908.676154] ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20180531/nsarguments-66)
[  909.094292] NVRM: RmInitAdapter failed! (0x26:0xffff:1125)
[  909.094356] NVRM: rm_init_adapter failed for device bearing minor number 0
[ 1137.050154] nvidia-nvlink: Unregistered the Nvlink Core, major device number 237

/var/log/Xorg.8.log :

# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d
# Xorg binary to run
XorgBinary=Xorg

## Client options. Will take effect on the next optirun executed.
[optirun]
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
Bridge=auto
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
VGLTransport=proxy
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
PrimusLibraryPath=/usr/lib/primus:/usr/lib32/primus
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?
AllowFallbackToIGC=false


# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia
PMMethod=auto
AlwaysUnloadKernelDriver=true
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia:/usr/lib32/nvidia:/usr/lib:/usr/lib32
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia/xorg/,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

/etc/bumblebee/bumblebee.conf :

# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d
# Xorg binary to run
XorgBinary=Xorg

## Client options. Will take effect on the next optirun executed.
[optirun]
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
Bridge=auto
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
VGLTransport=proxy
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
PrimusLibraryPath=/usr/lib/primus:/usr/lib32/primus
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?
AllowFallbackToIGC=false


# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia
PMMethod=auto
AlwaysUnloadKernelDriver=true
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia:/usr/lib32/nvidia:/usr/lib:/usr/lib32
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia/xorg/,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

Offline

#89 2018-10-23 14:00:17

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

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

It seems that an Arch Wiki entry for this laptop has been created since I opened this thread. https://wiki.archlinux.org/index.php/Dell_XPS_15_9570
I configured my laptop to use the exact same optimus configuration given in this wiki page. Now, nvidia driver is loaded all the time but the wiki suggests that "even if the driver is loaded power saving still works.". Powertop reports a discharge rate around 5.5 Watts when the laptop is completely idle other than running a DE, termial and powertop. When I started to fiddle with it a little, discharge rate had increased to 8-10 Watts, it jumped around in a wide range of 8-20 Watts(usually closer to 8-10) when I started using Firefox and it jumped up to above 55+ Watts when I ran 'optirun glxspheres64'. Thus, I'm guessing that power savings really do work. However, I need to compare this to the case when I load and unload nvidia drivers manually to be sure that this is the optimal behaviour.

Update: I did the comparison and results are bad... On full charge with regular browsing in Firefox, both Windows and Arch with Nvidia disabled reports 11+ hours of remaining battery while Arch with Nvidia+Bumblebee reports 7-8 hours. This whole situation really depresses me, it seems like there is really no way of using this computers dGPU with decent power consumption.

Last edited by LazyLucretia (2018-10-30 19:11:48)

Offline

#90 2018-10-25 17:33:18

ac1dg
Member
Registered: 2018-10-25
Posts: 5

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

The config in the wiki doesn't work for me. I still have about 10 Watts idling. The only solution right now is uninstalling nvidia and setting the nvidia device to "good" in powertop. About 6 Watts is reported right now, writing this on Chrome. However, when I want to use the dedicated Nvidia card, I first have to install nvidia again and restart. Unloading nvidia is not possible, since the module reports being used by xorg and gnome-shell... Any suggestions?

Offline

#91 2018-10-29 16:59:07

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

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

ac1dg wrote:

The config in the wiki doesn't work for me. I still have about 10 Watts idling. The only solution right now is uninstalling nvidia and setting the nvidia device to "good" in powertop. About 6 Watts is reported right now, writing this on Chrome. However, when I want to use the dedicated Nvidia card, I first have to install nvidia again and restart. Unloading nvidia is not possible, since the module reports being used by xorg and gnome-shell... Any suggestions?

In theory, you should be able to just log-out, unload nvidia(from tty), load nouveau and log back in without rebooting.

Edit: I just tried, you have to kill (systemctl stop) your desktop manager after log-out and enable PCI powersave (you can tune it in powertop) after log-in. However, loading nvidia back does not work, it says 'no such device' even if you disable PCI powersave.

Last edited by LazyLucretia (2018-10-30 19:06:57)

Offline

#92 2018-11-02 09:19:23

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

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

Okay so I got this working like this:

- Set kernel parameter pcie_port_pm=off
- Install yaworski's bumblebee-forceunload, using bumblebee-git and PKGBUILD given above
- set PMmethod=none and AlwaysUnloadKernelDriver=true in bumblebee config
- install nvidia
- create /etc/X11/xorg.conf.d/01-noautogpu.conf, /etc/X11/xorg.conf.d/20-intel.conf and /etc/tmpfiles.d/nvidia_pm.conf as suggested above by yaworski.
- Install tlp, add the graphic card to RUNTIME_PM_BLACKLIST as suggested in Arch Wiki (this is not required, I just did it to compensate power waste caused by setting pcie_port_pm=off) (you may also want to disable audio powersave of tlp if you experience buzzing sound from headphones)
- reboot
Now this works as expected but here is the issue: Since we set pcie_port_pm=off in kernel parameters, all those pcie ports draws a lot of power and total power consumption when idle remains around 9-11 Watts. If I just follow instructions given in Arch Wiki and set pcie_port_pm=on while using bumblebee from repos, I get similar power consumption. Power saved by disabling dGPU == power lost by setting pci_port_pm=off . And if I try to use yaworski's bumblebee-forceunload with pcie_port_pm=on , power consumption drops to 4 Watts on idle but optirun does not work.

Offline

#93 2018-11-02 12:10:29

ac1dg
Member
Registered: 2018-10-25
Posts: 5

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

LazyLucretia wrote:

Okay so I got this working like this:

- Set kernel parameter pcie_port_pm=off
- Install yaworski's bumblebee-forceunload, using bumblebee-git and PKGBUILD given above
- set PMmethod=none and AlwaysUnloadKernelDriver=true in bumblebee config
- install nvidia
- create /etc/X11/xorg.conf.d/01-noautogpu.conf, /etc/X11/xorg.conf.d/20-intel.conf and /etc/tmpfiles.d/nvidia_pm.conf as suggested above by yaworski.
- Install tlp, add the graphic card to RUNTIME_PM_BLACKLIST as suggested in Arch Wiki (this is not required, I just did it to compensate power waste caused by setting pcie_port_pm=off) (you may also want to disable audio powersave of tlp if you experience buzzing sound from headphones)
- reboot
Now this works as expected but here is the issue: Since we set pcie_port_pm=off in kernel parameters, all those pcie ports draws a lot of power and total power consumption when idle remains around 9-11 Watts. If I just follow instructions given in Arch Wiki and set pcie_port_pm=on while using bumblebee from repos, I get similar power consumption. Power saved by disabling dGPU == power lost by setting pci_port_pm=off . And if I try to use yaworski's bumblebee-forceunload with pcie_port_pm=on , power consumption drops to 4 Watts on idle but optirun does not work.

Same for me. Either powersave works with idling at ~5 Watts, but optirun doesn't, or nvidia works with optirun, but idling consumes more than 10 Watts.

Edit: I am currently leaving nvidia loaded and consuming more power, since the annoying fan on-off torture seems to be gone with nvidia loaded.

Last edited by ac1dg (2018-11-02 12:15:33)

Offline

#94 2018-11-03 14:26:32

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

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

Alright I gave nvidia-xrun a shot and it seems like a good solution until bumblebee is fixed for this model. Here is what I did:
- Removed pcie_port_pm=off from kernel parameters (I think this parameter defaults to 'on' when not supplied to kernel)
- Uninstalled bumblebee(or bumblebee-forceunload) and bbswitch if they are installed.
- Installed michelesr fork of nvidia-xrun using the PKGBUILD: https://paste.pound-python.org/show/Uax … Ve5U11ixm/ (as suggested by setzer22), this should also install nvidia drivers as dependencies.
- Installed xf86-video-intel driver.
- Create /etc/X11/xorg.conf.d/01-noautogpu.conf, /etc/X11/xorg.conf.d/20-intel.conf and /etc/tmpfiles.d/nvidia_pm.conf as suggested above by yaworski.
/etc/X11/xorg.conf.d/01-noautogpu.conf :

Section "ServerFlags"
	Option "AutoAddGPU" "off"
EndSection

/etc/X11/xorg.conf.d/20-intel.conf :

Section "Device"
	Identifier "Intel Graphics"
	Driver "intel"
EndSection

/etc/tmpfiles.d/nvidia_pm.conf :

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

- Now since bumblebee is uninstalled, /usr/lib/modprobe.d/bumblebee.conf file is also gone but we need it to stop nvidia drivers from loading at boot. Create /usr/lib/modprobe.d/bumblebee.conf with following contents:

blacklist nvidia
blacklist nvidia-drm
blacklist nvidia-modeset
blacklist nvidia-uvm
blacklist nouveau

- Reboot.
Now nvidia or nouveau modules should not be loaded on boot and Nvidia dGPU should be off. Loaded modules can be checked with 'lsmod | less' and power usage of dGPU and other system components can be checked with powertop. Power drain while idling should be below 10 Watts. Mine is around 4 W.
In order to use dGPU:
- Switch to another tty with Ctrl+Alt+F2 or another F key.
- Run 'nvidia-xrun <application>' and enter your password. I recommend installing a basic window manager such as openbox and running 'nvidia-xrun openbox' to be able to run and switch between apps in the same tty.
- In my case, when I try to run nvidia-xrun first time after boot, it throws some errors and quits after a few seconds. Run it again, it should work this time.
- When done, quit the applicatin. After entering root password for another time, it should unload modules and switch off the card.
- Exit tty (Ctrl+Alt+F1 or some other F key. Switching between tty's is also possible while nvidia-xrun is running.)

Last edited by LazyLucretia (2018-11-03 14:27:13)

Offline

#95 2018-11-12 07:50:29

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

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

Hi,

I'm sorry, I didn't get any notifications that the thread is still active.

LazyLucretia, I don't use pcie_port_pm=off in my configuration. I don't know why gnome loaded the nvidia driver in your case. The AutoAddGPU option (together with the explicit intel driver definition) in the X-Server should prevent that. I don't use gnome, but I had the same issue in cinnamon and this option helped with that.
What is changed in the michelesr's fork of nvidia-xrun? Is it only that it doesn't depend on bbswitch? Or is it also something else? I'm able to use normal nvidia-xrun (which also installs bbswitch), but I've added bbswitch to blacklist with a /etc/modprobe.d/bbswitch.conf file:

blacklist bbswitch
install bbswitch /usr/bin/false

This way the system always fails to load the bbswitch.
BTW before I start nvidia-xrun, I'm logging out of my normal session on intel. That way I'm able to use the same cinnamon session under nvidia-xrun, with all my settings, apps, etc. There's no problem running chrome for example.

I have a few observations:
- I'm able to use nvidia right after the full boot, but after the sleep or hibernation it doesn't work anymore.
- I'm using an USB-C dock with power delivery (made by i-tec from Czech Republic). It's able to provide up to 65 W of power. I've had to disable power source warning in the UEFI, as the laptop warns that the power adapter is too weak. Normally, I don't have any issues at all (no performance issues in day to day operation). But there's one negative side effect. If I start power on the laptop being powered by the dock, it blocks the nvidia's GPU clock max frequency to about 400 MHz (doesn't matter if I use bumblebee or nvidia-xrun). I need to power on the laptop on the provided dedicated power supply to unlock the full range of GPU clock frequencies, buf after that it works even if I unplug it and leave it using only the dock. My colleague bought a Thunderbolt3 dock from the same company, which is able to deliver up to 85 W. According to the website, the TB3 dock is not officially supported on Linux, but I'll give it a try this week and test if the laptop still caps the GPU clock.

BTW I'm using the latest firmware version: 1.5.0.

Last edited by yaworski (2018-11-12 07:51:09)

Offline

#96 2018-11-13 19:27:18

Osleg
Member
Registered: 2013-11-13
Posts: 6

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

In regard nvidia modules are being loaded automatically, I noticed that this happens when I have `nvidia` modules installed but it never happens with `nvidia-380xx` modules.
I also found similar issues over the internet

Offline

#97 2018-11-26 22:59:12

TheGhostface
Member
Registered: 2018-11-26
Posts: 1

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

LazyLucretia wrote:

Alright I gave nvidia-xrun a shot and it seems like a good solution until bumblebee is fixed for this model. Here is what I did:
- Removed pcie_port_pm=off from kernel parameters (I think this parameter defaults to 'on' when not supplied to kernel)
- Uninstalled bumblebee(or bumblebee-forceunload) and bbswitch if they are installed.
- Installed michelesr fork of nvidia-xrun using the PKGBUILD: https://paste.pound-python.org/show/Uax … Ve5U11ixm/ (as suggested by setzer22), this should also install nvidia drivers as dependencies.
- Installed xf86-video-intel driver.
- Create /etc/X11/xorg.conf.d/01-noautogpu.conf, /etc/X11/xorg.conf.d/20-intel.conf and /etc/tmpfiles.d/nvidia_pm.conf as suggested above by yaworski.
/etc/X11/xorg.conf.d/01-noautogpu.conf :

Section "ServerFlags"
	Option "AutoAddGPU" "off"
EndSection

/etc/X11/xorg.conf.d/20-intel.conf :

Section "Device"
	Identifier "Intel Graphics"
	Driver "intel"
EndSection

/etc/tmpfiles.d/nvidia_pm.conf :

w /sys/bus/pci/devices/0000:01:00.0/power/control - - - - auto

- Now since bumblebee is uninstalled, /usr/lib/modprobe.d/bumblebee.conf file is also gone but we need it to stop nvidia drivers from loading at boot. Create /usr/lib/modprobe.d/bumblebee.conf with following contents:

blacklist nvidia
blacklist nvidia-drm
blacklist nvidia-modeset
blacklist nvidia-uvm
blacklist nouveau

- Reboot.
Now nvidia or nouveau modules should not be loaded on boot and Nvidia dGPU should be off. Loaded modules can be checked with 'lsmod | less' and power usage of dGPU and other system components can be checked with powertop. Power drain while idling should be below 10 Watts. Mine is around 4 W.
In order to use dGPU:
- Switch to another tty with Ctrl+Alt+F2 or another F key.
- Run 'nvidia-xrun <application>' and enter your password. I recommend installing a basic window manager such as openbox and running 'nvidia-xrun openbox' to be able to run and switch between apps in the same tty.
- In my case, when I try to run nvidia-xrun first time after boot, it throws some errors and quits after a few seconds. Run it again, it should work this time.
- When done, quit the applicatin. After entering root password for another time, it should unload modules and switch off the card.
- Exit tty (Ctrl+Alt+F1 or some other F key. Switching between tty's is also possible while nvidia-xrun is running.)

I did all of this but optirun was still not working, nvidia-xrun did however.
I managed to get optirun to work without nvidia-xrun or a separate xserver by taking a look at it and using a modified wrapper script based on nvidia-xrun.

Put this somewhere and make it executeable /usr/bin/nvrun, then call like nvrun glxspheres64

If you don't use the patched autounload bumblebee build re-add the unloading of kernel modules at the end.
For me this works fine now as verified by powertop - consumption returns to ~5W when the script terminates and glxspheres executes on the nvidia card.

Maybe it helps someone else as well.

https://gist.github.com/ghostface/dce71 … 80b05df363

Offline

#98 2018-11-27 16:18:27

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

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

SOLVED(kinda): I ditched Bumblebee in favor of nvidia-xrun. nvidia-xrun also utilizes bbswitch so I installed a fork of nvidia-xrun made by michelesr that uses kernel power management instead of bbswitch.

I'm glad to hear that... I'll create an AUR package and possibly update the Arch Wiki page for the Dell XPS 9570 (although I think the solution can also work on 9560, assuming they have the same problem with bbswitch).

EDIT: I published the nvidia-xrun-pm pacakge on AUR, so it can helps users to achieve a working setup easily: feedback is appreciated.

Last edited by michelesr (2018-11-28 19:01:41)

Offline

#99 2018-11-29 01:48:38

xenvre
Member
Registered: 2018-11-29
Posts: 1

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

Hi everybody! I started using a Dell Precision 5530 (should be very similar to the XPS 9570, apart from having a Nvidia Quadro instead of the 1050) from some days. I bought the version with Ubuntu 16.04 pre-installed and I was able to obtain the recovery iso customized by Dell and containing several 'post installation' scripts that install several .debs. Part of these are those required to run the Nvidia card.

Using Ubuntu the consumption in idle is 4W circa with the Intel card. Using the Nvidia applet is possible to switch to the dGPU (however it requires a complete restart of the machine).

Do you think posting here the name of the debs involved in the installation can be useful to understand what Dell did to have a working configuration?

Last edited by xenvre (2018-11-29 10:08:42)

Offline

#100 2019-01-07 23:55:34

tyrells
Member
Registered: 2019-01-07
Posts: 2

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

I have been playing around with this a bit and have noticed something:

In order for the NVIDIA card (PCI 01:00.0) to power on correctly, the PCIe controller (PCI 00:01.0) also needs to be set to 'power/control' = 'on'. If the PCIe power/control is set to 'auto', the NVIDIA driver will not load correctly, and you will get the following error in dmesg:

pci 0000:01:00.0: Refused to change power state, currently in D3

Based on TheGhostface's post above, I am using the following commands to switch the 'power/control' of both the NVIDIA card and PCIe controller from 'auto' to 'on'

Contents of opti-start.sh

#!/bin/sh

# remove NVIDIA card (currently in power/control = auto)
echo -n 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
sleep 1
# change PCIe power control
echo -n on > /sys/bus/pci/devices/0000\:00\:01.0/power/control
sleep 1
# rescan for NVIDIA card (defaults to power/control = on)
echo -n 1 > /sys/bus/pci/rescan

Once this is run, optirun works correctly.

In order to turn off the NVIDIA card and PCIe bus again, I use the following opti-stop.sh script:

#!/bin/sh

# unload drivers
modprobe -r nvidia_drm
modprobe -r nvidia_uvm
modprobe -r nvidia_modeset
modprobe -r nvidia

# change NVIDIA card power control
echo -n auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control
sleep 1
# change PCIe power control
echo -n auto > /sys/bus/pci/devices/0000\:00\:01.0/power/control
sleep 1

In addition, I've blacklisted the loading of the NVIDIA driver in modprobe.d, in tlp I'm blacklisting the NVIDIA PCI device, in bumblebee I've set the PMMethod=none option, in Xorg I'm using the AutoAddGPU = off ServerFlag and I'm also using the tmpfiles.d trick to set the NVIDIA card power control to 'auto' initially.

Last edited by tyrells (2019-01-08 05:17:33)

Offline

Board footer

Powered by FluxBB