Skip to content

Commit dae220b

Browse files
committed
x11-drivers/nvidia-drivers: Sync with Gentoo
It's from Gentoo commit 8fc981d8eceaa64339265076362d51cfb0f164ba.
1 parent 777065d commit dae220b

19 files changed

+798
-1273
lines changed

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/Manifest

Lines changed: 34 additions & 18 deletions
Large diffs are not rendered by default.

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-390.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# NVIDIA drivers options
22
# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
33

4-
# nvidia-drivers and nouveau cannot be used at same time.
5-
# Comment out the following line if you wish to allow nouveau.
4+
# nvidia-drivers and nouveau / nova cannot be used at same time.
5+
# Comment out the following lines if you wish to allow either.
66
blacklist nouveau
7+
blacklist nova_core
78

89
# !!! Security Warning !!!
910
# Do not change the DeviceFile options unless you know what you are doing.

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-470.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# NVIDIA drivers options
22
# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
33

4-
# nvidia-drivers and nouveau cannot be used at same time.
5-
# Comment out the following line if you wish to allow nouveau.
4+
# nvidia-drivers and nouveau / nova cannot be used at same time.
5+
# Comment out the following lines if you wish to allow either.
66
blacklist nouveau
7+
blacklist nova_core
78

89
# Kernel Mode Setting (needed for wayland but is hardly usable with legacy 470)
910
# Enabling may possibly cause issues with SLI and Reverse PRIME.

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-545.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# NVIDIA drivers options
22
# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
33

4-
# nvidia-drivers and nouveau cannot be used at same time.
5-
# Comment out the following line if you wish to allow nouveau.
4+
# nvidia-drivers and nouveau / nova cannot be used at same time.
5+
# Comment out the following lines if you wish to allow either.
66
blacklist nouveau
7+
blacklist nova_core
78

89
# Kernel Mode Setting (notably needed for fbdev and wayland).
910
# Enabling may possibly cause issues with SLI and Reverse PRIME.

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-570.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# NVIDIA drivers options
22
# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
33

4-
# nvidia-drivers and nouveau cannot be used at same time.
5-
# Comment out the following line if you wish to allow nouveau.
4+
# nvidia-drivers and nouveau / nova cannot be used at same time.
5+
# Comment out the following lines if you wish to allow either.
66
blacklist nouveau
7+
blacklist nova_core
78

