Bash scripts to automate installation of NVIDIA proprietary driver

thanks!
I got the 340-102 driver and apply the patch. Now I’m thinking if going deeper is worth the trouble. My (testing) card is so old that it uses old, discontinued drivers. I will just buy the new one (Quadro K620) that is supported by the latest drivers. Those should work better.

It seems to me that it’s fixed that white screen doesn’t show up after installing NVIDIA driver when the display is still connected to an Intel GPU.

1 Like

AMD GPUs are tricky to work with - there’s a lot less support available. Sure, the kernel has all the drivers as standard but at the application level,

a) AMD really only supports RHEL/CentOS and Ubuntu LTS
b) A lot of “cool GPU stuff” like TensorFlow and PyTorch only works on NVidia / CUDA / CUDnn

I’ve only been successful with OpenCL on AMD GPUs with Arch Linux - even the so-called “supported” Ubuntu 18.04 LTS gave me grief.

Thanks for the tip. I wanted to start another thread with this question: NVIDIA or AMD for the less trouble. I don’t need TensorFlow but Blender/Godot support (CUDA/opengl/vulkan).

I hoped that AMD will “just work” as Intel graphics.

Blender and Godot should work with AMD GPUs just fine - it’s the deep learning stuff that doesn’t work - TensorFlow and PyTorch are only supported on CPUs and NVidia GPUs and OpenCL is tricky to get working.

AMD does have some open source tooling for High Performance Computing / AI that could probably be made to work on Clear Linux. The Arch User Repository has the packages but I haven’t been able to make them work. I think my GPU is too old - it’s a “Sea Islands” card.

1 Like

Hi guys,

UPDATE
Ok, I got it working again using an USB stick. But wanted to leave here in case someone is more successful than me. I have a laptop with the MX150 from nVidia, that I cannot access using regular installation of the driver. The OS in which it ever worked was in Ubuntu and w/o EFI. If anyone is successful in installing the driver for this GPU, please, please, let me know.

ORIGINAL COMMENT

Messed with nvidia installation and now I can’t login. Booting into black screen and cursor, and tty isn’t opening with key combination.

  • How do I boot into tty directly in clearlinux?

Thanks

1 Like

Check this https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Disabling_switchable_graphics

2 Likes

Hi everyone,
I have a Msi notebook with two graphics cards on which I tried to run the various scripts to install the NVIDIA drivers without results. Now, I’m not very experienced like you so I was wondering if you could help me. What should I do exactly? Thanks in advance

→ Here some info:

lspci |grep -E "VGA|3D"
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)

~/Downloads/clear-linux-master/NVIDIA-Driver $ sudo ./pre_install.sh 
Password: 
⏳ Installing Dynamic Kernel Module System ...
Loading required manifests...
Warning: Bundle "kernel-native-dkms" is already installed, skipping it...
1 bundle was already installed
⏳ Updating Clear Linux OS bootloader ...
⏳ Disabling nouveau Driver ...
Please reboot your system ASAP and execute the install.sh script to install the NVIDIA proprietary driver.

$reboot

~/Downloads/clear-linux-master/NVIDIA-Driver $ sudo ./install.sh
Password: 
⏳ Configuring dynamic linker configuration ...
⏳ Locating NVIDIA-Linux-x86_64-<VERSION>.run ...
⏳ Installing NVIDIA proprietary Driver now ... 
If the installation is successful, GUI may automatically start.
Please run the post_install.sh to validate that the nvidia kernel modules are loaded.
Press any key to continue... 
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 430.26.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................…

**~/Downloads/clear-linux-master/NVIDIA-Driver $ sudo ./post_install.sh** 
Password: 
⏳ Making sure NVIDIA kernel modules are loaded...
nvidia_drm             45056  0
nvidia_modeset       1114112  1 nvidia_drm
nvidia              18784256  1 nvidia_modeset
nvidiafb               53248  0
⏳ Verifying the integrity of OpenGL library files...
Verifying version 30000
Verifying files
	...100%
Starting download of remaining update content. This may take a while...
	...2475%
Adding any missing files

Missing file: /usr/lib64/libEGL.so

	fixed
	...9%
Missing file: /usr/lib64/libEGL.so.1

	fixed
	...10%
Missing file: /usr/lib64/libEGL.so.1.0.0

	fixed

Missing file: /usr/lib64/libGL.so

	fixed
	...11%
Missing file: /usr/lib64/libGL.so.1

	fixed

Missing file: /usr/lib64/libGL.so.1.2.0

	fixed

Missing file: /usr/lib64/libGLESv1_CM.so

	fixed
	...12%
Missing file: /usr/lib64/libGLESv1_CM.so.1

	fixed

