From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A5AD7158003 for ; Sun, 2 Oct 2022 03:59:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D13A8E08A2; Sun, 2 Oct 2022 03:59:55 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A9BF8E08A2 for ; Sun, 2 Oct 2022 03:59:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A0734340DD5 for ; Sun, 2 Oct 2022 03:59:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 21DE21E for ; Sun, 2 Oct 2022 03:59:53 +0000 (UTC) From: "Ionen Wolkens" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" Message-ID: <1664683103.619d0545c04fd9b68c4ab27a1baaa63521c32e9d.ionen@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/ X-VCS-Repository: repo/gentoo X-VCS-Files: x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild x11-drivers/nvidia-drivers/nvidia-drivers-515.49.19.ebuild x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild X-VCS-Directories: x11-drivers/nvidia-drivers/ X-VCS-Committer: ionen X-VCS-Committer-Name: Ionen Wolkens X-VCS-Revision: 619d0545c04fd9b68c4ab27a1baaa63521c32e9d X-VCS-Branch: master Date: Sun, 2 Oct 2022 03:59:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d8e35288-32b5-4de0-98b4-57113504222c X-Archives-Hash: d6b15c012714f9abcc4add31908f7d28 commit: 619d0545c04fd9b68c4ab27a1baaa63521c32e9d Author: Ionen Wolkens gentoo org> AuthorDate: Sat Oct 1 16:18:05 2022 +0000 Commit: Ionen Wolkens gentoo org> CommitDate: Sun Oct 2 03:58:23 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=619d0545 x11-drivers/nvidia-drivers: warn about simpledrm again + FB/nouveau Thought SIMPLEDRM issues had improved. Last time I tried, X was still working just without tty console display so not "that" bad (that was with kernel 5.14.x or so). gentoo-kernel-bin uses Fedora's configs which enables SIMPLEDRM since 5.17.x or so. Formerly without FB_EFI then later re-enabled (was under the impression this improved things, but I only try -bin when stabilizing drivers, so 5.15.x), however SIMPLEDRM=y takes priority and X/wayland breaks entirely and then messes up the tty (worse than before). Difference between gentoo-kernel-bin and Fedora's is that they now patch their kernel to let this configuration work: https://src.fedoraproject.org/rpms/kernel/blob/e762b5dd/f/patch-5.19-redhat.patch#_882 (seems they do not do this for kernel-6.0, unsure for status with it) Have not found a (working) way to disable SIMPLEDRM from the kernel's commandline, so merely adding a warning for bug #840439 if it's builtin For FB_EFI or FB_VESA to work (aka get a console), also need to disable SYSFB_SIMPLEFB. FB_SIMPLE seems broken since kernel-5.18.13 due to another issue. Albeit this doesn't stop X from working. Ideal would be for gentoo-kernel* to do it by default, but non-bin gentoo-kernel users using the generic config can (tested with 5.19.12): mkdir -p /etc/kernel/config.d && cat < /etc/kernel/config.d/50nvidia.config # CONFIG_DRM_SIMPLEDRM is not set # CONFIG_SYSFB_SIMPLEFB is not set EOF (this is what gentoo-kernel-bin-5.15.x has) While here also add an overdue warning for builtin nouveau (formerly skipped given CONFIG_CHECK was unsuitable), and try to inform about making the tty console work even though nvidia-drivers doesn't drive it. Bug: https://bugs.gentoo.org/840439 Signed-off-by: Ionen Wolkens gentoo.org> .../nvidia-drivers/nvidia-drivers-390.154.ebuild | 63 +++++++++++++++++++++- .../nvidia-drivers-470.141.03.ebuild | 63 +++++++++++++++++++++- .../nvidia-drivers/nvidia-drivers-510.85.02.ebuild | 63 +++++++++++++++++++++- .../nvidia-drivers/nvidia-drivers-515.49.19.ebuild | 63 +++++++++++++++++++++- .../nvidia-drivers/nvidia-drivers-515.65.01.ebuild | 63 +++++++++++++++++++++- .../nvidia-drivers/nvidia-drivers-515.76.ebuild | 63 +++++++++++++++++++++- 6 files changed, 372 insertions(+), 6 deletions(-) diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild index e3155fa43d82..6fefc8a6b044 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild @@ -97,7 +97,7 @@ pkg_setup() { 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="X86_KERNEL_IBT: is set, be warned the modules may not load with it. + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load. If run into problems, either unset or pass ibt=off to the kernel." kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 @@ -112,6 +112,67 @@ pkg_setup() { [[ ${MERGE_TYPE} == binary ]] && return + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is needed" + " to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI" + " as it is currently known broken with >=kernel-5.18.13 + NVIDIA." + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' use x86 && BUILD_PARAMS+=' ARCH=i386' BUILD_TARGETS="modules" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild index f956843454c4..c4c457890298 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild @@ -99,7 +99,7 @@ pkg_setup() { 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="X86_KERNEL_IBT: is set, be warned the modules may not load with it. + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load. If run into problems, either unset or pass ibt=off to the kernel." use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 @@ -115,6 +115,67 @@ pkg_setup() { [[ ${MERGE_TYPE} == binary ]] && return + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is needed" + " to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI" + " as it is currently known broken with >=kernel-5.18.13 + NVIDIA." + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' BUILD_TARGETS="modules" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild index 72881337a6cd..6739680f1336 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild @@ -102,7 +102,7 @@ pkg_setup() { 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="X86_KERNEL_IBT: is set, be warned the modules may not load with it. + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load. If run into problems, either unset or pass ibt=off to the kernel." use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 @@ -118,6 +118,67 @@ pkg_setup() { [[ ${MERGE_TYPE} == binary ]] && return + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is needed" + " to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI" + " as it is currently known broken with >=kernel-5.18.13 + NVIDIA." + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' BUILD_TARGETS="modules" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.19.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.19.ebuild index 2158dbd987aa..6568dcc23e75 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.19.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.19.ebuild @@ -104,7 +104,7 @@ pkg_setup() { 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="X86_KERNEL_IBT: is set, be warned the modules may not load with it. + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load. If run into problems, either unset or pass ibt=off to the kernel." use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 @@ -127,6 +127,67 @@ pkg_setup() { [[ ${MERGE_TYPE} == binary ]] && return + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is needed" + " to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI" + " as it is currently known broken with >=kernel-5.18.13 + NVIDIA." + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' BUILD_TARGETS="modules" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild index e1f5cfc6ceff..9edb6fe04224 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild @@ -104,7 +104,7 @@ pkg_setup() { 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="X86_KERNEL_IBT: is set, be warned the modules may not load with it. + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load. If run into problems, either unset or pass ibt=off to the kernel." use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 @@ -127,6 +127,67 @@ pkg_setup() { [[ ${MERGE_TYPE} == binary ]] && return + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is needed" + " to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI" + " as it is currently known broken with >=kernel-5.18.13 + NVIDIA." + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' BUILD_TARGETS="modules" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild index b7fba7fefd0f..f5d9379122e2 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild @@ -104,7 +104,7 @@ pkg_setup() { 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="X86_KERNEL_IBT: is set, be warned the modules may not load with it. + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load. If run into problems, either unset or pass ibt=off to the kernel." use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 @@ -127,6 +127,67 @@ pkg_setup() { [[ ${MERGE_TYPE} == binary ]] && return + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is needed" + " to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI" + " as it is currently known broken with >=kernel-5.18.13 + NVIDIA." + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' BUILD_TARGETS="modules"