Install NVIDIA "the hard way"

I have a NVIDIA video card GT 1030. I installed the NVIDIA driver version 535.146.02 “the hard way”, i.e., using the .run file downloaded from the NVIDIA website. I followed the directions given in:

I just have a comment about it, which may be helpful to others as well. It says:

Boot without nouveau

Reboot and press E at GRUB2 then append nomodeset and 3

When I tried it out and booted into runlevel 3 (with nomodeset) noveau was still loaded confirmed by lsmod | grep -i nouveau. Instead I decided to create the file /etc/modprobe.d/nvidia.conf myself containing the line:

blacklist nouveau

Then I executed mkinitrd and rebooted back into runlevel 3 (by entering “3” in GRUB2 but this time without “nomodeset”). Now nouveau was not loaded and lsmod | grep -i nouveau returned nothing.

So I proceeded to run the installation script, which finished normally. The script re-wrote the file /etc/modprobe.d/nvidia.conf with the exact same line that I had already written. Since the nvidia.conf file was the same as the one I had written I decided that it was not necessary to re-run mkinitrd again. I rebooted into runlevel 5 and X started normally and the NVIDIA driver was loaded. I know this because openGL is now much faster.

I wonder why it is recommended to first boot without nouveau before running the installation script. I understand that nouveau needs to be blacklisted and not loaded in order for the NVIDIA proprietary driver to work correctly. But would the installation script generate an error or not run correctly if the system is booted without nouveau only after installing the NVIDIA driver?

The proprietary driver installer will blacklist Nouveau; therefore, you can usually skip this section, but it doesn’t hurt to double check it.
The installer creates the file /etc/modprobe.d/nvidia.conf that contains:
blacklist nouveau

The 3 loads only a virtual console. The nomodeset instructs the kernel to not load graphic drivers but use BIOS modes instead…after installation nouveau is blacklisted via the nvidia.conf file…

1 Like

Hi Hui,

The nomodeset instructs the kernel to not load graphic drivers

However, after typing lsmod | grep -i nouveau I got something similar to:

nouveau 2355200 1
video 61440 2 dell_wmi,nouveau
drm_ttm_helper 16384 1 nouveau
ttm 81920 2 drm_ttm_helper,nouveau
i2c_algo_bit 16384 1 nouveau
mxm_wmi 16384 1 nouveau
drm_kms_helper 303104 1 nouveau

It looked like “nomodeset” did not prevent nouveau from being loaded. However, having the file /etc/modprobe.d/nvidia.conf and re-creating initrd did the trick and nouveau was not loaded upon reboot into the virtual console (runlevel 3). But maybe this is just a detail and the intallation works either way. I just wanted to make sure that nouveau was really not loaded before starting the installation.

@malcolmlewis may advise better as he usually installs the hard way…
For my use cases the zypper way is good enough…

Simple way when installing the driver .run installer is to create a file 50-blacklist.conf in /etc/modprobe.d
with something like this

# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0

before going to init 3 and start installing the .run driver.

Sometimes the installer fails to do the blacklisting that results in failure to install the driver.
So better to do the blacklisting first before installing the driver.

I used some of the older instructions:

  1. Kernel sources must be installed and configured. Usually this means installing the ‘kernel-source’, ‘make’ and ‘gcc’ packages with YaST2.

  2. Run the following commands

echo “blacklist nouveau” > /etc/modprobe.d/nvidia.conf

  1. Reboot your machine.

  2. Use the nvidia installer for <driver version>
    sh NVIDIA-Linux-x86-<driver version>.run

@hui yes nouveau still needs to be there on the initial install, as long as at (runlevel 3) all is good, the module while loaded, is not active from a (runlevel 5) perspective so it’s as happy as a clam…

One feature of the 545 series I like is that you can now update the nvidia driver on the fly, as in download/install from a graphical session and reboot. It does not negate the need to rebuild on a kernel update.

Thanks @malcolmlewis.

But in principle it doesn’t matter whether you run mkinitrd before or after installing the driver as long as you had nouveau blacklisted in some file in /etc/modprobe.d when you ran mkinitrd. This will ensure that blacklisting of the nouveau driver is added to the initial ramdisk.

@gianluca44 the kernel-sources are no longer needed, only kernel-default-devel, you can safely remove kernel-sources package and save some space…

For item 2. The mkinitrd script was deleted from Tumbleweed, for those that didn’t save it somewhere the command to run now is dracut -f --regenerate-all

Some extras :wink:

  1. On a kernel update, I set my machine to boot to via systemctl set-default

  2. Reboot your machine systemctl reboot (At least some services like purging kernels gets run)

  3. Repeat your #4, I use ./ --no-systemd --ui=none

  4. Set default back to graphical target via systemctl set-default

  5. Reboot your machine systemctl reboot

I think he is using leap so it is still using mkinitrd.

Another thing to mention is that when you start the installer it says that “a pre-installation script blacklisted nouveau” (i.e., it created the file nvidia.conf) and you are asked whether you want to reboot or continue. I choose “continue” since I already manually blacklisted nouveau. It seems that the installation script wants to be on the safe side and have nouveau not loaded. It may just be a precaution.

Can’t edit ,after blacklisting run mkinitrd

Yes, I am using Leap.

@conram yup, but was mentioned for other users who may pass by… :wink:

1 Like

But it looks like mkinitrd calls dracut. Is it just a wrapper for now for backwards compatibility?

Well I encounter that numerous time and the .run installer always failed to automatically blacklisted nouveau.

Well I encounter that numerous time and the .run installer always failed to automatically blacklisted nouveau.

Good thing I did the blacklisting before running the installation script. I just called the file the same way as the installation script calls it “nvidia.conf”. May just be a personal preference. Either way seems to work.

1 Like