From b2c2e1c15bdfbe8989c058bdafc933aa59422d84 Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Tue, 25 Jun 2024 20:09:03 -0400 Subject: [PATCH] x11-drivers/nvidia-drivers: warn about the GSP default in 555 Looking at NVIDIA's forums, many are hitting regressions with this and disabling fixes them. Feels unlikely everything will be resolved before it goes out of beta and gets keyworded (unless default is reverted), so it may help a few users to warn. Signed-off-by: Ionen Wolkens --- .../nvidia-drivers/files/nvidia-555.conf | 43 +++++++++++++++++++ .../nvidia-drivers-555.52.04.ebuild | 11 ++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 x11-drivers/nvidia-drivers/files/nvidia-555.conf diff --git a/x11-drivers/nvidia-drivers/files/nvidia-555.conf b/x11-drivers/nvidia-drivers/files/nvidia-555.conf new file mode 100644 index 0000000000000..e0c1b09808f8e --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-555.conf @@ -0,0 +1,43 @@ +# NVIDIA drivers options +# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. + +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. +blacklist nouveau + +# Kernel Mode Setting (notably needed for fbdev and wayland). +# Enabling may possibly cause issues with SLI and Reverse PRIME. +#options nvidia-drm modeset=1 + +# Enable experimental framebuffer console support (^ requires modeset=1). +# Replaces efifb or similar once loaded. Note that unloading nvidia modules +# to, e.g. load a new version, would result in losing console display +# (emphasis on being experimental, mode switch could cause issues with X). +#options nvidia-drm fbdev=1 + +# Disable use of the GSP firmware which has newly been enabled by default +# for GPUs that support it (Turing/Ampere+ GPUs, aka GTX 1650+). Not +# recommended unless experience regressions for which disabling helps. +# Cannot be disabled if using USE="kernel-open". +#options nvidia NVreg_EnableGpuFirmware=0 + +# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's +# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend). +options nvidia \ + NVreg_PreserveVideoMemoryAllocations=0 \ + NVreg_TemporaryFilePath=/var/tmp + +# !!! 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/x11-drivers/nvidia-drivers/nvidia-drivers-555.52.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-555.52.04.ebuild index bd5205a9ad265..3d3eb15c1661a 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-555.52.04.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-555.52.04.ebuild @@ -146,7 +146,7 @@ src_prepare() { 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-545.conf "${T}"/nvidia.conf || die + cp "${FILESDIR}"/nvidia-555.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 @@ -499,4 +499,13 @@ pkg_postinst() { elog "If you experience issues, either disable wayland or edit nvidia.conf." elog "Of note, may possibly cause issues with SLI and Reverse PRIME." fi + + if use !kernel-open && [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 555 + then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." + fi }