Bash scripts to automate installation of NVIDIA proprietary driver

So somewhere it is loading the wrong libGL. I see many files include RPATH/RUNPATH to /usr/lib64 (mainly RUNPATH due to --enable-new-dtags). I have experienced the same issue which was resolved by stopping it adding -Wl,-rpath,/usr/lib64 to the linker.

Is someone able to run an strace when loading gnome-control-center and it fails to load with that error? (and then want the contents of /tmp/gcc-strace.log)

strace -f -o /tmp/gcc-strace.log gnome-control-center

This is related to https://github.com/clearlinux/distribution/issues/791
I already deleted the mesa libGL. Would you post your findings in the GitHub issue?

Thanx doct0rHu for taking the time. The P72 has the following gpu’s:

lspci -v | grep VGA
0:02.0 VGA compatible controller: Intel Corporation Device 3e94 (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller: NVIDIA Corporation GP104GLM [Quadro P5200 Mobile] (rev a1) (prog-if 00 [VGA controller])

The intel gpu uses:

lspci -vs 00:02.0
00:02.0 VGA compatible controller: Intel Corporation Device 3e94 (prog-if 00 [VGA controller])
Subsystem: Lenovo Device 2269
Flags: bus master, fast devsel, latency 0, IRQ 130
Memory at 404a000000 (64-bit, non-prefetchable) [size=16M]
Memory at 80000000 (64-bit, prefetchable) [size=256M]
I/O ports at 3000 [size=64]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: [40] Vendor Specific Information: Len=0c <?>
Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
Capabilities: [d0] Power Management version 2
Capabilities: [100] Process Address Space ID (PASID)
Capabilities: [200] Address Translation Service (ATS)
Capabilities: [300] Page Request Interface (PRI)
Kernel driver in use: i915

So I tried to blacklist the i915 but that doesn’t seem to work. The Nvidia GPU was using the nvidia driver and not the nouveau but at startup there was the white error screen.

Interesting is, when i open terminal (strg+F2) and startx, the gnome fallback dm starts.

I cannot disable the intel gpu because this is a corporate laptop and I don’t have access to the bios.

Hope you have any further ideas!

Cheers

The

I think this might be helpful. The author of that post failed to blacklist i915 module and changed the grub configuration and made that work.
I’m not sure whether this could be applied to Clear Linux, so please backup first.

Thanks. I did not create the GitHub issue, but I will follow its resolution. This is a pretty stupid problem to have. Install NVidia driver…no longer have the right driver linked for simple things like the gnome control center. I can’t imagine the pain of people who actually need openGL to work properly.

Hi doct0rHu,

thanx for the link! I think this points to the right direction. So, the problem seems to be that the kernel module i915 is compiled into the kernel and so it cannot be blacklisted as a loaded module. This makes absolutely sense for an intel centric distribution:

cat /lib/modules/$(uname -r)/modules.builtin

kernel/drivers/gpu/drm/i915/i915.ko

the problem now is, how to remove / prevent the module being loaded. This needs to be done in systemd.boot and not in grub. I mounted efi to boot and edited Clear-linux-native-5.0.18-767.conf but couldn’t find a way to prevent loading the i915.

Maybe someone has a hint for an kernel option in systemd.boot to prevent loading the module?

Cheers

You can also blacklist modules from the bootloader.

Simply add module_blacklist=i915 to your bootloader’s kernel line.

So to add new parameter do:

sudo mkdir -p /etc/kernel/cmdline.d/
echo "module_blacklist=i915" | sudo tee /etc/kernel/cmdline.d/blacklist.conf
sudo clr-boot-manager update

and reboot.

2 Likes

@miguelinux
This is great. We shall incorporate this into the NVIDIA driver tutorial if this is confirmed to work.

Hi miguelinux and thanx for your help!
I used your method and the kernel line was added to the bootloader. A much better way than mine because I added it directly to the conf and the next clr-boot-manager update will wipe it.

Unfortunately the result after installing the nvidia driver was still the same white screen.

How can I be sure that the module is not loaded / used? I use

sudo lspci -vs 00:02.0

which gives me:

00:02.0 VGA compatible controller: Intel Corporation Device 3e94 (prog-if 00 [VGA controller])
Subsystem: Lenovo Device 2269
Flags: bus master, fast devsel, latency 0, IRQ 130
Memory at 404a000000 (64-bit, non-prefetchable) [size=16M]
Memory at 80000000 (64-bit, prefetchable) [size=256M]
I/O ports at 3000 [size=64]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: [40] Vendor Specific Information: Len=0c <?>
Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
Capabilities: [d0] Power Management version 2
Capabilities: [100] Process Address Space ID (PASID)
Capabilities: [200] Address Translation Service (ATS)
Capabilities: [300] Page Request Interface (PRI)
Kernel driver in use: i915

I interpret this that the driver i still in use. This

sudo lsmod | grep ^nvidia gives me:

nvidia_uvm 823296 0
nvidia_drm 45056 0
nvidia_modeset 1110016 1 nvidia_drm
nvidia 18767872 2 nvidia_uvm,nvidia_modeset
nvidiafb 53248 0

Any more Ideas? I really like clear linux but a non working nvidia setup is a showstopper for me.

Cheers

@specter
https://wiki.archlinux.org/index.php/Bumblebee

If your laptop has NVIDIA Optimus, you may try Bumblebee, also has dynamic GPU switching.

Ok, I finally got this working! Cannot believe how hard this was. So, installing the nvidia driver with the tutorial was only half the way. This is my first notebook with an integrated and a nvidia gpu. So the problem was that the i915 gpu was the default one and just used for everything. As I don’t have access to the bios, I couldn’t switch to discreet only.

So what I did. I added two more modules to blacklist

disable-nouveau.conf:

blacklist nouveau
blacklist nvidiafb
blacklist rivafb
options nouveau modeset=0

I added another file to modprobe.d

nvidia-drm.conf:

options nvidia_drm modeset=1

I added:

/etc/X11/xorg.conf.d/90-mhwd.conf

Section “Module”
Load “modesetting”
EndSection

Section “Device”
Identifier “nvidia”
Driver “nvidia”
BusID “PCI:1:0:0”
Option “AllowEmptyInitialConfiguration”
EndSection

Added /usr/local/share/optimus.desktop

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c “xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto”
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

Then symlink

sudo ln -s /usr/local/share/optimus.desktop /usr/share/gdm/greeter/autostart/optimus.desktop
sudo ln -s /usr/local/share/optimus.desktop /etc/xdg/autostart/optimus.desktop

When the destination folders don’t exist, just create them.

Then reboot and cross fingers :wink:

All instructions beyond the nvidia driver tutorial are basically from here:

This is the result on a Thinkpad P72 with Quadro 5200:

glxinfo
name of display: :1
display: :1 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
.
.
.
OpenGL version string: 4.6.0 NVIDIA 430.14
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:

Maybe this could be useful for similar setups.

Cheers

6 Likes

Does it work if you do
sudo ln -s /usr/local/share/optimus.desktop /etc/gdm/greeter/autostart/optimus.desktop

if not we need to fix it.

Fabulous! I will try this with my own system.

Hi miguelinux

give me one night with a working nvidia setup :wink: I will test tomorrow.

Cheers

Are you using gnome Xorg or Wayland? Do the drivers only work with Xorg?

@miguelinux

I deleted my symlink

sudo ln -s /usr/local/share/optimus.desktop /usr/share/gdm/greeter/autostart/optimus.desktop

and created yours

sudo ln -s /usr/local/share/optimus.desktop /etc/gdm/greeter/autostart/optimus.desktop

but unfortunately the system booted into a black screen.

@Sumdewd

I use Xorg

Cheers

So far most things work well. I found two issues.

The gnome-settings are not starting. The workaround to start is:

export LD_LIBRARY_PATH=/opt/nvidia/lib:$LD_LIBRARY_PATH
gnome-control-center -v

A little bit annoying to start from console and export the path everytime.

The second thing is, that I have strong system freezes (1-2 seconds) in some situations. Often it happens when i activate gnome dash in the left top area. I never had any hard locks or something. It just freezes the whole system and comes back after 1-2 second. There is no screen corruptions or anything. Just cannot move mouse.

Maybe someone has a hint.

Cheers

Ok we need to fix it

I summarized what I believe the issue is here nvidia 2060 rtx: Black screen after login live usb · Issue #791 · clearlinux/distribution · GitHub

Mainly impacts autotools builds, setting RPATH/RUNPATH.

for i in /usr/lib64/lib*; do readelf -d ${i} | grep PATH; done

shows the extent of the problem.

1 Like

I never even knew this was an issue until you all clued me in. I use blackbox on most distros so its either cli or dconf editor. I thought this settings bug might have something to do with me removing qt libraries so I spent hours reinstalling and optimizing them… only to realize I run Gnome not KDE. These graphics libraries are so fancy I need a second monocle up in here.