Page 1 of 1

nvidia optimus

Posted: Sat Dec 18, 2021 10:06 am
by mg979
This is a relatively new MX-21 Fluxbox installation, reusing my previous home folder from MX-19.

Code: Select all

System:    Host: <filter> Kernel: 5.10.0-9-amd64 x86_64 bits: 64 compiler: N/A 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10.0-9-amd64 
           root=UUID=<filter> ro quiet splash 
           Desktop: Fluxbox 1.3.7 info: tint2, polybar dm: LightDM 1.26.0 
           Distro: MX-21_fluxbox_x64 Wildflower Oct 20  2021 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: Dell product: G3 3779 v: N/A serial: <filter> Chassis: type: 10 
           serial: <filter> 
           Mobo: Dell model: 0NY03M v: A00 serial: <filter> UEFI: Dell v: 1.18.0 
           date: 09/22/2021 
Battery:   ID-1: BAT0 charge: 36.3 Wh condition: 36.3/56.0 Wh (65%) volts: 16.8/15.2 
           model: BYD DELL 7FHHV86 type: Li-ion serial: <filter> status: Full 
CPU:       Topology: Quad Core model: Intel Core i5-8300H bits: 64 type: MT MCP arch: Kaby Lake 
           family: 6 model-id: 9E (158) stepping: A (10) microcode: EA L2 cache: 8192 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 36799 
           Speed: 1217 MHz min/max: 800/4000 MHz Core speeds (MHz): 1: 1278 2: 1398 3: 1393 
           4: 1398 5: 1366 6: 1333 7: 1398 8: 1395 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, 
           STIBP: conditional, RSB filling 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Dell driver: i915 
           v: kernel bus ID: 00:02.0 chip ID: 8086:3e9b 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: N/A bus ID: 01:00.0 
           chip ID: 10de:1c8d 
           Display: x11 server: X.Org 1.20.11 driver: intel compositor: compton v: 1 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.3.5 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel Cannon Lake PCH cAVS vendor: Dell driver: snd_hda_intel v: kernel 
           bus ID: 00:1f.3 chip ID: 8086:a348 
           Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel v: kernel 
           bus ID: 01:00.1 chip ID: 10de:0fb9 
           Sound Server: ALSA v: k5.10.0-9-amd64 
Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel 
           port: 5000 bus ID: 00:14.3 chip ID: 8086:a370 
           IF: wlan0 state: up mac: <filter> 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Dell 
           driver: r8169 v: kernel port: 3000 bus ID: 02:00.0 chip ID: 10ec:8168 
           IF: eth0 state: down mac: <filter> 
Drives:    Local Storage: total: 1.03 TiB used: 60.99 GiB (5.8%) 
           ID-1: /dev/sda vendor: Seagate model: ST1000LM035-1RK172 size: 931.51 GiB block size: 
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> 
           rev: SDM3 scheme: GPT 
           ID-2: /dev/sdb vendor: SK Hynix model: SC311 SATA 128GB size: 119.24 GiB block size: 
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 0P10 
           scheme: GPT 
RAID:      Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 
           port: 5060 bus ID: 00:17.0 chip ID: 8086.282a rev: 10 
Partition: ID-1: / raw size: 39.90 GiB size: 38.98 GiB (97.69%) used: 6.94 GiB (17.8%) fs: ext4 
           dev: /dev/sda5 
           ID-2: /home raw size: 98.79 GiB size: 96.74 GiB (97.92%) used: 49.20 GiB (50.9%) 
           fs: ext4 dev: /dev/sda6 
           ID-3: swap-1 size: 8.01 GiB used: 0 KiB (0.0%) fs: swap swappiness: 15 (default 60) 
           cache pressure: 100 (default) dev: /dev/sda7 
