From ab0f97a55e32e617d6e702261adbd39f5bd6d4bc Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 10 Aug 2026 10:00:40 +0200 Subject: [PATCH 1/2] overlay nvidia-drivers: move from portage-stable Signed-off-by: Dongsu Park --- .../x11-drivers/nvidia-drivers/Manifest | 0 .../files/95-nvidia-settings-r1 | 0 .../nvidia-drivers/files/nvidia-470.conf | 0 .../nvidia-drivers/files/nvidia-570.conf | 0 ...-module-source-515.86.01-raw-ldflags.patch | 0 .../nvidia-modprobe-390.141-uvm-perms.patch | 0 .../files/nvidia-persistenced.confd | 0 .../files/nvidia-persistenced.initd | 0 .../nvidia-drivers/files/nvidia-powerd.initd | 0 .../nvidia-settings-390.144-raw-ldflags.patch | 0 .../nvidia-settings-530.30.02-desktop.patch | 0 .../nvidia-drivers/files/system-sleep.elogind | 0 .../x11-drivers/nvidia-drivers/metadata.xml | 0 .../nvidia-drivers-535.274.02.ebuild | 0 .../nvidia-drivers-570.195.03.ebuild | 0 .../nvidia-drivers-580.95.05.ebuild | 0 .../nvidia-drivers/files/nvidia-390.conf | 22 - .../nvidia-drivers-390.154-clang15-x86.patch | 29 - .../nvidia-drivers-390.154-clang15.patch | 84 --- .../nvidia-drivers-470.141.03-clang15.patch | 110 ---- .../files/nvidia-drm-outputclass-390.conf | 7 - .../nvidia-settings-390.141-fno-common.patch | 16 - .../nvidia-settings-390.144-desktop.patch | 12 - .../nvidia-settings-390.144-no-gtk2.patch | 11 - .../nvidia-drivers-390.157.ebuild | 453 -------------- .../nvidia-drivers-470.256.02-r2.ebuild | 489 --------------- .../nvidia-drivers-580.105.08.ebuild | 591 ------------------ .../nvidia-drivers-580.94.06.ebuild | 591 ------------------ 28 files changed, 2415 deletions(-) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/Manifest (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-470.conf (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-570.conf (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/files/system-sleep.elogind (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/metadata.xml (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/nvidia-drivers-570.195.03.ebuild (100%) rename sdk_container/src/third_party/{portage-stable => coreos-overlay}/x11-drivers/nvidia-drivers/nvidia-drivers-580.95.05.ebuild (100%) delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-390.conf delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.105.08.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.94.06.ebuild diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/Manifest b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/Manifest similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/Manifest rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/Manifest diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-470.conf similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-470.conf rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-470.conf diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-570.conf b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-570.conf similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-570.conf rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-570.conf diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/system-sleep.elogind b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/system-sleep.elogind similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/system-sleep.elogind rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/system-sleep.elogind diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/metadata.xml b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/metadata.xml similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/metadata.xml rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/metadata.xml diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-570.195.03.ebuild b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-570.195.03.ebuild similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-570.195.03.ebuild rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-570.195.03.ebuild diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.95.05.ebuild b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-580.95.05.ebuild similarity index 100% rename from sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.95.05.ebuild rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-580.95.05.ebuild diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-390.conf b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-390.conf deleted file mode 100644 index bf2eb3fb52e..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-390.conf +++ /dev/null @@ -1,22 +0,0 @@ -# NVIDIA drivers options -# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. - -# nvidia-drivers and nouveau / nova cannot be used at same time. -# Comment out the following lines if you wish to allow either. -blacklist nouveau -blacklist nova_core - -# !!! Security Warning !!! -# Do not change the DeviceFile options unless you know what you are doing. -# Only add trusted users to the 'video' group, these users may be able to -# crash, compromise, or irreparably damage the machine. -options nvidia \ - NVreg_DeviceFileGID=@VIDEOGID@ \ - NVreg_DeviceFileMode=432 \ - NVreg_DeviceFileUID=0 \ - NVreg_ModifyDeviceFiles=1 - -# Should be no need to touch anything below. -alias char-major-195 nvidia -alias /dev/nvidiactl char-major-195 -remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch deleted file mode 100644 index 98eaee94907..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch +++ /dev/null @@ -1,29 +0,0 @@ -Kernel's makefiles pass -Werror=strict-prototypes which -can trigger errors depending on compiler defaults. -https://bugs.gentoo.org/870238 -https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377 ---- a/kernel/nvidia/nvlink_linux.c -+++ b/kernel/nvidia/nvlink_linux.c -@@ -639 +639 @@ --void * NVLINK_API_CALL nvlink_allocLock() -+void * NVLINK_API_CALL nvlink_allocLock(void) ---- a/kernel/nvidia/os-interface.c -+++ b/kernel/nvidia/os-interface.c -@@ -879 +879 @@ --NV_STATUS NV_API_CALL os_flush_cpu_cache() -+NV_STATUS NV_API_CALL os_flush_cpu_cache(void) -@@ -886 +886 @@ --NV_STATUS NV_API_CALL os_flush_cpu_cache_all() -+NV_STATUS NV_API_CALL os_flush_cpu_cache_all(void) -@@ -944 +944 @@ --void NV_API_CALL os_flush_cpu_write_combine_buffer() -+void NV_API_CALL os_flush_cpu_write_combine_buffer(void) -@@ -1073 +1073 @@ --NvU32 NV_API_CALL os_get_cpu_number() -+NvU32 NV_API_CALL os_get_cpu_number(void) -@@ -1080 +1080 @@ --NvU32 NV_API_CALL os_get_cpu_count() -+NvU32 NV_API_CALL os_get_cpu_count(void) -@@ -1155 +1155 @@ --void NV_API_CALL os_dump_stack() -+void NV_API_CALL os_dump_stack(void) diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch deleted file mode 100644 index b08f35894fd..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch +++ /dev/null @@ -1,84 +0,0 @@ -Kernel's makefiles pass -Werror=strict-prototypes which -can trigger errors depending on compiler defaults. -https://bugs.gentoo.org/870238 -https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377 ---- a/kernel/nvidia/nvlink_linux.c -+++ b/kernel/nvidia/nvlink_linux.c -@@ -639 +639 @@ --void * NVLINK_API_CALL nvlink_allocLock() -+void * NVLINK_API_CALL nvlink_allocLock(void) ---- a/kernel/nvidia/os-interface.c -+++ b/kernel/nvidia/os-interface.c -@@ -879 +879 @@ --NV_STATUS NV_API_CALL os_flush_cpu_cache() -+NV_STATUS NV_API_CALL os_flush_cpu_cache(void) -@@ -886 +886 @@ --NV_STATUS NV_API_CALL os_flush_cpu_cache_all() -+NV_STATUS NV_API_CALL os_flush_cpu_cache_all(void) -@@ -944 +944 @@ --void NV_API_CALL os_flush_cpu_write_combine_buffer() -+void NV_API_CALL os_flush_cpu_write_combine_buffer(void) -@@ -1073 +1073 @@ --NvU32 NV_API_CALL os_get_cpu_number() -+NvU32 NV_API_CALL os_get_cpu_number(void) -@@ -1080 +1080 @@ --NvU32 NV_API_CALL os_get_cpu_count() -+NvU32 NV_API_CALL os_get_cpu_count(void) -@@ -1155 +1155 @@ --void NV_API_CALL os_dump_stack() -+void NV_API_CALL os_dump_stack(void) ---- a/kernel/nvidia-uvm/uvm8_lock.c -+++ b/kernel/nvidia-uvm/uvm8_lock.c -@@ -312 +312 @@ --bool __uvm_thread_check_all_unlocked() -+bool __uvm_thread_check_all_unlocked(void) ---- a/kernel/nvidia-uvm/uvm8_perf_heuristics.c -+++ b/kernel/nvidia-uvm/uvm8_perf_heuristics.c -@@ -29 +29 @@ --NV_STATUS uvm_perf_heuristics_init() -+NV_STATUS uvm_perf_heuristics_init(void) -@@ -44 +44 @@ --void uvm_perf_heuristics_exit() -+void uvm_perf_heuristics_exit(void) ---- a/kernel/nvidia-uvm/uvm8_perf_prefetch.c -+++ b/kernel/nvidia-uvm/uvm8_perf_prefetch.c -@@ -462 +462 @@ --NV_STATUS uvm_perf_prefetch_init() -+NV_STATUS uvm_perf_prefetch_init(void) -@@ -500 +500 @@ --void uvm_perf_prefetch_exit() -+void uvm_perf_prefetch_exit(void) ---- a/kernel/nvidia-uvm/uvm8_perf_thrashing.c -+++ b/kernel/nvidia-uvm/uvm8_perf_thrashing.c -@@ -1324 +1324 @@ --NV_STATUS uvm_perf_thrashing_init() -+NV_STATUS uvm_perf_thrashing_init(void) -@@ -1401 +1401 @@ --void uvm_perf_thrashing_exit() -+void uvm_perf_thrashing_exit(void) ---- a/kernel/nvidia-uvm/uvm8_procfs.c -+++ b/kernel/nvidia-uvm/uvm8_procfs.c -@@ -61 +61 @@ --NV_STATUS uvm_procfs_init() -+NV_STATUS uvm_procfs_init(void) -@@ -77 +77 @@ --void uvm_procfs_exit() -+void uvm_procfs_exit(void) -@@ -106 +106 @@ --struct proc_dir_entry *uvm_procfs_get_gpu_base_dir() -+struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void) ---- a/kernel/nvidia-uvm/uvm8_push.c -+++ b/kernel/nvidia-uvm/uvm8_push.c -@@ -103 +103 @@ --bool uvm_push_info_is_tracking_descriptions() -+bool uvm_push_info_is_tracking_descriptions(void) ---- a/kernel/nvidia-uvm/uvm8_tools.c -+++ b/kernel/nvidia-uvm/uvm8_tools.c -@@ -2041 +2041 @@ --void uvm_tools_flush_events() -+void uvm_tools_flush_events(void) ---- a/kernel/nvidia-uvm/uvm_common.c -+++ b/kernel/nvidia-uvm/uvm_common.c -@@ -63 +63 @@ --bool uvm_debug_prints_enabled() -+bool uvm_debug_prints_enabled(void) diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch deleted file mode 100644 index 334f0d1c9b1..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch +++ /dev/null @@ -1,110 +0,0 @@ -Kernel's makefiles pass -Werror=strict-prototypes which -can trigger errors depending on compiler defaults. -https://bugs.gentoo.org/870238 -https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377 ---- a/kernel/nvidia/nvlink_linux.c -+++ b/kernel/nvidia/nvlink_linux.c -@@ -571 +571 @@ --void * nvlink_allocLock() -+void * nvlink_allocLock(void) ---- a/kernel/nvidia/os-interface.c -+++ b/kernel/nvidia/os-interface.c -@@ -1076 +1076 @@ --NvU32 NV_API_CALL os_get_cpu_number() -+NvU32 NV_API_CALL os_get_cpu_number(void) -@@ -1083 +1083 @@ --NvU32 NV_API_CALL os_get_cpu_count() -+NvU32 NV_API_CALL os_get_cpu_count(void) -@@ -1136 +1136 @@ --void NV_API_CALL os_dump_stack() -+void NV_API_CALL os_dump_stack(void) ---- a/kernel/nvidia-uvm/uvm_common.c -+++ b/kernel/nvidia-uvm/uvm_common.c -@@ -37 +37 @@ --bool uvm_debug_prints_enabled() -+bool uvm_debug_prints_enabled(void) ---- a/kernel/nvidia-uvm/uvm_gpu_access_counters.c -+++ b/kernel/nvidia-uvm/uvm_gpu_access_counters.c -@@ -1527 +1527 @@ --NV_STATUS uvm_perf_access_counters_init() -+NV_STATUS uvm_perf_access_counters_init(void) -@@ -1538 +1538 @@ --void uvm_perf_access_counters_exit() -+void uvm_perf_access_counters_exit(void) ---- a/kernel/nvidia-uvm/uvm_lock.c -+++ b/kernel/nvidia-uvm/uvm_lock.c -@@ -337 +337 @@ --bool __uvm_thread_check_all_unlocked() -+bool __uvm_thread_check_all_unlocked(void) ---- a/kernel/nvidia-uvm/uvm_migrate.c -+++ b/kernel/nvidia-uvm/uvm_migrate.c -@@ -795 +795 @@ --NV_STATUS uvm_migrate_init() -+NV_STATUS uvm_migrate_init(void) -@@ -821 +821 @@ --void uvm_migrate_exit() -+void uvm_migrate_exit(void) ---- a/kernel/nvidia-uvm/uvm_migrate_pageable.c -+++ b/kernel/nvidia-uvm/uvm_migrate_pageable.c -@@ -979 +979 @@ --NV_STATUS uvm_migrate_pageable_init() -+NV_STATUS uvm_migrate_pageable_init(void) -@@ -988 +988 @@ --void uvm_migrate_pageable_exit() -+void uvm_migrate_pageable_exit(void) ---- a/kernel/nvidia-uvm/uvm_perf_heuristics.c -+++ b/kernel/nvidia-uvm/uvm_perf_heuristics.c -@@ -31 +31 @@ --NV_STATUS uvm_perf_heuristics_init() -+NV_STATUS uvm_perf_heuristics_init(void) -@@ -50 +50 @@ --void uvm_perf_heuristics_exit() -+void uvm_perf_heuristics_exit(void) ---- a/kernel/nvidia-uvm/uvm_perf_prefetch.c -+++ b/kernel/nvidia-uvm/uvm_perf_prefetch.c -@@ -463 +463 @@ --NV_STATUS uvm_perf_prefetch_init() -+NV_STATUS uvm_perf_prefetch_init(void) -@@ -501 +501 @@ --void uvm_perf_prefetch_exit() -+void uvm_perf_prefetch_exit(void) ---- a/kernel/nvidia-uvm/uvm_perf_thrashing.c -+++ b/kernel/nvidia-uvm/uvm_perf_thrashing.c -@@ -1955 +1955 @@ --NV_STATUS uvm_perf_thrashing_init() -+NV_STATUS uvm_perf_thrashing_init(void) -@@ -2014 +2014 @@ --void uvm_perf_thrashing_exit() -+void uvm_perf_thrashing_exit(void) ---- a/kernel/nvidia-uvm/uvm_procfs.c -+++ b/kernel/nvidia-uvm/uvm_procfs.c -@@ -49 +49 @@ --NV_STATUS uvm_procfs_init() -+NV_STATUS uvm_procfs_init(void) -@@ -69 +69 @@ --void uvm_procfs_exit() -+void uvm_procfs_exit(void) -@@ -98 +98 @@ --struct proc_dir_entry *uvm_procfs_get_gpu_base_dir() -+struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void) -@@ -103 +103 @@ --struct proc_dir_entry *uvm_procfs_get_cpu_base_dir() -+struct proc_dir_entry *uvm_procfs_get_cpu_base_dir(void) ---- a/kernel/nvidia-uvm/uvm_push.c -+++ b/kernel/nvidia-uvm/uvm_push.c -@@ -245 +245 @@ --bool uvm_push_info_is_tracking_descriptions() -+bool uvm_push_info_is_tracking_descriptions(void) -@@ -250 +250 @@ --bool uvm_push_info_is_tracking_acquires() -+bool uvm_push_info_is_tracking_acquires(void) ---- a/kernel/nvidia-uvm/uvm_thread_context.c -+++ b/kernel/nvidia-uvm/uvm_thread_context.c -@@ -104 +104 @@ --bool uvm_thread_context_wrapper_is_used() -+bool uvm_thread_context_wrapper_is_used(void) ---- a/kernel/nvidia-uvm/uvm_tools.c -+++ b/kernel/nvidia-uvm/uvm_tools.c -@@ -2144 +2144 @@ --void uvm_tools_flush_events() -+void uvm_tools_flush_events(void) diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf deleted file mode 100644 index f459c69dad8..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf +++ /dev/null @@ -1,7 +0,0 @@ -Section "OutputClass" - Identifier "nvidia" - MatchDriver "nvidia-drm" - Driver "nvidia" - Option "AllowEmptyInitialConfiguration" - ModulePath "@LIBDIR@/extensions/nvidia" -EndSection diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch deleted file mode 100644 index 499e969bf23..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch +++ /dev/null @@ -1,16 +0,0 @@ -Fix compilation with -fno-common or gcc10 -https://bugs.gentoo.org/706742 ---- a/nvidia-settings/src/gtk+-2.x/ctkvdpau.c -+++ b/nvidia-settings/src/gtk+-2.x/ctkvdpau.c -@@ -105,2 +105,4 @@ - -+struct VDPAUDeviceImpl VDPAUDeviceFunctions; -+ - static int queryOutputSurface(CtkVDPAU *ctk_vdpau, VdpDevice device, ---- a/nvidia-settings/src/gtk+-2.x/ctkvdpau.h -+++ b/nvidia-settings/src/gtk+-2.x/ctkvdpau.h -@@ -48,3 +48,3 @@ - --struct VDPAUDeviceImpl { -+extern struct VDPAUDeviceImpl { - diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch deleted file mode 100644 index a00545ad604..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch +++ /dev/null @@ -1,12 +0,0 @@ -For icon: https://github.com/NVIDIA/nvidia-settings/pull/56 ---- a/nvidia-settings/doc/nvidia-settings.desktop -+++ b/nvidia-settings/doc/nvidia-settings.desktop -@@ -5,5 +5,5 @@ - Comment=Configure NVIDIA X Server Settings --Exec=__UTILS_PATH__/nvidia-settings --Icon=__PIXMAP_PATH__/nvidia-settings.png --Categories=__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__ -+Exec=nvidia-settings -+Icon=nvidia-settings -+Categories=System;HardwareSettings; - diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch deleted file mode 100644 index d1689ee2728..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/nvidia-settings/src/Makefile -+++ b/nvidia-settings/src/Makefile -@@ -132,3 +132,2 @@ - GTK2LIB_DIR = $(OUTPUTDIR)/gtk2 --GTK2LIB = $(OUTPUTDIR)/$(GTK2LIB_NAME) - GTK2LIB_SONAME = $(GTK2LIB_NAME).$(NVIDIA_SETTINGS_VERSION) -@@ -276,4 +275,2 @@ - $(MKDIR) $(LIBDIR) -- $(INSTALL) $(INSTALL_LIB_ARGS) $(GTK2LIB) \ -- $(LIBDIR)/$(GTK2LIB_SONAME) - ifdef BUILD_GTK3LIB diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild deleted file mode 100644 index a848076b8f7..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild +++ /dev/null @@ -1,453 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info - -MODULES_KERNEL_MAX=6.1 -NV_URI="https://download.nvidia.com/XFree86/" - -DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://www.nvidia.com/" -SRC_URI=" - amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) - x86? ( ${NV_URI}Linux-x86/${PV}/NVIDIA-Linux-x86-${PV}.run ) - $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ - nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) -" -# nvidia-installer is unused but here for GPL-2's "distribute sources" -S=${WORKDIR} - -LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT" -SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64 x86" -IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools" - -COMMON_DEPEND=" - acct-group/video - persistenced? ( - acct-user/nvpd - net-libs/libtirpc:= - ) - tools? ( - >=app-accessibility/at-spi2-core-2.46:2 - dev-libs/glib:2 - dev-libs/jansson:= - media-libs/harfbuzz:= - x11-libs/cairo - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXxf86vm - x11-libs/pango - ) -" -RDEPEND=" - ${COMMON_DEPEND} - sys-libs/glibc - X? ( - media-libs/libglvnd[X,abi_x86_32(-)?] - x11-libs/libX11[abi_x86_32(-)?] - x11-libs/libXext[abi_x86_32(-)?] - ) -" -DEPEND=" - ${COMMON_DEPEND} - static-libs? ( - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext - ) - tools? ( - media-libs/libglvnd - sys-apps/dbus - x11-base/xorg-proto - x11-libs/libXrandr - x11-libs/libXv - x11-libs/libvdpau - ) -" -BDEPEND=" - sys-devel/m4 - virtual/pkgconfig -" - -# there is some non-prebuilt exceptions but rather not maintain a list -QA_PREBUILT="usr/bin/* usr/lib*" - -PATCHES=( - # note: no plans to add patches for newer kernels here, when the last - # working 6.1.x LTS is EOL then 390 will simply be removed from the tree - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-390.141-fno-common.patch - "${FILESDIR}"/nvidia-settings-390.144-desktop.patch - "${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch - "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~SYSVIPC - ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT - ~!LOCKDEP - ~!X86_KERNEL_IBT - !DEBUG_MUTEXES - " - - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and optional nvidia-drm.modeset=1. - With 390.xx drivers, also used by a GLX workaround needed for OpenGL. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or - DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." - - local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, - this will likely lead to modules load failure with ENDBR errors. - Please ignore if not having issues, but otherwise try to unset or - pass ibt=off to the kernel's command line." #911142 - - kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 - - linux-mod-r1_pkg_setup -} - -src_prepare() { - # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die - rm nvidia-settings && mv nvidia-settings{-${PV},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die - - eapply "${FILESDIR}"/nvidia-drivers-390.154-clang15$(usev {,-}x86).patch - - default - - # prevent detection of incomplete kernel DRM support (bug #603818) - sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ - -i kernel/conftest.sh || die - - sed 's/__USER__/nvpd/' \ - nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ - > "${T}"/nvidia-persistenced.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - sed "s/__NV_VK_ICD__/lib$(usex X GLX EGL)_nvidia.so.0/" \ - nvidia_icd.json.template > nvidia_icd.json || die - - # 390 has legacy glx needing a modified .conf (bug #713546) - # directory is not quite right, but kept for any existing custom xorg.conf - sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|" \ - "${FILESDIR}"/nvidia-drm-outputclass-390.conf > nvidia-drm-outputclass.conf || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - - use static-libs && lto-guarantee-fat - - # dead branch that will never be fixed and due for eventual removal, - # so keeping lazy "fixes" (bug #921370) - local kcflags=( - -std=gnu17 - -Wno-error=implicit-function-declaration - -Wno-error=incompatible-pointer-types - ) - # not *FLAGS to ensure it's used everywhere including conftest.sh - CC+=" $(test-flags-CC "${kcflags[@]}")" - use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - ) - - local modlist=( nvidia{,-drm,-modeset}=video:kernel ) - use x86 || modlist+=( nvidia-uvm=video:kernel ) - local modargs=( - CC="${KERNEL_CC}" # for the above kcflags workarounds - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - ) - - # temporary workaround for bug #914468 - use modules && addpredict "${KV_OUT_DIR}" - - linux-mod-r1_src_compile - - if use persistenced; then - # 390.xx persistenced does not auto-detect libtirpc - LIBS=$(${PKG_CONFIG} --libs libtirpc || die) \ - common_cflags=$(${PKG_CONFIG} --cflags libtirpc || die) \ - emake "${NV_ARGS[@]}" -C nvidia-persistenced - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig - - if use tools; then - # avoid noisy *very* noisy logs with deprecation warnings - CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - emake "${NV_ARGS[@]}" -C nvidia-settings - elif use static-libs; then - emake "${NV_ARGS[@]}" -C nvidia-settings/src build-xnvctrl - fi -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [VULKAN_ICD_JSON]=/usr/share/vulkan/icd.d - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/extensions/nvidia - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - [XMODULE_SYMLINK]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglx libnvidia-ifr") - libGLX_indirect # non-glvnd unused fallback - libnvidia-gtk nvidia-{settings,xconfig} # built from source - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP # handled separately - XMODULE_NEWSYM # use xorg's libwfb.so, nvidia also keeps it if it exists - .\*_SRC DKMS_CONF LIBGL_LA OPENGL_HEADER # unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog - nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ -$(usev modules " - -Like all out-of-tree kernel modules, it is necessary to rebuild -${PN} after upgrading or rebuilding the Linux kernel -by for example running \`emerge @module-rebuild\`. Alternatively, -if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), -this can be automated by setting USE=dist-kernel globally. - -Loaded kernel modules also must not mismatch with the installed -${PN} version (excluding -r revision), meaning should -ensure \`eselect kernel list\` points to the kernel that will be -booted before building and preferably reboot after upgrading -${PN} (the ebuild will emit a warning if mismatching). - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ -$(use amd64 && usev !abi_x86_32 " - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.")\ -$(usev X " - -390.xx libglvnd support is partial and requires different Xorg modules -for working OpenGL/GLX. If using the default Xorg configuration these -should be used automatically, otherwise manually add the ModulePath -from: '${EPREFIX}/${paths[XORG_OUTPUTCLASS_CONFIG]#/}/nvidia-drm-outputclass.conf'")\ -$(usev x86 " - -Note that NVIDIA is no longer offering support for the unified memory -module (nvidia-uvm) on x86 (32bit), as such the module is missing. -This means OpenCL/CUDA (and related, like nvenc) cannot be used. -Other functions, like OpenGL, will continue to work.") - -Support from NVIDIA for 390.xx will end in December 2022, how long -Gentoo will be able to reasonably support it beyond that is unknown. -If wish to continue using this hardware, should consider switching -to the Nouveau open source driver. -https://nvidia.custhelp.com/app/answers/detail/a_id/3142/ - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - if use modules; then - linux-mod-r1_src_install - - insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-390.conf nvidia.conf - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - if use tools; then - emake "${NV_ARGS[@]}" -C nvidia-settings install - - doicon nvidia-settings/doc/nvidia-settings.png - domenu nvidia-settings/doc/nvidia-settings.desktop - - exeinto /etc/X11/xinit/xinitrc.d - newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings - fi - - if use static-libs; then - dolib.a nvidia-settings/src/libXNVCtrl/libXNVCtrl.a - strip-lto-bytecode - - insinto /usr/include/NVCtrl - doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz} - pipestatus || die - continue - ;; - GLX_MODULE_SYMLINK|XMODULE_NEWSYM) - # messy symlinks for non-glvnd xorg modules overrides put - # in a different directory to avoid collisions (390-only) - m[4]=../../xorg/modules/${m[3]#/}${m[4]} - m[3]=/ - ;; - TLS_LIB) [[ ${m[4]} == CLASSIC ]] && continue;; # segfaults (bug #785289) - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - VULKAN_ICD_JSON) m[0]=${m[0]%.template};; - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$|_NEWSYM$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - dolib.so libnvidia-cfg.so.${PV} - dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so.1 - dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so - - dobin nvidia-bug-report.sh - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # sandbox issues with /dev/nvidiactl are widespread and sometime - # affect revdeps of packages built with USE=opencl/cuda making it - # hard to manage in ebuilds (minimal set, ebuilds should handle - # manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi -} - -pkg_preinst() { - use modules || return - - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die -} - -pkg_postinst() { - linux-mod-r1_pkg_postinst - - readme.gentoo_print_elog - - if [[ -r /proc/driver/nvidia/version && - $( "${T}"/nvidia-persistenced.service || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - - # dead branch that will never be fixed and due for eventual removal, - # so keeping lazy "fixes" (bug #921370) - local kcflags=( - -std=gnu17 - -Wno-error=implicit-function-declaration - -Wno-error=incompatible-pointer-types - ) - # not *FLAGS to ensure it's used everywhere including conftest.sh - CC+=" $(test-flags-CC "${kcflags[@]}")" - use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")" - - # extra flags for the libXNVCtrl.a static library - local xnvflags=-fPIC #840389 - tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - XNVCTRL_CFLAGS="${xnvflags}" - ) - - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=video:kernel ) - local modargs=( - CC="${KERNEL_CC}" # for the above kcflags workarounds - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - ) - - # temporary workaround for bug #914468 - use modules && addpredict "${KV_OUT_DIR}" - - linux-mod-r1_src_compile - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig - - if use tools; then - # avoid noisy *very* noisy logs with deprecation warnings - CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - emake "${NV_ARGS[@]}" -C nvidia-settings - elif use static-libs; then - emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a - fi -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [FIRMWARE]=/lib/firmware/nvidia/${PV} - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [VULKAN_ICD_JSON]=/usr/share/vulkan - [WINE_LIB]=/usr/${libdir}/nvidia/wine - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglxserver_nvidia libnvidia-ifr") - libGLX_indirect # non-glvnd unused fallback - libnvidia-gtk nvidia-{settings,xconfig} # built from source - # skip wayland-related files, largely broken with 470 at this point - libnvidia-egl-wayland 10_nvidia_wayland libnvidia-vulkan-producer - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - $(usev !modules gsp) - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF # handled separately / unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json - nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ -$(usev modules " - -Like all out-of-tree kernel modules, it is necessary to rebuild -${PN} after upgrading or rebuilding the Linux kernel -by for example running \`emerge @module-rebuild\`. Alternatively, -if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), -this can be automated by setting USE=dist-kernel globally. - -Loaded kernel modules also must not mismatch with the installed -${PN} version (excluding -r revision), meaning should -ensure \`eselect kernel list\` points to the kernel that will be -booted before building and preferably reboot after upgrading -${PN} (the ebuild will emit a warning if mismatching). - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ -$(use amd64 && usev !abi_x86_32 " - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.") - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - if use modules; then - linux-mod-r1_src_install - - insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-470.conf nvidia.conf - - # used for gpu verification with binpkgs (not kept, see pkg_preinst) - insinto /usr/share/nvidia - doins supported-gpus/supported-gpus.json - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - if use tools; then - emake "${NV_ARGS[@]}" -C nvidia-settings install - - doicon nvidia-settings/doc/nvidia-settings.png - domenu nvidia-settings/doc/nvidia-settings.desktop - - exeinto /etc/X11/xinit/xinitrc.d - newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings - fi - - if use static-libs; then - dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode - - insinto /usr/include/NVCtrl - doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz} - pipestatus || die - continue - ;; - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && - dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - : "$(systemd_get_sleepdir)" - exeinto "${_#"${EPREFIX}"}" - doexe systemd/system-sleep/nvidia - dobin systemd/nvidia-sleep.sh - systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service - - dobin nvidia-bug-report.sh - - # enabling is needed for sleep to work properly and little reason not to do - # it unconditionally for a better user experience - : "$(systemd_get_systemunitdir)" - local unitdir=${_#"${EPREFIX}"} - # not using relative symlinks to match systemd's own links - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service - # also add a custom elogind hook to do the equivalent of the above - exeinto /usr/lib/elogind/system-sleep - newexe "${FILESDIR}"/system-sleep.elogind nvidia - # =systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 - insinto "${unitdir}"/systemd-homed.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false - EOF - insinto "${unitdir}"/systemd-suspend.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false - EOF - dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # don't attempt to strip firmware files (silences errors) - dostrip -x ${paths[FIRMWARE]} - - # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292) - # are widespread and sometime affect revdeps of packages built with - # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, - # ebuilds should handle manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi -} - -pkg_preinst() { - use modules || return - - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die - - # try to find driver mismatches using temporary supported-gpus.json - for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do - g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ - "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) - if [[ ${g} ]]; then - g=$((${g##*\"}+1)) - if ver_test -ge ${g}; then - NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" - break - fi - fi - done - rm "${ED}"/usr/share/nvidia/supported-gpus.json || die -} - -pkg_postinst() { - linux-mod-r1_pkg_postinst - - readme.gentoo_print_elog - - if [[ -r /proc/driver/nvidia/version && - $( ${EROOT}/etc/portage/package.mask/${PN}" - else - ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" - fi - ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" - ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "[1] https://www.nvidia.com/object/IO_32667.html" - ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" - fi - - ewarn - ewarn "Be warned/reminded that the 470.xx branch reached end-of-life and" - ewarn "NVIDIA is no longer fixing issues (including security). Free to keep" - ewarn "using (for now) but it is recommended to either switch to nouveau or" - ewarn "replace hardware. Will be kept in-tree while possible, but expect it" - ewarn "to be removed likely in late 2027 or earlier if major issues arise." - ewarn - ewarn "Note that there is no plans to patch in support for kernels branches" - ewarn "newer than 6.6.x which will be supported upstream until December 2026." -} diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.105.08.ebuild b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.105.08.ebuild deleted file mode 100644 index 30b8a0f5538..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.105.08.ebuild +++ /dev/null @@ -1,591 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info - -MODULES_KERNEL_MAX=6.17 -NV_URI="https://download.nvidia.com/XFree86/" - -DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://www.nvidia.com/" -SRC_URI=" - amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) - $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ - nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) - ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz -" -# TODO: arm64 tarball is currently missing, restore + keyword when back -# arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) -# nvidia-installer is unused but here for GPL-2's "distribute sources" -S=${WORKDIR} - -LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB - curl openssl public-domain -" -SLOT="0/${PV%%.*}" -KEYWORDS="-* ~amd64" # ~arm64 (see SRC_URI's TODO) -IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" -REQUIRED_USE="kernel-open? ( modules )" - -COMMON_DEPEND=" - acct-group/video - X? ( x11-libs/libpciaccess ) - persistenced? ( - acct-user/nvpd - net-libs/libtirpc:= - ) - tools? ( - >=app-accessibility/at-spi2-core-2.46:2 - dev-libs/glib:2 - dev-libs/jansson:= - media-libs/harfbuzz:= - x11-libs/cairo - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXxf86vm - x11-libs/pango - ) -" -RDEPEND=" - ${COMMON_DEPEND} - dev-libs/openssl:0/3 - sys-libs/glibc - X? ( - media-libs/libglvnd[X,abi_x86_32(-)?] - x11-libs/libX11[abi_x86_32(-)?] - x11-libs/libXext[abi_x86_32(-)?] - ) - powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) - wayland? ( - >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] - || ( - >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] - gui-libs/egl-wayland2[abi_x86_32(-)?] - ) - X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) - ) -" -DEPEND=" - ${COMMON_DEPEND} - static-libs? ( - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext - ) - tools? ( - dev-util/vulkan-headers - media-libs/libglvnd - sys-apps/dbus - x11-base/xorg-proto - x11-libs/libXrandr - x11-libs/libXv - x11-libs/libvdpau - ) -" -BDEPEND=" - app-alternatives/awk - sys-devel/m4 - virtual/pkgconfig -" - -# there is some non-prebuilt exceptions but rather not maintain a list -QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*" - -PATCHES=( - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK - get_version - require_configured_kernel - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~DRM_FBDEV_EMULATION - ~SYSVIPC - ~!LOCKDEP - ~!PREEMPT_RT - ~!SLUB_DEBUG_ON - !DEBUG_MUTEXES - $(usev powerd '~CPU_FREQ') - " - - kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && - CONFIG_CHECK+=" DRM_TTM_HELPER" - - use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 - - use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 - - local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or - DRM_AMDGPU=m (among others, consult the kernel config's help), can - also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. - ${drm_helper_msg}" - local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using - kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. - ${drm_helper_msg}" - local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support, currently off-by-default and it could - be ignored, but note that is due to change in the future." - local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of another option that requires it such as CONFIG_KVM." - local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and - will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is - set. Please do not report issues if run into e.g. kernel panics while - ignoring this." - - linux-mod-r1_pkg_setup -} - -src_prepare() { - # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die - rm nvidia-settings && mv nvidia-settings{-${PV},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die - mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die - - default - - # prevent detection of incomplete kernel DRM support (bug #603818) - sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ - -i kernel{,-module-source/kernel-open}/conftest.sh || die - - sed 's/__USER__/nvpd/' \ - nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ - > "${T}"/nvidia-persistenced.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die - - # enable nvidia-drm.modeset=1 by default with USE=wayland - cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die - use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die - - # makefile attempts to install wayland library even if not built - use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ - nvidia-settings/src/Makefile || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - - # extra flags for the libXNVCtrl.a static library - local xnvflags=-fPIC #840389 - tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - BUILD_GTK2LIB= - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - WAYLAND_AVAILABLE=$(usex wayland 1 0) - XNVCTRL_CFLAGS="${xnvflags}" - ) - - if use modules; then - local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - - local modlistargs=video:kernel - if use kernel-open; then - modlistargs+=-module-source:kernel-module-source/kernel-open - - # environment flags are normally unused for modules, but nvidia - # uses it for building the "blob" and it is a bit fragile - filter-flags -fno-plt #912949 - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - - LDFLAGS=$(raw-ldflags) - fi - - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) - local modargs=( - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - - # kernel takes "x86" and "x86_64" as meaning the same, but nvidia - # makes the distinction (since 550.135) and is not happy with "x86" - # TODO?: it should be ok/better for tc-arch-kernel to do x86_64 - $(usev amd64 ARCH=x86_64) - ) - - # temporary workaround for bug #914468 - addpredict "${KV_OUT_DIR}" - - linux-mod-r1_src_compile - CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig - - if use tools; then - # avoid noisy *very* noisy logs with deprecation warnings - CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - emake "${NV_ARGS[@]}" -C nvidia-settings - elif use static-libs; then - # pretend GTK+3 is available, not actually used (bug #880879) - emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ - -C nvidia-settings/src out/libXNVCtrl.a - fi -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [FIRMWARE]=/lib/firmware/nvidia/${PV} - [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [OPENGL_DATA]=/usr/share/nvidia - [VULKANSC_ICD_JSON]=/usr/share/vulkansc - [VULKAN_ICD_JSON]=/usr/share/vulkan - [WINE_LIB]=/usr/${libdir}/nvidia/wine - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglxserver_nvidia") - libGLX_indirect # non-glvnd unused fallback - libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source - libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 - libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 - libnvidia-pkcs11.so # using the openssl3 version instead - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - $(usev !modules gsp) - $(usev !powerd nvtopps) - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json - nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ -$(usev modules " - -Like all out-of-tree kernel modules, it is necessary to rebuild -${PN} after upgrading or rebuilding the Linux kernel -by for example running \`emerge @module-rebuild\`. Alternatively, -if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), -this can be automated by setting USE=dist-kernel globally. - -Loaded kernel modules also must not mismatch with the installed -${PN} version (excluding -r revision), meaning should -ensure \`eselect kernel list\` points to the kernel that will be -booted before building and preferably reboot after upgrading -${PN} (the ebuild will emit a warning if mismatching). - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ -$(use amd64 && usev !abi_x86_32 " - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.") - -Be warned that USE=kernel-open may need to be either enabled or -disabled for certain cards to function: -- GTX 50xx (blackwell) and higher require it to be enabled -- GTX 1650 and higher (pre-blackwell) should work either way -- Older cards require it to be disabled - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - if use modules; then - linux-mod-r1_src_install - - insinto /etc/modprobe.d - doins "${T}"/nvidia.conf - - # used for gpu verification with binpkgs (not kept, see pkg_preinst) - insinto /usr/share/nvidia - doins supported-gpus/supported-gpus.json - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - if use tools; then - emake "${NV_ARGS[@]}" -C nvidia-settings install - - doicon nvidia-settings/doc/nvidia-settings.png - domenu nvidia-settings/doc/nvidia-settings.desktop - - exeinto /etc/X11/xinit/xinitrc.d - newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings - fi - - if use static-libs; then - dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode - - insinto /usr/include/NVCtrl - doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz} - pipestatus || die - continue - ;; - GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == EXPLICIT_PATH ]]; then - into=${m[3]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - # avoid portage warning due to missing soname links in manifest - [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && - dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - : "$(systemd_get_sleepdir)" - exeinto "${_#"${EPREFIX}"}" - doexe systemd/system-sleep/nvidia - dobin systemd/nvidia-sleep.sh - systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service - - dobin nvidia-bug-report.sh - - insinto /usr/share/nvidia/files.d - doins sandboxutils-filelist.json - - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - - # enabling is needed for sleep to work properly and little reason not to do - # it unconditionally for a better user experience - : "$(systemd_get_systemunitdir)" - local unitdir=${_#"${EPREFIX}"} - # not using relative symlinks to match systemd's own links - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service - # also add a custom elogind hook to do the equivalent of the above - exeinto /usr/lib/elogind/system-sleep - newexe "${FILESDIR}"/system-sleep.elogind nvidia - # =systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 - insinto "${unitdir}"/systemd-homed.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false - EOF - insinto "${unitdir}"/systemd-suspend.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false - EOF - dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # don't attempt to strip firmware files (silences errors) - dostrip -x ${paths[FIRMWARE]} - - # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578) - # are widespread and sometime affect revdeps of packages built with - # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, - # ebuilds should handle manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi -} - -pkg_preinst() { - has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= - has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= - - use modules || return - - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die - - # try to find driver mismatches using temporary supported-gpus.json - for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do - g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ - "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) - if [[ ${g} ]]; then - g=$((${g##*\"}+1)) - if ver_test -ge ${g}; then - NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" - break - fi - fi - done - rm "${ED}"/usr/share/nvidia/supported-gpus.json || die -} - -pkg_postinst() { - linux-mod-r1_pkg_postinst - - readme.gentoo_print_elog - - if [[ -r /proc/driver/nvidia/version && - $( ${EROOT}/etc/portage/package.mask/${PN}" - else - ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" - fi - ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" - ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "[1] https://www.nvidia.com/object/IO_32667.html" - ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" - fi - - if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then - ewarn - ewarn "Open source variant of ${PN} was selected, note that it requires" - ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." - ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" - fi - - if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then - elog - elog "Note that with USE=wayland, nvidia-drm.modeset=1 will be enabled" - elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. *If* experience issues," - elog "either disable wayland or edit nvidia.conf." - fi -} diff --git a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.94.06.ebuild b/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.94.06.ebuild deleted file mode 100644 index bf95c1603eb..00000000000 --- a/sdk_container/src/third_party/portage-stable/x11-drivers/nvidia-drivers/nvidia-drivers-580.94.06.ebuild +++ /dev/null @@ -1,591 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info - -MODULES_KERNEL_MAX=6.17 -NV_PIN=580.95.05 - -DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://developer.nvidia.com/vulkan-driver/" -SRC_URI=" - https://developer.nvidia.com/downloads/vulkan-beta-${PV//.}-linux - -> NVIDIA-Linux-x86_64-${PV}.run - $(printf "https://download.nvidia.com/XFree86/%s/%s-${NV_PIN}.tar.bz2 " \ - nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) - https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${PV}.tar.gz - -> open-gpu-kernel-modules-${PV}.tar.gz -" -# nvidia-installer is unused but here for GPL-2's "distribute sources" -S=${WORKDIR} - -LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB - curl openssl public-domain -" -SLOT="0/vulkan" -KEYWORDS="-* ~amd64" -IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" -REQUIRED_USE="kernel-open? ( modules )" - -COMMON_DEPEND=" - acct-group/video - X? ( x11-libs/libpciaccess ) - persistenced? ( - acct-user/nvpd - net-libs/libtirpc:= - ) - tools? ( - >=app-accessibility/at-spi2-core-2.46:2 - dev-libs/glib:2 - dev-libs/jansson:= - media-libs/harfbuzz:= - x11-libs/cairo - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXxf86vm - x11-libs/pango - ) -" -RDEPEND=" - ${COMMON_DEPEND} - dev-libs/openssl:0/3 - sys-libs/glibc - X? ( - media-libs/libglvnd[X,abi_x86_32(-)?] - x11-libs/libX11[abi_x86_32(-)?] - x11-libs/libXext[abi_x86_32(-)?] - ) - powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) - wayland? ( - >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] - || ( - >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] - gui-libs/egl-wayland2[abi_x86_32(-)?] - ) - X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) - ) -" -DEPEND=" - ${COMMON_DEPEND} - static-libs? ( - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext - ) - tools? ( - dev-util/vulkan-headers - media-libs/libglvnd - sys-apps/dbus - x11-base/xorg-proto - x11-libs/libXrandr - x11-libs/libXv - x11-libs/libvdpau - ) -" -BDEPEND=" - app-alternatives/awk - sys-devel/m4 - virtual/pkgconfig -" - -# there is some non-prebuilt exceptions but rather not maintain a list -QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*" - -PATCHES=( - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK - get_version - require_configured_kernel - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~DRM_FBDEV_EMULATION - ~SYSVIPC - ~!LOCKDEP - ~!PREEMPT_RT - ~!SLUB_DEBUG_ON - !DEBUG_MUTEXES - $(usev powerd '~CPU_FREQ') - " - - kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && - CONFIG_CHECK+=" DRM_TTM_HELPER" - - use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 - - use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 - - local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or - DRM_AMDGPU=m (among others, consult the kernel config's help), can - also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. - ${drm_helper_msg}" - local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using - kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. - ${drm_helper_msg}" - local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support, currently off-by-default and it could - be ignored, but note that is due to change in the future." - local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of another option that requires it such as CONFIG_KVM." - local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and - will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is - set. Please do not report issues if run into e.g. kernel panics while - ignoring this." - - linux-mod-r1_pkg_setup -} - -src_prepare() { - # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${NV_PIN},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${NV_PIN},} || die - rm nvidia-settings && mv nvidia-settings{-${NV_PIN},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die - mv open-gpu-kernel-modules-${PV} kernel-module-source || die - - default - - # prevent detection of incomplete kernel DRM support (bug #603818) - sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ - -i kernel{,-module-source/kernel-open}/conftest.sh || die - - sed 's/__USER__/nvpd/' \ - nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ - > "${T}"/nvidia-persistenced.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die - - # enable nvidia-drm.modeset=1 by default with USE=wayland - cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die - use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die - - # makefile attempts to install wayland library even if not built - use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ - nvidia-settings/src/Makefile || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - - # extra flags for the libXNVCtrl.a static library - local xnvflags=-fPIC #840389 - tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - BUILD_GTK2LIB= - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - WAYLAND_AVAILABLE=$(usex wayland 1 0) - XNVCTRL_CFLAGS="${xnvflags}" - ) - - if use modules; then - local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - - local modlistargs=video:kernel - if use kernel-open; then - modlistargs+=-module-source:kernel-module-source/kernel-open - - # environment flags are normally unused for modules, but nvidia - # uses it for building the "blob" and it is a bit fragile - filter-flags -fno-plt #912949 - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - - LDFLAGS=$(raw-ldflags) - fi - - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) - local modargs=( - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - - # kernel takes "x86" and "x86_64" as meaning the same, but nvidia - # makes the distinction (since 550.135) and is not happy with "x86" - # TODO?: it should be ok/better for tc-arch-kernel to do x86_64 - $(usev amd64 ARCH=x86_64) - ) - - # temporary workaround for bug #914468 - addpredict "${KV_OUT_DIR}" - - linux-mod-r1_src_compile - CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig - - if use tools; then - # avoid noisy *very* noisy logs with deprecation warnings - CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - emake "${NV_ARGS[@]}" -C nvidia-settings - elif use static-libs; then - # pretend GTK+3 is available, not actually used (bug #880879) - emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ - -C nvidia-settings/src out/libXNVCtrl.a - fi -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [FIRMWARE]=/lib/firmware/nvidia/${PV} - [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [OPENGL_DATA]=/usr/share/nvidia - [VULKANSC_ICD_JSON]=/usr/share/vulkansc - [VULKAN_ICD_JSON]=/usr/share/vulkan - [WINE_LIB]=/usr/${libdir}/nvidia/wine - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglxserver_nvidia") - libGLX_indirect # non-glvnd unused fallback - libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source - libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 - libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 - libnvidia-pkcs11.so # using the openssl3 version instead - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - $(usev !modules gsp) - $(usev !powerd nvtopps) - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json - nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ -$(usev modules " - -Like all out-of-tree kernel modules, it is necessary to rebuild -${PN} after upgrading or rebuilding the Linux kernel -by for example running \`emerge @module-rebuild\`. Alternatively, -if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), -this can be automated by setting USE=dist-kernel globally. - -Loaded kernel modules also must not mismatch with the installed -${PN} version (excluding -r revision), meaning should -ensure \`eselect kernel list\` points to the kernel that will be -booted before building and preferably reboot after upgrading -${PN} (the ebuild will emit a warning if mismatching). - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ -$(use amd64 && usev !abi_x86_32 " - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.") - -Be warned that USE=kernel-open may need to be either enabled or -disabled for certain cards to function: -- GTX 50xx (blackwell) and higher require it to be enabled -- GTX 1650 and higher (pre-blackwell) should work either way -- Older cards require it to be disabled - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - if use modules; then - linux-mod-r1_src_install - - insinto /etc/modprobe.d - doins "${T}"/nvidia.conf - - # used for gpu verification with binpkgs (not kept, see pkg_preinst) - insinto /usr/share/nvidia - doins supported-gpus/supported-gpus.json - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - if use tools; then - emake "${NV_ARGS[@]}" -C nvidia-settings install - - doicon nvidia-settings/doc/nvidia-settings.png - domenu nvidia-settings/doc/nvidia-settings.desktop - - exeinto /etc/X11/xinit/xinitrc.d - newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings - fi - - if use static-libs; then - dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode - - insinto /usr/include/NVCtrl - doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz} - pipestatus || die - continue - ;; - GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == EXPLICIT_PATH ]]; then - into=${m[3]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - # avoid portage warning due to missing soname links in manifest - [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && - dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - : "$(systemd_get_sleepdir)" - exeinto "${_#"${EPREFIX}"}" - doexe systemd/system-sleep/nvidia - dobin systemd/nvidia-sleep.sh - systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service - - dobin nvidia-bug-report.sh - - insinto /usr/share/nvidia/files.d - doins sandboxutils-filelist.json - - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - - # enabling is needed for sleep to work properly and little reason not to do - # it unconditionally for a better user experience - : "$(systemd_get_systemunitdir)" - local unitdir=${_#"${EPREFIX}"} - # not using relative symlinks to match systemd's own links - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service - # also add a custom elogind hook to do the equivalent of the above - exeinto /usr/lib/elogind/system-sleep - newexe "${FILESDIR}"/system-sleep.elogind nvidia - # =systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 - insinto "${unitdir}"/systemd-homed.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false - EOF - insinto "${unitdir}"/systemd-suspend.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false - EOF - dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # don't attempt to strip firmware files (silences errors) - dostrip -x ${paths[FIRMWARE]} - - # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578) - # are widespread and sometime affect revdeps of packages built with - # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, - # ebuilds should handle manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi -} - -pkg_preinst() { - has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= - has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= - - use modules || return - - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die - - # try to find driver mismatches using temporary supported-gpus.json - for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do - g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ - "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) - if [[ ${g} ]]; then - g=$((${g##*\"}+1)) - if ver_test -ge ${g}; then - NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" - break - fi - fi - done - rm "${ED}"/usr/share/nvidia/supported-gpus.json || die -} - -pkg_postinst() { - linux-mod-r1_pkg_postinst - - readme.gentoo_print_elog - - if [[ -r /proc/driver/nvidia/version && - $( ${EROOT}/etc/portage/package.mask/${PN}" - else - ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" - fi - ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" - ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "[1] https://www.nvidia.com/object/IO_32667.html" - ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" - fi - - if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then - ewarn - ewarn "Open source variant of ${PN} was selected, note that it requires" - ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." - ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" - fi - - if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then - elog - elog "Note that with USE=wayland, nvidia-drm.modeset=1 will be enabled" - elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. *If* experience issues," - elog "either disable wayland or edit nvidia.conf." - fi -} From fa087c4d0b65e8380522147198548b1401e193b5 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 10 Aug 2026 10:26:20 +0200 Subject: [PATCH 2/2] overlay nvidia-drivers: fix builds for Kernel 6.12.97 Starting from Kernel 6.12.97, prototype of pci_resize_resource() has changed [1], so it started to take 4 args instead of 3. To deal with both cases of 3 and 4 args, define a new config check in conftest.sh to check if the Kernel header has which variant of pci_resize_resource(), and define a variable NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG if that has 4 args. Use that later from the caller in nvidia/nv-pci.c. [1] https://lore.kernel.org/all/20251113162628.5946-7-ilpo.jarvinen@linux.intel.com/ This is similar to the previous fix 56a996dfadd4a86be66b5d7074b7bcbfcc9bcc61, which fixed only old-nvidia-drivers 550. Signed-off-by: Dongsu Park --- .../nvidia-pci-resize-resource-fix-535.patch | 154 ++++++++++++++++++ ...ld => nvidia-drivers-535.274.02-r1.ebuild} | 1 + 2 files changed, 155 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-pci-resize-resource-fix-535.patch rename sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/{nvidia-drivers-535.274.02.ebuild => nvidia-drivers-535.274.02-r1.ebuild} (99%) diff --git a/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-pci-resize-resource-fix-535.patch b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-pci-resize-resource-fix-535.patch new file mode 100644 index 00000000000..beeb92ea96f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/nvidia-pci-resize-resource-fix-535.patch @@ -0,0 +1,154 @@ +Starting from Kernel 6.12.97, prototype of pci_resize_resource() has changed +so it started to take 4 args instead of 3. To deal with both cases of 3 and 4 +args, define a new config check in conftest.sh to check if the Kernel header +has which variant of pci_resize_resource(), and define a variable +NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG if that has 4 args. Use that later +from the caller in nvidia/nv-pci.c. +--- a/kernel-open/conftest.sh 2026-07-28 08:58:15.053510731 -0000 ++++ b/kernel-open/conftest.sh 2026-07-28 09:00:34.490711754 -0000 +@@ -6528,6 +6528,27 @@ + compile_check_conftest "$CODE" "NV_WAIT_FOR_RANDOM_BYTES_PRESENT" "" "functions" + ;; + ++ pci_resize_resource_has_exclude_bars_arg) ++ # ++ # Determine if pci_resize_resource() has exclude_bars argument. ++ # ++ # exclude_bars argument was added to pci_resize_resource by commit ++ # 337b1b566db0 (11/14/2025) ("PCI: Fix restoring BARs on BAR resize rollback path") ++ # in linux-next. ++ # ++ CODE=" ++ #include ++ ++ typeof(pci_resize_resource) conftest_pci_resize_resource_has_exclude_bars_arg; ++ int __must_check conftest_pci_resize_resource_has_exclude_bars_arg(struct pci_dev *dev, ++ int i, int size, ++ int exclude_bars) { ++ return 0; ++ }" ++ ++ compile_check_conftest "$CODE" "NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG" "" "types" ++ ;; ++ + drm_connector_has_override_edid) + # + # Determine if 'struct drm_connector' has an 'override_edid' member. +--- a/kernel-open/nvidia/nv-pci.c 2026-07-28 08:34:08.084158759 -0000 ++++ b/kernel-open/nvidia/nv-pci.c 2026-07-28 08:34:46.162723864 -0000 +@@ -234,7 +234,11 @@ + + resize: + /* Attempt to resize BAR1 to the largest supported size */ ++#if defined(NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG) ++ r = pci_resize_resource(pci_dev, NV_GPU_BAR1, requested_size, 0); ++#else + r = pci_resize_resource(pci_dev, NV_GPU_BAR1, requested_size); ++#endif + + if (r) { + if (r == -ENOSPC) +--- a/kernel-open/nvidia/nvidia.Kbuild 2026-07-28 13:18:21.556378527 -0000 ++++ b/kernel-open/nvidia/nvidia.Kbuild 2026-07-28 13:17:41.159211837 -0000 +@@ -259,6 +259,7 @@ + NV_CONFTEST_TYPE_COMPILE_TESTS += memory_failure_has_trapno_arg + NV_CONFTEST_TYPE_COMPILE_TESTS += foll_longterm_present + NV_CONFTEST_TYPE_COMPILE_TESTS += bus_type_has_iommu_ops ++NV_CONFTEST_TYPE_COMPILE_TESTS += pci_resize_resource_has_exclude_bars_arg + + NV_CONFTEST_GENERIC_COMPILE_TESTS += dom0_kernel_present + NV_CONFTEST_GENERIC_COMPILE_TESTS += nvidia_vgpu_kvm_build +--- a/kernel-module-source/kernel-open/conftest.sh 2026-07-28 08:58:15.053510731 -0000 ++++ b/kernel-module-source/kernel-open/conftest.sh 2026-07-28 09:00:34.490711754 -0000 +@@ -6528,6 +6528,27 @@ + compile_check_conftest "$CODE" "NV_WAIT_FOR_RANDOM_BYTES_PRESENT" "" "functions" + ;; + ++ pci_resize_resource_has_exclude_bars_arg) ++ # ++ # Determine if pci_resize_resource() has exclude_bars argument. ++ # ++ # exclude_bars argument was added to pci_resize_resource by commit ++ # 337b1b566db0 (11/14/2025) ("PCI: Fix restoring BARs on BAR resize rollback path") ++ # in linux-next. ++ # ++ CODE=" ++ #include ++ ++ typeof(pci_resize_resource) conftest_pci_resize_resource_has_exclude_bars_arg; ++ int __must_check conftest_pci_resize_resource_has_exclude_bars_arg(struct pci_dev *dev, ++ int i, int size, ++ int exclude_bars) { ++ return 0; ++ }" ++ ++ compile_check_conftest "$CODE" "NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG" "" "types" ++ ;; ++ + drm_connector_has_override_edid) + # + # Determine if 'struct drm_connector' has an 'override_edid' member. +--- a/kernel-module-source/kernel-open/nvidia/nv-pci.c 2026-07-28 08:34:08.084158759 -0000 ++++ b/kernel-module-source/kernel-open/nvidia/nv-pci.c 2026-07-28 08:34:46.162723864 -0000 +@@ -234,7 +234,11 @@ + + resize: + /* Attempt to resize BAR1 to the largest supported size */ ++#if defined(NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG) ++ r = pci_resize_resource(pci_dev, NV_GPU_BAR1, requested_size, 0); ++#else + r = pci_resize_resource(pci_dev, NV_GPU_BAR1, requested_size); ++#endif + + if (r) { + if (r == -ENOSPC) +--- a/kernel-module-source/kernel-open/nvidia/nvidia.Kbuild 2026-07-28 13:18:21.556378527 -0000 ++++ b/kernel-module-source/kernel-open/nvidia/nvidia.Kbuild 2026-07-28 13:17:41.159211837 -0000 +@@ -259,6 +259,7 @@ + NV_CONFTEST_TYPE_COMPILE_TESTS += memory_failure_has_trapno_arg + NV_CONFTEST_TYPE_COMPILE_TESTS += foll_longterm_present + NV_CONFTEST_TYPE_COMPILE_TESTS += bus_type_has_iommu_ops ++NV_CONFTEST_TYPE_COMPILE_TESTS += pci_resize_resource_has_exclude_bars_arg + + NV_CONFTEST_GENERIC_COMPILE_TESTS += dom0_kernel_present + NV_CONFTEST_GENERIC_COMPILE_TESTS += nvidia_vgpu_kvm_build +--- a/kernel/conftest.sh 2026-07-28 08:58:15.053510731 -0000 ++++ b/kernel/conftest.sh 2026-07-28 09:00:34.490711754 -0000 +@@ -6528,6 +6528,27 @@ + compile_check_conftest "$CODE" "NV_WAIT_FOR_RANDOM_BYTES_PRESENT" "" "functions" + ;; + ++ pci_resize_resource_has_exclude_bars_arg) ++ # ++ # Determine if pci_resize_resource() has exclude_bars argument. ++ # ++ # exclude_bars argument was added to pci_resize_resource by commit ++ # 337b1b566db0 (11/14/2025) ("PCI: Fix restoring BARs on BAR resize rollback path") ++ # in linux-next. ++ # ++ CODE=" ++ #include ++ ++ typeof(pci_resize_resource) conftest_pci_resize_resource_has_exclude_bars_arg; ++ int __must_check conftest_pci_resize_resource_has_exclude_bars_arg(struct pci_dev *dev, ++ int i, int size, ++ int exclude_bars) { ++ return 0; ++ }" ++ ++ compile_check_conftest "$CODE" "NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG" "" "types" ++ ;; ++ + drm_connector_has_override_edid) + # + # Determine if 'struct drm_connector' has an 'override_edid' member. +--- a/kernel/nvidia/nvidia.Kbuild 2026-07-28 13:18:21.556378527 -0000 ++++ b/kernel/nvidia/nvidia.Kbuild 2026-07-28 13:17:41.159211837 -0000 +@@ -259,6 +259,7 @@ + NV_CONFTEST_TYPE_COMPILE_TESTS += memory_failure_has_trapno_arg + NV_CONFTEST_TYPE_COMPILE_TESTS += foll_longterm_present + NV_CONFTEST_TYPE_COMPILE_TESTS += bus_type_has_iommu_ops ++NV_CONFTEST_TYPE_COMPILE_TESTS += pci_resize_resource_has_exclude_bars_arg + + NV_CONFTEST_GENERIC_COMPILE_TESTS += dom0_kernel_present + NV_CONFTEST_GENERIC_COMPILE_TESTS += nvidia_vgpu_kvm_build diff --git a/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02-r1.ebuild similarity index 99% rename from sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild rename to sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02-r1.ebuild index bd81c3f5074..712a0f522e5 100644 --- a/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/nvidia-drivers-535.274.02-r1.ebuild @@ -94,6 +94,7 @@ PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch + "${FILESDIR}"/nvidia-pci-resize-resource-fix-535.patch ) pkg_setup() {