Bash scripts to automate installation of NVIDIA proprietary driver

Do you have two GPU? One motherboard GPU and one Nvidia GPU?

Yes, Intel HD630 I think as integrated GPU (connected to the laptop display) and Nvidia as external GPU (connected to HDMI/DisplayPort). In the boot script I set intel_iommu=on. Until the Gnome 3.34 update they both worked flawlessy with the same configuration except for the kernel parameter above.

this may need a bug report

Ok thanks, you know any way to switch the drivers (I saw something about nvidia-xrun and bumblebee, I would just need boot-time switch not runtime)

Also I would be considering the 5.3 kernel as the culprit, which was around the time of the gnome 3.34 landing and was a case of iommu patches breaking with nvidia on update to 5.3 kernel (but worked with 5.2 and gnome 3.34).

Yes the dev too said it was likely related to the kernel and not Gnome. Either way, this has been quite annoying, even if as the updates come by it seems to be getting somewhat fixed (like no more long boot times like in the first days), although the internal display problem wasnā€™t there a couple of weeks ago.

Did you succeed in installing the driver? I have the same specifications as you and I failed

How do you get nvidia settings after installing the drivers?

/opt/nvidia/bin has some binaries for various purposes.

After running pre-install.bash script and reboot on my PC, I canā€™t enter to tty. Ctrl+Alt+F(1-5) doesnā€™t take any effect. Before running this script tty works well. According to that I canā€™t run install.bash to continue instillation of Nvidia Driver.

Could anyone help me with this problem?

@_Pi You should first tell us your system specs

@: if you have an Optimu laptop, can you please tell me if you get crazy long boot times with Nvidia drivers (about 2-3 minutes)?

I solved my problem.
I was trying install drivers on my PC, not a laptop.
To solve the problem I was disabled integrated GPU in UEFI settings.
After this all start works as expected.

p.s: I was never think that on PC before Nvidia driver installation I must disable integrated GPU in CPU.

You shouldnā€™t need to. Probably you needed some more configuration steps to get it working. Disabling the iGPU is usually a short-hand for missing config

I got prime-sync, gdm login screen and all working here.

Before:

After:

Using monitos.xml

There is more to it then you can find at the clear linux forums, using prime sync I noticed the gdm login screen was empty, but in fact funny it was displayed on the crt-0 ghost screen wich you cannot see as some vga bioses have them hardcoded, I could just hit ā€œEnterā€ and enter the password and the desktop would load. The key is to right click on the desktop and setup the display settings, if all is ok you will have a monitor.xml file in .config, then you can copy this xml over to gdm, ā€œcp /home/username/.config/monitors.xml /var/lib/gdm/.config/ā€

And login screen will work again like we all are used to, I also suggest not to use the baremetal kernel, it will break the driver more often so I decided to stay on the latest LTS kernel.

I will upload my configs to my github soon, just need some time because some of the scripts are from others, so either I inform them or copy them and just metioning them.

Have a nice day!

Just let everyone know that Iā€™ve updated all scripts according to the latest tutorial.

Notably:

  • Issues with OpenGL is solved via a workaround, so thereā€™s no need to swupd verify --fix
  • I added --no-modprobe back to installer option. Please refer to CUDA tutorial on how this issue is addressed.
  • From now on, please run bash <SCRIPT.bash> without sudo.

Let me know if thereā€™s any problem in the scripts.

Just tried this on new install. Kernel 5.5.9-918.native
First script pre_install.sh works fine and reboots to cmd line.

Then running install.sh gives me following error:

ERROR: Failed to run /usr/bin/dkms build -m nvidia -v 440.64 -k 5.5.9-918.native:
Kernel preparation unnecessary for this kernel. Skippingā€¦

Building module:
cleaning build areaā€¦
ā€˜makeā€™ -j12 NV_EXCLUDE_BUILD_MODULES=ā€™ā€™ KERNEL_UNAME=5.5.9-918.native IGNORE_CC_MISMATCH=ā€™ā€™ modulesā€¦(bad exit status:2)
Error! Bad return status for module build on kernel: 5.5.9-918.native (x86_64)
Consult /var/lib/dkms/nvidia/440.64/build/make.log for more information.

The installation log says the error above.
Shed any light on this for a newbie :slight_smile:

The gcc compiler version on the latest build not playing nice. Hereā€™s a post from someone more knowledgeable:

Thank you for the reply, saw the version mismatch 9.2.0 -> 9.2.1 of gcc compiler.
Could not read that post you sent due to it was private or doesnt exist.
Hope there is a fix soon.

Edit the install.bash script and add ā€œā€“no-cc-version-check " between lines 85 (ā€ā€“dkms ā€œ) and 86 (ā€ā€“silent; then")

modified install.bash: modified install.bash to build nvidia latest 440.60 dkms driver in CL 32600 Ā· GitHub