Sensors:   System Temperatures: cpu: 50.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mirror.units.it/mxlinux/mx/repo/ bullseye main non-free
Info:      Processes: 232 Uptime: 11m Memory: 7.63 GiB used: 1.48 GiB (19.4%) Init: SysVinit 
           v: 2.96 runlevel: 5 default: 5 Compilers: gcc: 10.2.1 alt: 10 clang: 11.0.1-2 
           Shell: quick-system-in running in: quick-system-in inxi: 3.0.36 
I installed nvidia drivers with mx-tools, then bumblebee and bumblebee-nvidia.

Code: Select all

$ nvidia-settings

ERROR: NVIDIA driver is not loaded


ERROR: Unable to load info from any available system
That the driver is not loaded should be because of bumblebee, right?

But with optirun I still can't open settings.

Code: Select all

$ optirun nvidia-settings
[  963.884950] [ERROR]No bridge found. Try installing primus or virtualgl.

$ optirun -b none nvidia-settings -c :8
[  986.886349] [ERROR]Cannot access secondary GPU - error: Could not enable discrete graphics card

[  986.886402] [ERROR]Aborting because fallback start is disabled.
Same if I try to run anything with optirun, not just the settings. What am I supposed to do to use the secondary card?

Re: nvidia optimus

Posted: Sat Dec 18, 2021 10:48 am
by Lupin
I installed nvidia drivers with mx-tools, then bumblebee and bumblebee-nvidia.
hey there,
did you install the driver through MX-Tools and then install bumblebee manually after that?
if thats the case, then you should uninstall them all:

Code: Select all

sudo ddm-mx -p nvidia
sudo apt-get --auto-remove purge bumblebee*
and then reinstall the bumblebee nvidia driver with:

Code: Select all

sudo ddm-mx -i nvidia -f bumblebee

Re: nvidia optimus

Posted: Sat Dec 18, 2021 10:55 am
by mg979
Thanks for the answer, before I uninstall and reinstall drivers for the third time, is there an official guide with steps to follow for optimus nvidia laptops?

Re: nvidia optimus

Posted: Sat Dec 18, 2021 11:02 am
by SwampRabbit
I believe the new command to use instead of “optirun” is

Code: Select all

nvidia-run-mx 
Note: I think it’s still optirun for legacy Nvidia drivers.

We don’t have a official guide that I know of.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 11:47 am
by mg979

Code: Select all

$ nvidia-run-mx nvidia-settings

ERROR: NVIDIA driver is not loaded


ERROR: Unable to load info from any available system

Code: Select all

$ cat /usr/bin/nvidia-run-mx
#!/bin/bash
# Part of ddm-mx for MX Linux by Dolphin Oracle (dolphinoracle@mgail.com)
# and farius
#
# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
#

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"

exit 0
It doesn't seem to enable the card (bumblebee should do it).

Re: nvidia optimus

Posted: Sat Dec 18, 2021 11:53 am
by SwampRabbit
Did you purge everything you install like what posted earlier?

Then reinstalled using Nvidia Driver Installer and selecting Optimus when it asks?

It sounds like your Nvidia install and configuration is still not right.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 11:56 am
by mg979
I purged/reinstalled already once today, and it did not ask about optimus, nor it did on first install. I'll purge/reinstall again I guess.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 12:23 pm
by mg979
Purged and reinstalled with

Code: Select all

sudo ddm-mx -i nvidia -f bumblebee-nvidia
still not working

Code: Select all

$ optirun nvidia-settings
[  242.957960] [ERROR]Cannot access secondary GPU - error: Could not enable discrete graphics card

[  242.958025] [ERROR]Aborting because fallback start is disabled.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 12:33 pm
by SwampRabbit
Is there a reason you are not just running the Nvidia Driver Installer and keep doing it from the terminal with all that extra stuff added?

Again, just I believe optirun is deprecated (except for legacy driver which you aren’t using) and the new command I provided should be used, but that’s from using the Nvidia Driver Installer like normal.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 12:47 pm
by mg979
I did use the installer the first time, but it didn't explain what to do next, so I installed bumblebee. I'll try again with only the installer and nvidia-run-mx.

