Bbswitch doesn't turn off gpu after optirun

Post Reply
Message
Author
palevandro
Posts: 24
Joined: Mon Mar 04, 2019 4:12 am

Bbswitch doesn't turn off gpu after optirun

#1 Post by palevandro »

I'm having a problem with optirun, I'm running a python script using the command

Code: Select all

optirun python my_script.py
After script execution, the Nvidia didn't turn off, my laptop still using the Nvidia card.

Is there any way to manually turn off GPU after optirun without reboot or restart my laptop?

Here is my system information

Code: Select all

System:    Host: ducpv Kernel: 4.19.0-1-amd64 x86_64 bits: 64 compiler: gcc v: 6.3.0 
           Desktop: Xfce 4.12.3 Distro: MX-18.2_x64 Continuum Feb 9  2019 
           base: Debian GNU/Linux 9 (stretch) 
Machine:   Type: Laptop System: Notebook product: W35xSTQ_370ST v: N/A serial: <filter> 
           Mobo: Notebook model: W35xSTQ_370ST serial: <filter> BIOS: Prema Mod v: 1.03.02PM v2 
           date: 03/12/2014 
Battery:   ID-1: BAT0 charge: 74.1 Wh condition: 74.1/77.0 Wh (96%) model: NOTEBOOK BAT 
           status: Full 
CPU:       Topology: Quad Core model: Intel Core i7-4700MQ bits: 64 type: MT MCP arch: Haswell 
           rev: 3 L2 cache: 6144 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 38311 
           Speed: 3248 MHz min/max: 800/3400 MHz Core speeds (MHz): 1: 3256 2: 3184 3: 2914 
           4: 2791 5: 2819 6: 2844 7: 3343 8: 3239 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: CLEVO/KAPOK 
           driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: NVIDIA GK106M [GeForce GTX 765M] driver: N/A bus ID: 01:00.0 
           Display: x11 server: X.Org 1.19.2 driver: modesetting unloaded: fbdev,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.2.6 direct render: Yes 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: CLEVO/KAPOK 
           driver: snd_hda_intel v: kernel bus ID: 00:03.0 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: CLEVO/KAPOK 
           driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
           Sound Server: ALSA v: k4.19.0-1-amd64 
Network:   Device-1: Realtek RTL8723AE PCIe Wireless Network Adapter driver: rtl8723ae v: kernel 
           port: d000 bus ID: 03:00.0 
           IF: wlan0 state: up mac: <filter> 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: CLEVO/KAPOK 
           driver: r8169 v: kernel port: c000 bus ID: 04:00.2 
           IF: eth0 state: down mac: <filter> 
           IF-ID-1: docker0 state: down mac: <filter> 
Drives:    Local Storage: total: 1.13 TiB used: 677.29 GiB (58.6%) 
           ID-1: /dev/sda vendor: Western Digital model: WD10JPVX-22JC3T0 size: 931.51 GiB 
           ID-2: /dev/sdb vendor: Kingston model: SH103S3240G size: 223.57 GiB 
Partition: ID-1: / size: 217.06 GiB used: 59.42 GiB (27.4%) fs: ext4 dev: /dev/sdb1 
           ID-2: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdb2 
Sensors:   System Temperatures: cpu: 66.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     Active apt repos in: /etc/apt/sources.list.d/antix.list 
           1: deb http://la.mxrepo.com/antix/stretch stretch main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://ftp.ru.debian.org/debian/ stretch-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://ftp.ru.debian.org/debian/ stretch main contrib non-free
           2: deb http://security.debian.org/ stretch/updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/docker.list 
           1: deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
           Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
           1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mirror.truenetwork.ru/mxlinux/mx/repo/ stretch main non-free
           Active apt repos in: /etc/apt/sources.list.d/opera-stable.list 
           1: deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
           Active apt repos in: /etc/apt/sources.list.d/skype-stable.list 
           1: deb [arch=amd64] https://repo.skype.com/deb stable main
           No active apt repos in: /etc/apt/sources.list.d/various.list 
           Active apt repos in: /etc/apt/sources.list.d/vscode.list 
           1: deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
Info:      Processes: 265 Uptime: 3h 36m Memory: 15.59 GiB used: 3.52 GiB (22.6%) Init: SysVinit 
           runlevel: 5 Compilers: gcc: 6.3.0 Shell: bash v: 4.4.12 inxi: 3.0.33 

User avatar
timkb4cq
Developer
Posts: 3203
Joined: Wed Jul 12, 2006 4:05 pm

Re: Bbswitch doesn't turn off gpu after optirun

#2 Post by timkb4cq »

Bbswitch can't disable a video card whose kernel module is still loaded.
Have you tried running

Code: Select all

sudo rmmod nvidia
before the bbswitch command?
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

palevandro
Posts: 24
Joined: Mon Mar 04, 2019 4:12 am

Re: Bbswitch doesn't turn off gpu after optirun

#3 Post by palevandro »

Thank you, I figured it out that if I run another script with optirun but with some errors in the code.
That could help turn off the NVIDIA and back to Intel card.

User avatar
Stevo
Developer
Posts: 12837
Joined: Fri Dec 15, 2006 8:07 pm

Re: Bbswitch doesn't turn off gpu after optirun

#4 Post by Stevo »

The Arch wiki recommends

Code: Select all

sudo tee /proc/acpi/bbswitch <<<OFF
which would work on my MSI back when Bumblebee was broken on it and I needed to turn off the GPU.

Post Reply

Return to “Software / Configuration”