Missing file: /usr/lib64/libGLESv1_CM.so.1.1.0

	fixed
	...13%
Missing file: /usr/lib64/libGLESv2.so

	fixed

Missing file: /usr/lib64/libGLESv2.so.2

	fixed

Missing file: /usr/lib64/libGLESv2.so.2.0.0

	fixed
	...100%
Inspected 251 files
  12 files were missing
    12 of 12 missing files were replaced
    0 of 12 missing files were not replaced
Calling post-update helper scripts.
none
Repair successful
👏 Installation completed!

$reboot

-White dead screen

~/Downloads/clear-linux-master/NVIDIA-Driver $ sudo ./uninstall.sh

If it’s not a laptop, then connect your display to NVIDIA GPU and you are all set.

If it’s a laptop, and it supports NVIDIA Optimus, you may try to follow this https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Disabling_switchable_graphics

If it’s a laptop and Optimus is not an option, then try to disable the Intel GPU.
The problem is, I’m not aware of anyone who successfully disabled it.

Thanks for the reply, but it’s still too difficult for me. @doct0rHu I was wondering if you could even write a script for laptops with the Optimus system. If you succeeded, it would be a great help, both for me and for newcomers who are not very familiar with these things. Obviously feel free to say no, thanks :slight_smile:

@ichabod
If I have such a laptop, I will take a try.
I accept donations.

If you can do it, I will be happy to make a donation. Greetings :blush:

I don’t have a Optimus enabled laptop so I cannot test whether the following will work.


From the documentation of NVIDIA_GLX-1.0, I found the following:

Chapter 33 says you can use NVIDIA GPU to render images and use your integrated GPU (let’s say Intel GPU) to display images.

Create a new file /etc/X11/xorg.conf.d/20-optimus.conf with the following

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "<BusID for NVIDIA device here>"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

where the <BusID for NVIDIA device here> should be replaced by the correct bus ID of your NVIDIA card. For example, on my system I have the following

❯ lspci | grep -i vga   
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)

I’ve two NVIDIA cards so you see two entries here. But you should only see one NVIDIA card, and let’s say it’s bus id is 01:00.0, then you should put "PCI:1:0:0" (Don’t remove the double quotes) in the 20-optimus.conf file.

The next is to use xrandr to enable displays to your intel GPU. Let’s say you use gdm which is the default display manager if you’re not using lightdm or sddm. Then create/edit the file /etc/gdm/Init/Default with the contents

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Then you can install the NVIDIA drivers.

I tried to follow this procedure but as soon as I restart two things happen:

  1. if I restart immediately, as soon as I create these files, the login page is reloaded every time I try to log in with my credentials;
  2. if I reboot after creating the files and running the pre_install.sh script, then a black screen appears and I can no longer access the terminal with ctrl + alt + f3

I didn’t say you should restart before installing the drivers.
Just modify the X11 configurations and then install the driver. You may run preinstall, install, and postinstall without reboot between them, but reboot after postinstall.

I tried to run the procedure all over again and when I run ./install.sh the terminal gives me this:

$ sudo ./install.sh 
⏳ Configuring dynamic linker configuration ...
⏳ Locating NVIDIA-Linux-x86_64-<VERSION>.run ...
⏳ Installing NVIDIA proprietary Driver now ... 
If the installation is successful, GUI may automatically start.
Please run the post_install.sh to validate that the nvidia kernel modules are loaded.
The version of the driver is 430.26 
Press any key to continue... 
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 430.26..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

WARNING: Unable to determine the default library path. The path /opt/nvidia/lib
         will be used, but this path was not detected in the ldconfig(8) cache,
         and no directory exists at this path, so it is likely that libraries
         installed there will not be found by the loader.


WARNING: Unable to determine the default X library path. The path
         /opt/nvidia/lib will be used, but this path was not detected in the
         ldconfig(8) cache, and no directory exists at this path, so it is
         likely that libraries installed there will not be found by the
         loader.


ERROR: The Nouveau kernel driver is currently in use by your system.  This
       driver is incompatible with the NVIDIA driver, and must be disabled
       before proceeding.  Please consult the NVIDIA driver README and your
       Linux distribution's documentation for details on how to correctly
       disable the Nouveau kernel driver.


ERROR: Installation has failed.  Please see the file
       '/var/log/nvidia-installer.log' for details.  You may find suggestions
       on fixing installation problems in the README available on the Linux
       driver download page at www.nvidia.com.

Apparently you didn’t run the pre_install script.

I wish I’d read this before following the tutorial. Currently at the black screen with flashing cursor and seemingly no way to recover. I’ll have a go at using the scripts and hopefully have better luck.

What’s your hardware? Do you have multiple GPU?

Just a single NVIDIA GTX1050Ti.