Help me install the Nvidia 340 driver

Uname -a
Linux canuck 4.19.163-1-MANJARO #1 SMP Fri Dec 11 17:00:14 UTC 2020 x86_64 GNU/Linux

Sudo modprobe nvidia
modprobe: ERROR: could not insert ‘nvidia’: No such device

I can confirm that I installed all three packages for the 4.19 kernel as you described. I also checked /etc/mkinitcpio.conf for any mention of nouveau, and there was not.

I cannot build from the AUR because /usr/src/linux is missing. The kernel headers are installed.

I also have the same issue. After trying for a few hours to get it to work, I ended up downgrading my 5.4 and 4.19 kernel/header by using the downgrade command to the previous version, to at least have a somewhat working system.

It looks like the aur nvidia-340xx-lts-dkms (can’t post a link) might be the better option for older lts since it probably won’t have patches to make later kernels work. But it also gets a /usr/src/linux-lts is missing error. I assume that linux-lts is supposed to be a symlink to the latest header files?

The last one, nvidia-340xx did not compile. I am in real trouble with my macbook that was broken by the update that did not include the legacy drivers any more.
==> Making package: linux54-nvidia-340xx 340.108-80 (pe 1. tammikuuta 2021 14.07.32)
==> Checking runtime dependencies…
==> Checking buildtime dependencies…
==> Retrieving sources…
-> Found NVIDIA-Linux-x86_64-340.108-no-compat32.run
-> Found 340.108-build-fix.patch
==> Validating source files with sha256sums…
NVIDIA-Linux-x86_64-340.108-no-compat32.run … FAILED
340.108-build-fix.patch … Passed
==> ERROR: One or more files did not pass the validity check!

It is lot of extra time to maintain those outdated drivers. Why not try with the Nouveau drivers?

Based on the PKGBUILD the file of 340.108 drivers should have a sha256sums of 995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77

You can also get the DKMS driver file from here: Release 340.108-1 · philmmanjaro/nvidia-340xx-dkms · GitHub You also need to install the proper linux-headers like linux54-headers or linux419-headers, depending which kernel you are using.

Thanks for packaging up the dkms driver. I tried using the nouveau driver, but I couldn’t get video hardware acceleration, and couldn’t play any HD videos using mpv correctly. Not only that it crashed after about 20 minutes.

As to the DKMS driver. It looks like it’s working for 5.4, I just installed the latest 5.4 kernel updates with it and it works. It seems to have issues with 4.19. The make.log shows an error.