89
# Kernel Mode Setting (notably needed for fbdev and wayland).
910
# Enabling may possibly cause issues with SLI and Reverse PRIME.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Only needed with USE=-kernel-open to avoid GPL-only __vma_start_write,
2+
not really runtime-tested but at least code does nothing for stable users
3+
with <6.15..
4+
5+
https://github.com/NVIDIA/open-gpu-kernel-modules/issues/840#issuecomment-2906864735
6+
https://github.com/CachyOS/kernel-patches/commit/914aea4298e3
7+
--- a/kernel/nvidia/nv-mmap.c
8+
+++ b/kernel/nvidia/nv-mmap.c
9+
@@ -24,8 +24,15 @@
10+
#define __NO_VERSION__
11+
12+
+#include <linux/version.h>
13+
+
14+
#include "os-interface.h"
15+
#include "nv-linux.h"
16+
#include "nv_speculation_barrier.h"
17+
18+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
19+
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
20+
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
21+
+#endif
22+
+
23+
/*
24+
* The 'struct vm_operations' open() callback is called by the Linux
25+
--- a/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
26+
+++ b/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
27+
@@ -45,4 +45,11 @@
28+
#endif
29+
30+
+#include <linux/version.h>
31+
+
32+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
33+
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
34+
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
35+
+#endif
36+
+
37+
static inline
38+
void __nv_drm_gem_user_memory_free(struct nv_drm_gem_object *nv_gem)
39+
--- a/kernel/nvidia-drm/nvidia-drm-gem.c
40+
+++ b/kernel/nvidia-drm/nvidia-drm-gem.c
41+
@@ -52,4 +52,11 @@
42+
#include "nv-mm.h"
43+
44+
+#include <linux/version.h>
45+
+
46+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
47+
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
48+
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
49+
+#endif
50+
+
51+
void nv_drm_gem_free(struct drm_gem_object *gem)
52+
{
53+
--- a/kernel/nvidia-uvm/uvm.c
54+
+++ b/kernel/nvidia-uvm/uvm.c
55+
@@ -22,4 +22,6 @@
56+
*******************************************************************************/
57+
58+
+#include <linux/version.h>
59+
+
60+
#include "uvm_api.h"
61+
#include "uvm_global.h"
62+
@@ -41,4 +43,9 @@
63+
#define NVIDIA_UVM_DEVICE_NAME "nvidia-uvm"
64+
65+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
66+
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
67+
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
68+
+#endif
69+
+
70+
static dev_t g_uvm_base_dev;
71+
static struct cdev g_uvm_cdev;

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/metadata.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
</maintainer>
1212
<use>
1313
<flag name="kernel-open">
14-
Use the open source variant of the drivers
15-
(Turing/Ampere+ GPUs only, aka GTX 1650+ --
16-
recommended with >=560.xx drivers if usable and
17-
it may be required for 50xx Blackwell+ GPUs)
14+
Use the open source variant of the drivers (only
15+
works for Turing/Ampere or newer GPUs, aka GTX 1650+
16+
-- recommended with >=560.xx drivers if usable and
17+
is *required* for 50xx Blackwell or newer GPUs)
1818
</flag>
1919
<flag name="persistenced">Install the persistence daemon for keeping devices state when unused (e.g. for headless)</flag>
2020
<flag name="powerd">Install the NVIDIA dynamic boost support daemon (only useful with specific laptops, ignore if unsure)</flag>
@@ -30,4 +30,12 @@
3030
<remote-id type="github">NVIDIA/nvidia-xconfig</remote-id>
3131
<remote-id type="github">NVIDIA/open-gpu-kernel-modules</remote-id>
3232
</upstream>
33+
<slots>
34+
<subslots>
35+
Subslot is primarily used to identify branches, at most
36+
rebuilding reverse dependencies on bumps would only be
37+
for the static library (not essential to) given other
38+
headers are provided by nvidia-cuda-toolkit instead.
39+
</subslots>
40+
</slots>
3341
</pkgmetadata>

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
EAPI=8
55

66
MODULES_OPTIONAL_IUSE=+modules
7-
inherit desktop eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
7+
inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
88
inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
99

1010
MODULES_KERNEL_MAX=6.1
@@ -152,6 +152,8 @@ src_compile() {
152152
tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
153153
local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
154154

155+
use static-libs && lto-guarantee-fat
156+
155157
# dead branch that will never be fixed and due for eventual removal,
156158
# so keeping lazy "fixes" (bug #921370)
157159
local kcflags=(
@@ -324,6 +326,7 @@ documentation that is installed alongside this README."
324326

325327
if use static-libs; then
326328
dolib.a nvidia-settings/src/libXNVCtrl/libXNVCtrl.a
329+
strip-lto-bytecode
327330

328331
insinto /usr/include/NVCtrl
329332
doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h

sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
EAPI=8
55

66
MODULES_OPTIONAL_IUSE=+modules
7-
inherit desktop eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
7+
inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
88
inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
99

1010
MODULES_KERNEL_MAX=6.6
@@ -149,8 +149,8 @@ src_compile() {
149149
CC+=" $(test-flags-CC "${kcflags[@]}")"
150150
use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")"
151151

152+
# extra flags for the libXNVCtrl.a static library
152153
local xnvflags=-fPIC #840389
153-
# lto static libraries tend to cause problems without fat objects
154154
tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
155155

156156
NV_ARGS=(
@@ -294,6 +294,7 @@ documentation that is installed alongside this README."
294294

295295
if use static-libs; then
296296
dolib.a nvidia-settings/src/out/libXNVCtrl.a
297+
strip-lto-bytecode
297298

298299
insinto /usr/include/NVCtrl
299300
doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h

0 commit comments

Comments
 (0)