Bash scripts to automate installation of NVIDIA proprietary driver

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

Thank you for the fix. Worked like a charm.

1 Like

I already have CUDA set up, will using the new scripts for updating the drivers break it?

@doct0rHu did you (or anyone) manage to get the drivers working on Wayland?

I’m not an expert on this. But it seems that when you have proprietary driver installed, it forces GDM to start in Xorg (instead of Wayland).

Yeah, that’s what I think it happens: if you disable Wayland in /etc/gdm/conf my PC starts in ~1.5s, but if I don’t disable it, then it takes 3 minutes. So probably it tries to boot up with Wayland, failes miserably, possibly retries again a certain number of times, and finally sets for xorg only. I found also a line in /lib/udev/61-gdm-something that disables Wayland for Nvidia drivers, but commenting it didn’t change anything. Also some suggest to enable nvidia-drm.modeset=1, but adding it in the kernel launch parameters didn’t seem to change anything…
I mean, it’s not that I don’t like/have problems with Xorg, it’s just that on Ubuntu I think both work, so there should be no reason for it to not work in CL too.

I think you can open an issue on this. In particular, why disabling Wayland manually saves time to boot is an interesting question. On my system it just boots instantly.

I did open an issue on the long boot time, but after I found this solution and telling to the devs, the problem died there

Link?
Let me take a look.

Sure, there’s not much though…

I opened an issue on documentation repo. Though this is not a bug for Clear Linux, it might be nice to mention it in documentation.

Yeah that’d be helpful for other laptop users! Unfortunately it seems that Wayland compatibility is something Nvidia is tinkering around with not much actual effort, so this is on them and until they fix this there’s not much we can do…