make[1]: *** [Makefile:1553: module/var/lib/dkms/nvidia/340.108/build] Error 2
make[1]: Leaving directory ‘/usr/lib/modules/4.19.164-1-MANJARO/build’
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:202: nvidia.ko] Error 1
make: Entering directory ‘/var/lib/dkms/nvidia/340.108/build/uvm’
cd ./…; make module SYSSRC=/lib/modules/4.19.164-1-MANJARO/build SYSOUT=/lib/modules/4.19.164-1-MANJARO/build KBUILD_EXTMOD=./…
make[1]: Entering directory ‘/var/lib/dkms/nvidia/340.108/build’
NVIDIA: calling KBUILD…
make[2]: Entering directory ‘/usr/lib/modules/4.19.164-1-MANJARO/build’
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (
echo >&2;
echo >&2 " ERROR: Kernel configuration is invalid.";
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";
echo >&2 " Run ‘make oldconfig && make prepare’ on kernel src to fix it.";
echo >&2 ;
/bin/false)
mkdir -p ./…/.tmp_versions ; rm -f ./…/.tmp_versions/*
make -f ./scripts/Makefile.build obj=./…
scripts/Makefile.build:45: …/Makefile: No such file or directory
make[3]: *** No rule to make target ‘…/Makefile’. Stop.
make[2]: *** [Makefile:1553: module./…] Error 2
make[2]: Leaving directory ‘/usr/lib/modules/4.19.164-1-MANJARO/build’
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [Makefile:202: nvidia.ko] Error 1
make[1]: Leaving directory ‘/var/lib/dkms/nvidia/340.108/build’
make: *** [Makefile:222: …/Module.symvers] Error 2
make: Leaving directory ‘/var/lib/dkms/nvidia/340.108/build/uvm’

Thanks again for the driver through, since I normally use kernel 5.4 anyways.

You may compile it for 4.19 kernel manually. For dkms you also need linux419-headers.

git clone https://gitlab.manjaro.org/packages/extra/linux419-extramodules/nvidia-340xx.git
cd nvidia-340xx && makepkg -sif

I will give nouveau a try.

Did my last post have all the info you need?

Update: the nouveau driver is basically unusable for gaming. It is essential that I get the Nvidia driver working.

It looks like it has no problems creating a zst package if I compile it manually, although I didn’t install it, because it conflicts with the dkms package. I do have linux419-headers, so not sure why I’m getting an error with dkms. Hmm. I wonder if others are having the same issue with 4.19 as opposed to 5.4.

I have solved the problem. A close look at dmesg showed that nouveau was somehow preventing the nvidia driver from accessing the GPU. Blacklisting nouveau allowed Nvidia to work properly.

Thanks for the help everyone.

Sorry to jump in here. I honestly tried on my Dell Latitude e6510. I got it to boot to the graphical environment but after a few minutes the screen starts flickering unbearably. Besides the laptop does not go into sleep mode, it just switches to a black screen from which it is not possible to recover. For my daughter that relies on it for school in a remote setup this is a serious problem.

I looked into troubleshooting tips but nothing helped. Based on my experience the nouveau driver is unusable on this laptop.

I timeshifted back to my last working configuration (prior to the stable update deprecating the older nvidia driver) and I am now struggling to install the 390xx driver from source so that I can apply all the other updates. Specifically, before I have the time to make modifications to the graphical driver setup, mhwd gets forcibly updated, removes the 390xx driver and forces the installation of nouveau :rage:. That clearly does not help!

I have been very happy with Manjaro for years but this is the first serious confidence-breaking situation. I hope that I will manage to find a solution for this laptop that I have no intention of retiring just because of nvidia.

https://nouveau.freedesktop.org/InstallNouveau.html
https://nouveau.freedesktop.org/TroubleShooting.html
https://wiki.archlinux.org/index.php/Nouveau

The 390xx driver has not been removed from the Manjaro repositories, so I don’t fully understand why you’d want to build it yourself.

I meant 340, not 390. However, this brings up a good point: I will check if my adapter is supported by the 390 driver and try to install it.

Could you please tell me if philm’s command for installing the drivers is one long command line or if it should be broken into parts?
If the second could you please point me the separators.

Thank you very much!

Each line is a separate command to input after it’s done.

sudo pacman
git clone
cd

Are all different commands. There are some lines where he is using &&, which tells the terminal to do the next command in that line if the initial one was successful.

cd nvidia-340xx-utils && makepkg -si && cd ..

The line above if used all together means: cd nvidia-340xx-utils is successful, then do makepkg -si, if that’s successful do cd ..

Please read about the commands before using them. Do not blindly use commands.

1 Like

Thank you very much.

I got to the point of installing the drivers and for the last 30 min I have been getting the message:

pacman is being used, wait (not exact words I am translating it into english)

is this amount of time congruent to what other people have experienced or am I having some issues?

Thank you

Of the two alternatives that were given in the forum, the AUR one in my case does not work (it gives an error in line 32 of the PKGBUILD file when you want to install the DKMS kernel version and ends up canceling everything), instead using the terminal everything is installed correctly (but in pamac the AUR support must be disabled, because if it is enabled you will want to update the DKMS kernel and throw the error on line 32 of the PKGBUILD file).
For my part (I have kernel 5.4 and 5.10) using the terminal I did what they recommended here:

sudo pacman -S git base-devel
(accept everything you wanted to download)

sudo pacman -S $ (mhwd-kernel -li | grep ‘*’ | cut -d ‘’ -f5 | awk ‘{print $ 0, “- headers”}’ | sed s ‘/ //’ g)

git clone https://gitlab.manjaro.org/packages/extra/nvidia-340xx-utils.git

** git clone https://gitlab.manjaro.org/packages/multilib/lib32-nvidia-340xx-utils.git**

** git clone https://github.com/philmmanjaro/nvidia-340xx-dkms.git**

** cd nvidia-340xx-utils && makepkg -si**

** cd …/lib32-nvidia-340xx-utils && makepkg -si**

** cd …/nvidia-340xx-dkms && makepkg -si**

For now both kernel 5.4 and 5.10 work perfectly and the system has not crashed at any time, it remains to be seen what happens when there is a kernel update

Should I run this?

sudo pacman -S $ (mhwd-kernel -li | grep ‘*’ | cut -d ‘’ -f5 | awk ‘{print $ 0, “- headers”}’ | sed s ‘/ //’ g)

or does the ‘*’ in your command mean to insert one at a time

sudo pacman -S git base-devel
(accept everything you wanted to download)

**sudo pacman -S $ (mhwd-kernel -li | grep

git clone https://gitlab.manjaro.org/packages/extra/nvidia-340xx-utils.git

** git clone https://gitlab.manjaro.org/packages/multilib/lib32-nvidia-340xx-utils.git**

** git clone https://github.com/philmmanjaro/nvidia-340xx-dkms.git**

** cd nvidia-340xx-utils && makepkg -si**

** cd …/lib32-nvidia-340xx-utils && makepkg -si**

** cd …/nvidia-340xx-dkms && makepkg -si**

this is my context:

kernel: 4.19.163-1- Manjaro x86_64
GPU: NVIDIA C79 (GEFORCE 9400 M) Driver:N/A

mhwd -li gives:
network-broadcom-wl
video-linux
both from 2018

Thank you very much

Either install kernel 5.4 and the dkms package found here (Release 340.108-1 · philmmanjaro/nvidia-340xx-dkms · GitHub). Afterwards, every kernel 5.4 update will automatically rebuild the drivers.

Or if you need to stay on 4.19 with these instructions.

git clone https://gitlab.manjaro.org/packages/extra/linux419-extramodules/nvidia-340xx.git
cd nvidia-340xx && makepkg -sif

Afterwards a package will be created and you need to manually repeat these instructions every kernel 4.19 update.

I calculate that the “*” must be to include all the kernels (that you have installed) in the driver installation process. In my case, executing all these commands worked perfectly and so far I have no problem.

I have upgraded to kernel 5.4 I have tried to install the package from philm that you have mentioned by using the command

git clone url

without success. I get the error message

url I have typed/info/refs not valid: is it a Git repository?

could you please suggest me how to overcome this issue?

thank you very much for your help