Help me install the Nvidia 340 driver

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

Please post the exact command you ran.

`git clone https://github.com/philmmanjaro/nvidia-340xx-dkms/releases/tag/340.108-1`

thank you

That URL is incorrect, I’m not sure where you got it.

I have got it by clicking on the hypertext in this message

and copying it from the bar.

Are you referring to a typo or is there a different procedure for getting the URL that I should use?

thank you

Please refer to the marked solution of this thread to see how you can install it. Note that you need to modify the linux419 part to match your kernel version in the last URL. And you also need to run makepkg -si after you ran cd nvidia-340xx.

in order to do that is it sufficient to substitute linux419 with linux54 ?

You aren’t suppoesd to git clone that link! You were supposed to click on it, download the zst file in the link, and manually install it with pamac or pacman.

That should be enough.

There is a new version of the dkms driver on AUR (340.108-13) but when I try to build it I am confronted again with the error

make[1]: *** /usr/src/linux: No such file or directory.  Stop.

How did you resolve it for your build? A symlink pointing to kernel headers?

OK, I found how to fix the issue. Here are the changes I made to the AUR dkms package to compile and install on Manjaro (3 lines to edit):

diff --git a/PKGBUILD b/PKGBUILD
index 9026944..2bbbae1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -29,7 +29,7 @@ _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
 
 # default is 'linux' substitute custom name here
 _kernelname=linux
-_kernver="$(</usr/src/$_kernelname/version)"
+_kernver="$(uname -r)"
 _extradir="/usr/lib/modules/$_kernver/extramodules"
 
 prepare() {
@@ -46,10 +46,10 @@ prepare() {
 
 build() {
   cd "${_pkg}/kernel"
-  make SYSSRC="/usr/src/$_kernelname" module
+  make SYSSRC="/usr/lib/modules/$_kernver/build" module
 
   cd uvm
-  make SYSSRC="/usr/src/$_kernelname" module
+  make SYSSRC="/usr/lib/modules/$_kernver/build" module
 }
 
 package_nvidia-340xx() {
1 Like

Hello I have removed the lines with sign - and added the ones with sign +, but I get an error. Is that what you have to do, or leave the lines as they appear in the image with the - and + signs? Or you could put the whole pkgbuild… Greetings

Sorry I do not have the laptop with me now so I can’t send you the PKGBUILD file. What error do you get?

This repository contains a working PKGBUILD for Manjaro. You can run

git clone https://github.com/philmmanjaro/nvidia-340xx-dkms
cd nvidia-340xx-dkms
makepkg -si