Skip to content

Commit

Permalink
feat: swap to negativo17 as nvidia driver source (#234)
Browse files Browse the repository at this point in the history
* feat: swap to negativo17 as nvidia driver source

This reworks all the bits in akmods for nvidia:
- removes nvidia driver version as only latest is supported
- uses negativo17 nvidia driver and packages

* chore(nvidia): add packages lost in move to negativo17

A few packages were no longer included automatically by dependencies.

* feat(nvidia): switch to negativo17 for nvidia

This reworks all the bits in akmods for nvidia:
- removes nvidia driver version as only latest is supported
- uses negativo17 nvidia driver and packages
- adds a few packages were no longer included automatically by dependencies
    - libva-nvidia-driver
    - mesa-vulkan-drivers.i686

* fix: Correct issues with initramfs in stock Negativo package

chore: Remove unneeded rpmfusion handler

---------

Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
  • Loading branch information
bsherman and KyleGospo authored Jun 27, 2024
1 parent cf77151 commit 98b6f7f
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions nvidia-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ if [[ "${FEDORA_MAJOR_VERSION}" -ge 41 ]]; then
sed -i "s%free/fedora/releases%free/fedora/development%" /etc/yum.repos.d/rpmfusion-*.repo
fi

if [ -n "${RPMFUSION_MIRROR}" ]; then
# force use of single rpmfusion mirror
echo "Using single rpmfusion mirror: ${RPMFUSION_MIRROR}"
sed -i.bak "s%^metalink=%#metalink=%" /etc/yum.repos.d/rpmfusion-*.repo
sed -i "s%^#baseurl=http://download1.rpmfusion.org%baseurl=${RPMFUSION_MIRROR}%" /etc/yum.repos.d/rpmfusion-*.repo
fi


# nvidia install steps
## nvidia install steps
rpm-ostree install /tmp/akmods-rpms/ublue-os/ublue-os-nvidia-addons-*.rpm

# enables nvidia repos provided by ublue-os-nvidia-addons
sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/eyecantcu-supergfxctl.repo
sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/negativo17-fedora-nvidia.repo
sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/nvidia-container-toolkit.repo

source /tmp/akmods-rpms/kmods/nvidia-vars

if [[ "${IMAGE_NAME}" == "kinoite" ]]; then
Expand All @@ -35,26 +32,33 @@ else
fi

rpm-ostree install \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-libs.i686 \
nvidia-container-toolkit nvidia-vaapi-driver ${VARIANT_PKGS} \
/tmp/akmods-rpms/kmods/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm


# nvidia post-install steps
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/{eyecantcu-supergfxctl,nvidia-container-toolkit}.repo
libva-nvidia-driver \
mesa-vulkan-drivers.i686 \
nvidia-driver \
nvidia-driver-cuda \
nvidia-driver-cuda-libs.i686 \
nvidia-driver-libs.i686 \
nvidia-driver-NVML.i686 \
nvidia-driver-NvFBCOpenGL \
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


## nvidia post-install steps
# disables nvidia repos provided by ublue-os-nvidia-addons
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/{eyecantcu-supergfxctl,negativo17-fedora-nvidia,nvidia-container-toolkit}.repo

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

# Universal Blue specific Initramfs fixes
cp /etc/modprobe.d/nvidia-modeset.conf /usr/lib/modprobe.d/nvidia-modeset.conf
sed -i 's@omit_drivers@force_drivers@g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf

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


if [ -n "${RPMFUSION_MIRROR}" ]; then
# reset forced use of single rpmfusion mirror
echo "Revert from single rpmfusion mirror: ${RPMFUSION_MIRROR}"
rename -v .repo.bak .repo /etc/yum.repos.d/rpmfusion-*repo.bak
fi

0 comments on commit 98b6f7f

Please sign in to comment.