[HowTo] get legacy 340xx NVIDIA drivers back

Prepare your system for building drivers

  • you may want to install development tools: sudo pacman -S git base-devel
  • then you may want to install your proper kernel headers: sudo pacman -S $(mhwd-kernel -li | grep '*' | cut -d ' ' -f5 | awk '{print $0,"-headers"}' | sed s'/ //'g)

340xx (dkms for kernel 5.4 or 5.10 only)

You need to get the sources first:

 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

Then compile all packages with makepkg:

 cd nvidia-340xx-utils && makepkg -si
 cd ../lib32-nvidia-340xx-utils && makepkg -si
 cd ../nvidia-340xx-dkms && makepkg -si

To bypass incompatibility with the current xorg, the IgnoreABI option needs to be added to xorg config. To do that, create the file /etc/X11/xorg.conf.d/30-nvidia-ignoreabi.conf from terminal:

sudo nano /etc/X11/xorg.conf.d/30-nvidia-ignoreabi.conf

Add the following content to this newly created file:

Section "Files"
  ModulePath   "/usr/lib64/nvidia/xorg"
  ModulePath   "/usr/lib64/xorg/modules"
EndSection

Section "Device"
  Identifier "Nvidia Card"
  Driver "nvidia"
  VendorName "NVIDIA Corporation"
EndSection

Section "ServerFlags"
  Option "IgnoreABI" "1"
EndSection

Save the file and exit nano text editor by pressing CTRL+X then Y (you can follow at the bottom what it does). It should save the file, close nano, and bring you back to the terminal.

If you have the AUR enabled in Pamac, updating the system will fail because it will try to update these Nvidia packages from the AUR, and differences between Arch and Manjaro kernel creates incompatibility with these AUR packages.
To avoid that, you will need to add these Nvidia packages to the ignore list in Pamac from it settings in Preferences → Advanced → Ignore List (searching for Nvidia and selecting the packages to add them to the ignore list).

With this you will have 340xx driver, even if Manjaro officially dropped it.

9 Likes


That one also has additional info/tips for older kernels 4.14 and 4.19 .

1 Like

Is it possible to have these packages already compiled and downloadable vie palace, or somewhere else. To be honest I don’t get the point of having each user with 340xx drivers doing the same work, if it need to be done only once and presented by all.
Maybe I am missing out something, but I am a New Linux user and non-techie and would have to teach myselv how to compile in the first place.

2 Likes

You can also switch to Nouveau drivers.

I did. Even simple games are freezing. At least Firefox is reliable.

1 Like

@ratatosk in fact you just install it and forget… it is a dkms. The nvidia drivers are already precompiled (it is proprietary ), it is just some minor patching and recompiling (some adjustment) every time you update the kernel and that will be done automatically…

@codesardine

Could you also add the configurations which mhwd made? Because without it, all systems will not boot and if the user removed the driver with mhwd, then the file mhwd-gpu.conf is empty anyway.

This creates a default xorg.conf file:

sudo nvidia-xconfig

That adds nouveau to the blacklist:

sudo echo -e "blacklist nouveau\nblacklist ttm\nblacklist drm_kms_helper\nblacklist drm" > /etc/modprobe.d/nvidia.conf

This loads the nvidia driver on boot:

sudo echo -e "nvidia\nnvidia-drm" > /etc/modules-load.d/nvida.conf
2 Likes

@philm is the right person to tell you those.

Please, how do I uninstall these drivers to go back to nouveau?

Same as always - remove the package.

Just removing the package will not break kernel (headers)?

Removing the package will remove the driver. You need another driver installed for graphics to work if the nvidia card is your only graphics adapter or else you’ll probably fall back to text mode (where you could reinstall the removed package from cache).

1 Like

A post was split to a new topic: Problems with installing nvidia 340xx

I think this should be updated to add the ignoreABI trick in a config file to bypass the xorg incompatibility.

Section "ServerFlags"
  Option "IgnoreABI" "1"
EndSection

@codesardine

Also the AUR package nvidia-340xx-dkms has many patches for many kernels.

Just a suggestion to make this guide working for current state of packages (especially because of xorg update breaking compatibility).

@codesardine your post is not wiki editable so please have a look at this KDE plasma freezes all the time - #9 by omano and please add the needed missing parts:

  • the config file for the xorg ABI issue

But you will also need to manually add a configuration file to bypass incompatibility with the current xorg in Manjaro, following these instruction, before rebooting:

Create the file /etc/X11/xorg.conf.d/30-nvidia-ignoreabi.conf from terminal

sudo nano /etc/X11/xorg.conf.d/30-nvidia-ignoreabi.conf

Copy and paste the following to this file

Section "Files"
  ModulePath   "/usr/lib64/nvidia/xorg"
  ModulePath   "/usr/lib64/xorg/modules"
EndSection

Section "Device"
  Identifier "Nvidia Card"
  Driver "nvidia"
  VendorName "NVIDIA Corporation"
EndSection

Section "ServerFlags"
  Option "IgnoreABI" "1"
EndSection

Save the file and exit nano text editor by pressing CTRL+X then Y (you can follow at the bottom what it does). It should bring you back to the terminal.

  • the ignorepackage addition because of the AUR trying to install/update/replace the installed packages and failing (adding all Nvidia packages to ignore list), resulting in being unable to install/update any package from Pamac when AUR is enabled.

  • the blacklisting of nouveau in modprobe even if not required this may be good to do it

1 Like

I have made it wiki editable.

1 Like

Thanks. I assume I’ll have to add it then, that’s OK.

A post was split to a new topic: Nvidia dkms module fail after recent update