Skip to content

Commit

Permalink
refactor: use upstream nvidia defaults
Browse files Browse the repository at this point in the history
TL;DR this removes code which is duplicating effort of the upstream defaults.

Longer version:

We submitted a bugfix to upstream negativo17's nvidia driver config to
fix power management on optimus laptops. negativo17/nvidia-kmod-common#15

In response @scaronni incorporated another of our changes, setting
`NVreg_TemporaryFilePath=/var/tmp`, and suggested some changes for us.

Upstream already specifies nvidia-modprobe and nvidia-persistenced, so
they need not be specifically called out in our package install. Also
nvidia-persistenced service is already default enabled.
  • Loading branch information
bsherman committed Oct 29, 2024
1 parent 3a56e7a commit a41114e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions nvidia-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ rpm-ostree install \
nvidia-driver-cuda \
nvidia-driver-cuda-libs.i686 \
nvidia-driver-libs.i686 \
nvidia-modprobe \
nvidia-persistenced \
nvidia-settings \
nvidia-container-toolkit ${VARIANT_PKGS} \
/tmp/akmods-rpms/kmods/kmod-nvidia-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm
Expand All @@ -52,22 +50,16 @@ sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/{eyecantcu-supergfxctl,negativ
# kmod-nvidia-common defaults to 'nvidia-open' but this will match our akmod image
sed -i "s/^MODULE_VARIANT=.*/MODULE_VARIANT=$KERNEL_MODULE_TYPE/" /etc/nvidia/kernel.conf

systemctl enable nvidia-persistenced.service

systemctl enable ublue-nvctk-cdi.service
semodule --verbose --install /usr/share/selinux/packages/nvidia-container.pp

# Universal Blue specific Initramfs fixes
echo "options nvidia NVreg_TemporaryFilePath=/var/tmp" >> /usr/lib/modprobe.d/nvidia-atomic.conf
cp /etc/modprobe.d/nvidia-modeset.conf /usr/lib/modprobe.d/nvidia-modeset.conf
# we must force driver load to fix black screen on boot for nvidia desktops
sed -i 's@omit_drivers@force_drivers@g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf
# as we need forced load, also mustpre-load intel/amd iGPU else chromium web browsers fail to use hardware acceleration
sed -i 's@ nvidia @ i915 amdgpu nvidia @g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf

# delete forced power managemant to instead allow driver default (fixes ampere+ optimus D3cold state)
sed '/^.*NVreg_DynamicPowerManagement.*/d' /usr/lib/modprobe.d/nvidia.conf

if [[ "${IMAGE_NAME}" == "sericea" ]]; then
mv /etc/sway/environment{,.orig}
install -Dm644 /usr/share/ublue-os/etc/sway/environment /etc/sway/environment
Expand Down

0 comments on commit a41114e

Please sign in to comment.