Skip to content

Commit 36bc8e1

Browse files
committed
New package: nvidia-open-dkms-570.144
Added patches, condensed into one commit, rebase
1 parent 8ed2cfe commit 36bc8e1

4 files changed

Lines changed: 135 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
PACKAGE_NAME="nvidia"
2+
PACKAGE_VERSION="__VERSION_STRING"
3+
AUTOINSTALL="yes"
4+
5+
# By default, DKMS will add KERNELRELEASE to the make command line; however,
6+
# this will cause the kernel module build to infer that it was invoked via
7+
# Kbuild directly instead of DKMS. The dkms(8) manual page recommends quoting
8+
# the 'make' command name to suppress this behavior.
9+
MAKE[0]="'make' -j`nproc` NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=${kernelver} modules"
10+
11+
# The list of kernel modules will be generated by nvidia-installer at runtime.
12+
BUILT_MODULE_NAME[0]="nvidia"
13+
BUILT_MODULE_LOCATION[0]="kernel-open"
14+
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
15+
BUILT_MODULE_NAME[1]="nvidia-uvm"
16+
BUILT_MODULE_LOCATION[1]="kernel-open"
17+
DEST_MODULE_LOCATION[1]="/kernel/drivers/video"
18+
BUILT_MODULE_NAME[2]="nvidia-modeset"
19+
BUILT_MODULE_LOCATION[2]="kernel-open"
20+
DEST_MODULE_LOCATION[2]="/kernel/drivers/video"
21+
BUILT_MODULE_NAME[3]="nvidia-drm"
22+
BUILT_MODULE_LOCATION[3]="kernel-open"
23+
DEST_MODULE_LOCATION[3]="/kernel/drivers/video"
24+
BUILT_MODULE_NAME[4]="nvidia-peermem"
25+
BUILT_MODULE_LOCATION[4]="kernel-open"
26+
DEST_MODULE_LOCATION[4]="/kernel/drivers/video"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 69769b8ebaaeca84a5188330f80c460dcc0fa747 Mon Sep 17 00:00:00 2001
2+
From: Eric Naim <dnaim@cachyos.org>
3+
Date: Fri, 24 Jan 2025 19:34:24 +0700
4+
Subject: [PATCH] Enable atomic kernel modesetting by default
5+
6+
This is required for proper functionality under Wayland. fbdev has been default enabled since 570 so that
7+
hunk can be removed from this patch.
8+
9+
Signed-off-by: Eric Naim <dnaim@cachyos.org>
10+
---
11+
nvidia-drm/nvidia-drm-linux.c | 2 +-
12+
nvidia-drm/nvidia-drm-os-interface.c | 2 +-
13+
2 files changed, 2 insertions(+), 2 deletions(-)
14+
15+
diff --git a/nvidia-drm/nvidia-drm-linux.c b/nvidia-drm/nvidia-drm-linux.c
16+
index 0007cbf..bd0b9eb 100644
17+
--- a/kernel-open/nvidia-drm/nvidia-drm-linux.c
18+
+++ b/kernel-open/nvidia-drm/nvidia-drm-linux.c
19+
@@ -31,7 +31,7 @@
20+
21+
MODULE_PARM_DESC(
22+
modeset,
23+
- "Enable atomic kernel modesetting (1 = enable, 0 = disable (default))");
24+
+ "Enable atomic kernel modesetting (1 = enable (default), 0 = disable)");
25+
module_param_named(modeset, nv_drm_modeset_module_param, bool, 0400);
26+
27+
#if defined(NV_DRM_FBDEV_AVAILABLE)
28+
diff --git a/nvidia-drm/nvidia-drm-os-interface.c b/nvidia-drm/nvidia-drm-os-interface.c
29+
index 7617476..f22afd7 100644
30+
--- a/kernel-open/nvidia-drm/nvidia-drm-os-interface.c
31+
+++ b/kernel-open/nvidia-drm/nvidia-drm-os-interface.c
32+
@@ -41,7 +41,7 @@
33+
#include <drm/drmP.h>
34+
#endif
35+
36+
-bool nv_drm_modeset_module_param = false;
37+
+bool nv_drm_modeset_module_param = true;
38+
bool nv_drm_fbdev_module_param = true;
39+
40+
void *nv_drm_calloc(size_t nmemb, size_t size)
41+
--
42+
2.48.1
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 1484c9ee0a60468dfd88954011fae0e28c0f73de Mon Sep 17 00:00:00 2001
2+
From: Peter Jung <admin@ptr1337.dev>
3+
Date: Fri, 18 Oct 2024 22:40:58 +0200
4+
Subject: [PATCH 3/6] Add IBT support
5+
6+
Signed-off-by: Peter Jung <admin@ptr1337.dev>
7+
---
8+
src/nvidia-modeset/Makefile | 1 +
9+
1 file changed, 1 insertion(+)
10+
11+
diff --git a/src/nvidia-modeset/Makefile b/src/nvidia-modeset/Makefile
12+
index 2b96f3fa..ed934014 100644
13+
--- a/src/nvidia-modeset/Makefile
14+
+++ b/src/nvidia-modeset/Makefile
15+
@@ -151,6 +151,7 @@ ifeq ($(TARGET_ARCH),x86_64)
16+
CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
17+
CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
18+
CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
19+
+ CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
20+
endif
21+
22+
CFLAGS += $(CONDITIONAL_CFLAGS)
23+
--
24+
2.47.0
25+

