Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrete graphics card is always on #1048

Open
phaoost opened this issue Dec 21, 2019 · 8 comments
Open

Discrete graphics card is always on #1048

phaoost opened this issue Dec 21, 2019 · 8 comments

Comments

@phaoost
Copy link

phaoost commented Dec 21, 2019

Hello,
I am not able to turn off discrete graphics card:

~# cat /proc/acpi/bbswitch
0000:3c:00.0 ON
~# tee /proc/acpi/bbswitch <<< OFF
OFF
~# cat /proc/acpi/bbswitch 
0000:3c:00.0 ON
~# lspci -s 3c:00.0 -v
3c:00.0 3D controller: NVIDIA Corporation Device 1d34 (rev a1)
        Flags: fast devsel, IRQ 16
        Memory at b3000000 (32-bit, non-prefetchable) [size=16M]
        Memory at a0000000 (64-bit, prefetchable) [size=256M]
        Memory at b0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 2000 [size=128]
        Expansion ROM at <ignored> [disabled]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [258] L1 PM Substates
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express <?>
        Kernel modules: nouveau
@Lekensteyn
Copy link
Member

Have you checked your kernel logs after writing OFF? dmesg | tail or dmesg | grep -C8 bbswitch

Newer laptops may not be supported by bbswitch, try relying on runtime PM instead. Either in combination with nouveau, or without any driver bound.

@cowboysmall
Copy link

I have the same or similar issue. On a Dell XPS 15 9560 running Fedora 31.

[ pantagruel ~ ] # cat /proc/acpi/bbswitch        
0000:01:00.0 ON
[ pantagruel ~ ] # tee /proc/acpi/bbswitch <<< OFF
OFF
[ pantagruel ~ ] # cat /proc/acpi/bbswitch        
0000:01:00.0 ON
[ pantagruel ~ ] # optirun --status               
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is on.

[ pantagruel ~ ] # lspci -s 01:00.0 -v            
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
        Subsystem: Dell Device 07be
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at ec000000 (32-bit, non-prefetchable) [size=16M]
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Memory at d0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at e000 [size=128]
        [virtual] Expansion ROM at ed000000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [258] L1 PM Substates
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express <?>
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

[ pantagruel ~ ] # journalctl -b -u bumblebeed
-- Logs begin at Sun 2019-06-30 21:19:01 IST, end at Wed 2020-01-08 11:20:27 GMT. --
Jan 08 11:03:18 pantagruel systemd[1]: Started Bumblebee C Daemon.
Jan 08 11:03:18 pantagruel bumblebeed[888]: [    5.586015] [INFO]/usr/sbin/bumblebeed 3.2.1 started
Jan 08 11:03:18 pantagruel bumblebeed[888]: [    5.588623] [ERROR]Could not open /proc/acpi/bbswitch: Permission denied
Jan 08 11:05:19 pantagruel bumblebeed[888]: [    5.588886] [WARN]Unable to disable discrete card.[  125.875911] [WARN][XORG] (WW) Warning, couldn't open module mouse
Jan 08 11:05:19 pantagruel bumblebeed[888]: [  125.875989] [WARN][XORG] (WW) NVIDIA(0): Unable to get display device for DPI computation.
Jan 08 11:05:19 pantagruel bumblebeed[888]: [  125.875993] [WARN][XORG] (WW) NVIDIA(0): Option "NoLogo" is not used
Jan 08 11:05:19 pantagruel bumblebeed[888]: [  125.875999] [WARN][XORG] (WW) Warning, couldn't open module mouse
Jan 08 11:05:19 pantagruel bumblebeed[888]: [  125.876004] [ERROR][XORG] (EE) PreInit returned 2 for "<default pointer>"
Jan 08 11:05:19 pantagruel bumblebeed[888]: [  125.876008] [ERROR][XORG] (EE) PreInit returned 2 for "<default keyboard>"
Jan 08 11:05:24 pantagruel bumblebeed[888]: [  131.406860] [ERROR]Could not open /proc/acpi/bbswitch: Permission denied

@B3HOID
Copy link

B3HOID commented Sep 16, 2020

For me opening and then closing NVIDIA X Server Settings usually fixes the issue.

@AshleighTheCutie
Copy link

I have this exact problem, except the fix suggested by B3HOID does not work for me, as I can't open the nVidia X Server Settings application. The X settings program results in this, no matter what I do:

ashleigh@Anette:~$ nvidia-settings

(process:101416): Gtk-WARNING **: 11:47:37.053: Locale not supported by C library.
        Using the fallback 'C' locale.

ERROR: Unable to load info from any available system

ashleigh@Anette:~$ primusrun nvidia-settings

(process:101417): Gtk-WARNING **: 11:47:42.354: Locale not supported by C library.
        Using the fallback 'C' locale.

ERROR: Unable to load info from any available system

ashleigh@Anette:~$ 

I'm on Debian 11, using kernel 5.10.0-13-amd64, nVidia driver package nvidia-tesla-418-driver (and it's deps). GPU in question is a Quadro K2000M. If any other information is needed, I can share, I just am unsure what is needed.

@B3HOID
Copy link

B3HOID commented Apr 1, 2022

It's not recommended to use Bumblebee in Debian anymore, except to automatically disable the Nvidia kernel DKMS when it first launches.

Also install bbswitch-dkms with sudo apt install bbswitch-dkms to manage the Nvidia card's PM. Use nvidia-xrun instead (while bumblebee and bbswitch-dkms will serve as just tools for disabling the GPU when you don't need it).

@AshleighTheCutie
Copy link

What do I use then? primusrun interfaces with Bumblebee, and I can't find anything else that actually exists on Debian 11. Also, does nvidia-xrun work with SDDM?

@B3HOID
Copy link

B3HOID commented Apr 1, 2022

I use Debian Sid with a 940MX and while Debian is a bit harder than some other distros for getting NVIDIA Optimus cards working, the following method I am about to explain has made it very simple to get working.

First of all, some things you will need to get will be outside of the official repos. For this method which is the most optimal one (I get the best performance out of the card that way) I use the nvidia-xrun tool. What it does is that it creates a seperate Xorg config file which runs fully on the NVIDIA card, acheiving full performance. The downside is that you will have to logout of your main X session and then run it with the nvidia-xrun on a TTY (so you would logout, ctrl alt f3 or whatever to preempt SDDM from starting up). The desktop then loads and then you play your game or do whatever. When you're done you logout and the bbswitch-dkms will automatically kick in and modprobe -r the nvidia kernel modules as well as executing echo 'OFF' | sudo tee /proc/acpi/bbswitch/ to turn off the card. After that you run sudo service sddm restart and login back to your main desktop running on the iGPU.

It sounds unnecessarily complicated, but I can guarantee you this is the best way to get maximum performance out of your card. I can give you some simple instructions if you're interested (Setting it up in Debian is a bit different because afaik nvidia-xrun was originally made for Arch).

@AshleighTheCutie
Copy link

Yeeeah, I actually get better performance out of it if the only application running on it is the one needing 3D acceleration. As in, 20-30 more FPS. It's a 2011 GPU, it's barely able to run the game on it's own. Thank you for letting me know about this though, I'll use this if I ever use Linux on my gaming computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants