Thank you for the tips!
I tried to install that driver but an error occured:
Preparing...
Checking nvidia-340xx-dkms dependencies...
Resolving dependencies...
Checking inter-conflicts...
To build (1):
nvidia-340xx-dkms 340.108-28 AUR
Edit build files : [e]
Apply transaction ? [e/y/N] y
Building nvidia-340xx...
/var/tmp/pamac-build-pietari/nvidia-340xx/PKGBUILD: line 43: /usr/src/linux/version: No such file or directory
==> Making package: nvidia-340xx 340.108-28 (pe 28. tammikuuta 2022 18.09.50)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found NVIDIA-Linux-x86_64-340.108-no-compat32.run
-> Found 20-nvidia.conf
-> Found 0001-kernel-5.7.patch
-> Found 0002-kernel-5.8.patch
-> Found 0003-kernel-5.9.patch
-> Found 0004-kernel-5.10.patch
-> Found 0005-kernel-5.11.patch
-> Found 0006-kernel-5.14.patch
-> Found 0007-kernel-5.15.patch
-> Found 0008-kernel-5.16.patch
==> Validating source files with b2sums...
NVIDIA-Linux-x86_64-340.108-no-compat32.run ... Passed
20-nvidia.conf ... Passed
0001-kernel-5.7.patch ... Passed
0002-kernel-5.8.patch ... Passed
0003-kernel-5.9.patch ... Passed
0004-kernel-5.10.patch ... Passed
0005-kernel-5.11.patch ... Passed
0006-kernel-5.14.patch ... Passed
0007-kernel-5.15.patch ... Passed
0008-kernel-5.16.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Starting prepare()...
Creating directory NVIDIA-Linux-x86_64-340.108-no-compat32
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 340.108...........................................................................................................................................................................................................
Applying patch 0001-kernel-5.7.patch...
patching file kernel/Makefile
patching file kernel/conftest.sh
patching file kernel/dkms.conf
patching file kernel/nv-drm.c
patching file kernel/nv-linux.h
patching file kernel/nv-procfs.c
patching file kernel/nv-time.h
patching file kernel/nv.c
patching file kernel/os-interface.c
patching file kernel/uvm/Makefile
patching file kernel/uvm/conftest.sh
patching file kernel/uvm/nvidia_uvm_lite.c
Applying patch 0002-kernel-5.8.patch...
patching file kernel/nv-linux.h
patching file kernel/nvidia-modules-common.mk
patching file kernel/os-mlock.c
patching file kernel/uvm/nvidia_uvm_lite_api.c
Applying patch 0003-kernel-5.9.patch...
patching file kernel/nv-drm.c
patching file kernel/nv-linux.h
patching file kernel/nv.c
patching file kernel/uvm/nvidia_uvm_linux.h
Applying patch 0004-kernel-5.10.patch...
patching file kernel/nv-drm.c
Hunk #1 succeeded at 364 (offset 42 lines).
Applying patch 0005-kernel-5.11.patch...
patching file kernel/conftest.sh
patching file kernel/nv-drm.c
Hunk #1 succeeded at 59 (offset -1 lines).
Hunk #2 succeeded at 211 (offset -1 lines).
Hunk #3 succeeded at 242 (offset -1 lines).
Hunk #4 succeeded at 278 (offset -1 lines).
Hunk #5 succeeded at 408 (offset -2 lines).
Hunk #6 succeeded at 459 (offset -2 lines).
patching file kernel/nv-linux.h
patching file kernel/uvm/nvidia_uvm_linux.h
Applying patch 0006-kernel-5.14.patch...
patching file kernel/nv-drm.c
patching file kernel/os-interface.c
Applying patch 0007-kernel-5.15.patch...
patching file kernel/nv-drm.c
Hunk #1 succeeded at 606 (offset 77 lines).
Applying patch 0008-kernel-5.16.patch...
patching file kernel/os-interface.h
patching file kernel/nv.h
==> Removing existing $pkgdir/ directory...
==> Starting build()...
NVIDIA: calling KBUILD...
make[1]: *** /usr/src/linux: No such file or directory. Stop.
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:202: nvidia.ko] Error 1
==> ERROR: A failure occurred in build().
Aborting...
-Pietari