One thing I noticed though is that with bumblebee (that actually disables the card when not in use) the laptop is much cooler (about 5°C), so I would have preferred that.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 1:14 pm
by mg979
Purged/reinstalled with tools, no bumblebee:

Code: Select all

$ inxi -G
Graphics:  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] driver: i915 v: kernel 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: nvidia v: 460.91.03 
           Display: x11 server: X.Org 1.20.11 driver: intel resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.3.5 

$ nvidia-run-mx nvidia-settings

ERROR: Unable to load info from any available system

Re: nvidia optimus  [Solved]

Posted: Sat Dec 18, 2021 2:34 pm
by dolphin_oracle
we probably need the

/var/log/ddm.log

file and also the output of both

Code: Select all

nvidia-detect
and

Code: Select all

nvidia-detect-mx
also, if you have switched to the "intel" graphics driver in mx-tweak, try going back to modesetting. forcing use of "intel" will cause the issue you are facing.

On the 1060 that I have here, I don't need any special tools to start nvidia-setttings, but I'm not using the "intel" driver.

Re: nvidia optimus

Posted: Sat Dec 18, 2021 4:19 pm
by mg979
dolphin_oracle wrote: Sat Dec 18, 2021 2:34 pm also, if you have switched to the "intel" graphics driver in mx-tweak, try going back to modesetting. forcing use of "intel" will cause the issue you are facing.

On the 1060 that I have here, I don't need any special tools to start nvidia-setttings, but I'm not using the "intel" driver.
That was it thanks! Unfortunately without the intel driver I get horrible screen tearing everywhere. I guess I'll stay with the intel card on Linux.

Re: nvidia optimus [solved]

Posted: Sat Dec 18, 2021 6:02 pm
by Stevo
You can use the intel driver with bumblebee on MX 21 with your card, but nvidia-settings does need extra goodies on the command:

viewtopic.php?t=67997

The easiest way to test with either the MX Prime command or optirun is just compare the output of "inxi -G" alone and then preceded by the command.

Code: Select all

optirun inxi -G

Re: nvidia optimus [solved]

Posted: Sun Dec 19, 2021 1:53 am
by mg979
Stevo wrote: Sat Dec 18, 2021 6:02 pm You can use the intel driver with bumblebee on MX 21 with your card, but nvidia-settings does need extra goodies on the command:

viewtopic.php?t=67997
I had read that thread and tried with

Code: Select all

optirun -b none nvidia-settings -c :8
but it didn't work (got the errors from the first post). bumblebee failed to activate the card.

Reposting here:

Code: Select all

$ optirun nvidia-settings
[  963.884950] [ERROR]No bridge found. Try installing primus or virtualgl.

$ optirun -b none nvidia-settings -c :8
[  986.886349] [ERROR]Cannot access secondary GPU - error: Could not enable discrete graphics card

[  986.886402] [ERROR]Aborting because fallback start is disabled.

Re: nvidia optimus [solved]

Posted: Sun Dec 19, 2021 3:55 am
by mg979
Just adding that I switched again to modesetting and enabled

Code: Select all

backend = "glx";
in my compton.conf and I have no more screen tearing, everything seems to work well now! Thanks for the help.

This is my inxi output now:

Code: Select all

$ inxi -G
Graphics:  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] driver: i915 v: kernel 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: nvidia v: 460.91.03 
           Display: x11 server: X.Org 1.20.11 driver: modesetting,nvidia 
           unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.3.5 

$ nvidia-run-mx inxi -G
Graphics:  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] driver: i915 v: kernel 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: nvidia v: 460.91.03 
           Display: x11 server: X.Org 1.20.11 driver: modesetting,nvidia 
           unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
           OpenGL: renderer: GeForce GTX 1050/PCIe/SSE2 v: 4.6.0 NVIDIA 460.91.03