@Yomi95 Thanks for your feedback. And yes, Linux kernel sources and GCC have to be up to date. I'm also under Linux kernel 7.0.5-arch1-1.
Search Criteria
Package Details: nvidia-340xx 340.108-39
Package Actions
| Git Clone URL: | https://aur.archlinux.org/nvidia-340xx.git (read-only, click to copy) |
|---|---|
| Package Base: | nvidia-340xx |
| Description: | NVIDIA drivers for linux, 340xx legacy branch |
| Upstream URL: | https://www.nvidia.com/ |
| Licenses: | custom |
| Conflicts: | nvidia |
| Submitter: | simonsmh |
| Maintainer: | JerryXiao |
| Last Packager: | JerryXiao |
| Votes: | 74 |
| Popularity: | 0.036016 |
| First Submitted: | 2019-06-07 10:29 (UTC) |
| Last Updated: | 2025-08-03 10:26 (UTC) |
Dependencies (6)
- libgl (libglvnd-gitAUR, amdgpu-pro-oglp-legacyAUR, nvidia-340xx-utilsAUR, amdgpu-pro-oglpAUR, nvidia-340xx-utils-macbookAUR, libglvnd)
- linux (linux-galaxyaudioAUR, linux-mnt-reform-binAUR, solara-kernelAUR, linux-galaxyaudio-binAUR)
- nvidia-340xx-utilsAUR (nvidia-340xx-utils-macbookAUR)
- linux (linux-galaxyaudioAUR, linux-mnt-reform-binAUR, solara-kernelAUR, linux-galaxyaudio-binAUR) (make)
- linux-headers (linux-mnt-reform-bin-headersAUR, linux-galaxyaudio-headers-binAUR) (make)
- nvidia-340xx-utilsAUR (nvidia-340xx-utils-macbookAUR) (make)
Required by (5)
- bumblebee-forceunload (optional)
- bumblebee-git (optional)
- bumblebee-picasso-git (optional)
- nvfancontrol (optional)
- nvfancontrol-git (optional)
Sources (21)
- 0001-kernel-5.7.patch
- 0002-kernel-5.8.patch
- 0003-kernel-5.9.patch
- 0004-kernel-5.10.patch
- 0005-kernel-5.11.patch
- 0006-kernel-5.14.patch
- 0007-kernel-5.15.patch
- 0008-kernel-5.16.patch
- 0009-kernel-5.17.patch
- 0010-kernel-5.18.patch
- 0011-kernel-6.0.patch
- 0012-kernel-6.2.patch
- 0013-kernel-6.3.patch
- 0014-kernel-6.5.patch
- 0015-kernel-6.6.patch
- 0016-kernel-6.8.patch
- 0017-gcc-14.patch
- 0018-gcc-15.patch
- 0019-kernel-6.15.patch
- 20-nvidia.conf
- https://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/NVIDIA-Linux-x86_64-340.108-no-compat32.run
Unix-Like commented on 2026-05-12 09:41 (UTC)
Yomi95 commented on 2026-05-12 09:19 (UTC) (edited on 2026-05-12 09:26 (UTC) by Yomi95)
Thanks for the patches 0020 0021, Unix-Like and r3n4n
Working well on Linux Arch 7.0.5 and Zen
What I did:
git clone latest patched repo or this one + patching
cd nvidia-340xx
NVIDIA_340XX_DKMS_ONLY=1 makepkg -si
P.S After many failed attempts I learned you NEED to compile it from the new Kernel 7.0 with newest gcc/gcc-libs 16.1.1 for it to work, cuz I keep using latest Zen stable till nvidia gets patch.
P.S2 If you guys use chromium browsers like Brave Origin and gpu support stopped working DISABLE > "Fallback to software if GLES3 is not supported" in chrome://flags
Idk if needed but I use "Override software rendering list" too and some others!
Unix-Like commented on 2026-05-09 19:41 (UTC) (edited on 2026-05-09 19:44 (UTC) by Unix-Like)
It's done, nvidia-340xx-340.108-41 or clone it.
r3n4n commented on 2026-05-09 19:36 (UTC)
You're welcome. Please feel free to post it on GitHub; I don't use GitHub.
Unix-Like commented on 2026-05-09 19:26 (UTC) (edited on 2026-05-09 19:34 (UTC) by Unix-Like)
Hi @r3n4n. It works for me too. Thank you so much. As last time, I can publish your work on my Github fork repo and create a pull request if you want. I am currently on Linux kernel 7.0.3-arch1-2.
r3n4n commented on 2026-05-09 18:37 (UTC)
Hi, for compatibility with Kernel 7 and gcc16 I have made a patch(based upon https://aur.archlinux.org/cgit/aur.git/tree/nvidia-470xx-fix-linux-7.0.patch?h=nvidia-470xx-utils):
diff --color --unified --recursive --text a/kernel/conftest.sh b/kernel/conftest.sh
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -196,7 +196,7 @@
}
build_cflags() {
- BASE_CFLAGS="-I${SCRIPTDIR} -std=gnu17 -O2 -Wno-implicit-function-declaration -Wno-incompatible-pointer-types -D__KERNEL__ \
+ BASE_CFLAGS="-I${SCRIPTDIR} -std=gnu17 -fms-extensions -Wunused-but-set-variable=3 -O2 -Wno-implicit-function-declaration -Wno-incompatible-pointer-types -D__KERNEL__ \
-DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
-nostdinc -isystem $ISYSTEM"
diff --color --unified --recursive --text a/kernel/nv.c b/kernel/nv.c
--- a/kernel/nv.c
+++ b/kernel/nv.c
@@ -1455,7 +1455,13 @@
#endif
#if !defined(NV_VMWARE) && \
(defined(NVCPU_X86) || defined(NVCPU_X86_64))
- if (nv->primary_vga && (screen_info.orig_video_isVGA != 0x01))
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 20, 0)
+ // Rel. commit "sysfb: Replace screen_info with sysfb_primary_display" (Thomas Zimmermann, 26 Nov 2025)
+ const struct screen_info *si = &sysfb_primary_display.screen;
+#else
+ const struct screen_info *si = &screen_info;
+#endif
+ if (nv->primary_vga && (si->orig_video_isVGA != 0x01))
{
if (!nv_fbdev_failure_detected)
{
diff --color --unified --recursive --text a/kernel/nvidia-modules-common.mk b/kernel/nvidia-modules-common.mk
--- a/kernel/nvidia-modules-common.mk
+++ b/kernel/nvidia-modules-common.mk
@@ -39,7 +39,7 @@
ccflags-y += -std=gnu17
ccflags-y += -I$(src)
-ccflags-y += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
+ccflags-y += -Wunused-but-set-variable=3 -fms-extensions -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
#
# Output directory for the build; default to the source directory if not set.
diff --color --unified --recursive --text a/kernel/nv-linux.h b/kernel/nv-linux.h
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -178,6 +178,9 @@
#endif
#if defined(NV_LINUX_SCREEN_INFO_H_PRESENT)
#include <linux/screen_info.h> /* screen_info */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 20, 0)
+#include <linux/sysfb.h> /* sysfb_primary_display */
+#endif
#else
#include <linux/tty.h> /* screen_info */
#endif
diff --color --unified --recursive --text a/kernel/os-interface.c b/kernel/os-interface.c
--- a/kernel/os-interface.c
+++ b/kernel/os-interface.c
@@ -1153,12 +1153,18 @@
#if !defined(NV_VMWARE) && (defined(NVCPU_X86) || defined(NVCPU_X86_64))
if (NV_EFI_ENABLED())
{
- *pPhysicalAddress = screen_info.lfb_base;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 20, 0)
+ // Rel. commit "sysfb: Replace screen_info with sysfb_primary_display" (Thomas Zimmermann, 26 Nov 2025)
+ const struct screen_info *si = &sysfb_primary_display.screen;
+#else
+ const struct screen_info *si = &screen_info;
+#endif
+ *pPhysicalAddress = si->lfb_base;
#if defined(VIDEO_CAPABILITY_64BIT_BASE)
- *pPhysicalAddress |= (NvU64)screen_info.ext_lfb_base << 32;
+ *pPhysicalAddress |= (NvU64)si->ext_lfb_base << 32;
#endif
- *pHeight = screen_info.lfb_height;
- *pPitch = screen_info.lfb_linelength;
+ *pHeight = si->lfb_height;
+ *pPitch = si->lfb_linelength;
return RM_OK;
}
#endif
diff --color --unified --recursive --text a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
--- a/kernel/uvm/conftest.sh
+++ b/kernel/uvm/conftest.sh
@@ -196,7 +196,7 @@
}
build_cflags() {
- BASE_CFLAGS="-std=gnu17 -O2 -Wno-implicit-function-declaration -Wno-incompatible-pointer-types -D__KERNEL__ \
+ BASE_CFLAGS="-std=gnu17 -fms-extensions -Wunused-but-set-variable=3 -O2 -Wno-implicit-function-declaration -Wno-incompatible-pointer-types -D__KERNEL__ \
-DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
-nostdinc -isystem $ISYSTEM"
HaP commented on 2026-05-07 17:38 (UTC)
actually now that i've read the comments i see that there's an lts-dkms package, which seems weird since dkms gives you one package for all kernel versions and branches for free. dkms packages for zfs, zenpower, xtables, xone, nvidia 390,430,470,510,525,535,550,575,575open,570 and beta and others do not have separate dkms packages for different kernels (flavors). is there some inherent difference of linux-lts that specifically nvidia-340xx-lts-dkms should be used with lts? if so, it should be noted on the wiki and maybe in package descriptions or something, because i for one didn't even consider variations of dkms packages existing, i just typed in nvidia-340xx-dkms as seen on the wiki and installed it. works fine on lts btw.
HaP commented on 2026-05-07 17:17 (UTC)
@TheExplorer there are also not so niche usecases such as using an aur helper and a non vanilla kernel (lts or zen), where the appropriate headers for the kernel you're using are required, and not linux vanilla headers. to reiterate, requiring "linux-headers" does not make the package manager pull the apropriate headers, it makes it pull the vanilla linux headers, and thus its dependencies such as vanilla linux, and thus its hooks and dependencies such as making two initcpios filling up your efi partition or whatever.
Lili1228 commented on 2026-04-27 11:15 (UTC)
Re https://aur.archlinux.org/packages/nvidia-340xx-dkms#comment-1060354 : because that's what the wiki recommends and there are some niche scenarios (having a kernel inside coreboot came to my mind first) where you don't have any kernel installed.
Kanogul commented on 2026-04-17 00:05 (UTC) (edited on 2026-04-17 00:05 (UTC) by Kanogul)
Hello, is it possible to get 0019-kernel-6.15.patch added to the LTS version of this package? The LTS kernel is now throwing the associated 6.15 errors. There have been requests out for several weeks on that package's page, and I'm not sure if the correct people have seen them. Thanks!
Pinned Comments
JerryXiao commented on 2022-10-13 03:51 (UTC) (edited on 2022-10-14 02:44 (UTC) by JerryXiao)
For testing users, contributors: check out https://github.com/archlinux-jerry/nvidia-340xx
Warning: force push may happen to match the aur tree