srcpkgs/nvidia-open-dkms/template

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Template file for 'nvidia-open-dkms'
2+
# In the current state, for first install you can install nvidia from repos and then installing nvidia-open-dkms via xbps-src
3+
# Updating requires rebasing/locally merging PR onto master
4+
# (unless you just manually recreate the files to not mess with git) and either:
5+
# A) adjusting the nvidia template to no longer require nvidia-dkms package and building both locally
6+
# B) temporarily switching to the proprietary dkms module, building nvidia-open-dkms and installing it afterwards
7+
8+
pkgname=nvidia-open-dkms
9+
version=570.144
10+
revision=1
11+
archs="x86_64"
12+
depends="dkms nvidia"
13+
short_desc="NVIDIA Linux open GPU kernel module source"
14+
maintainer="JkktBkkt <apkabikov@gmail.com>"
15+
license="GPL-2.0-only, MIT"
16+
homepage="https://github.com/NVIDIA/open-gpu-kernel-modules"
17+
distfiles="https://download.nvidia.com/XFree86/NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${version}.tar.xz"
18+
checksum=d0e741683b7b1f07c7482ab8297c95ac3675b748a0ef3a870eab1848a05aab1f
19+
replaces="nvidia-dkms>=0"
20+
dkms_modules="nvidia-open-dkms ${version}"
21+
triggers="dkms initramfs-regenerate"
22+
23+
24+
do_install() {
25+
vmkdir usr/src/nvidia-open-dkms-${version}
26+
vcopy "*" usr/src/nvidia-open-dkms-${version}
27+
cp ${FILESDIR}/dkms.conf ${DESTDIR}/usr/src/nvidia-open-dkms-${version}/dkms.conf
28+
vsed -e "s/__VERSION_STRING/${version}/" -i ${DESTDIR}/usr/src/nvidia-open-dkms-${version}/dkms.conf
29+
30+
vmkdir usr/lib/modprobe.d
31+
echo "blacklist nouveau" > ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
32+
echo "options nvidia NVreg_OpenRmEnableUnsupportedGpus=1" >> ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
33+
chmod 644 ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
34+
35+
vdoc README.md
36+
vlicense COPYING
37+
38+
pkg_install() {
39+
vmove usr/src
40+
vmove usr/lib/modprobe.d
41+
}
42+
}

0 commit comments

Comments
 (0)