Skip to content

Commit

Permalink
fix: nvidia kernel.conf reflects reality (#286)
Browse files Browse the repository at this point in the history
This wasn't causing a functional problem but it did cause potential
confusion.

Fixes: #284
  • Loading branch information
bsherman authored Oct 12, 2024
1 parent 2eabc5b commit 527e668
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=akmods_nvidia,src=/rpms,dst=/tmp/akmods-rpms \
mkdir -p /var/lib/alternatives && \
IMAGE_FLAVOR=nvidia /ctx/image-info.sh && \
/ctx/nvidia-install.sh && \
NVIDIA_FLAVOR=nvidia /ctx/nvidia-install.sh && \
/ctx/build-initramfs.sh && \
mv /var/lib/alternatives /staged-alternatives && \
/ctx/cleanup.sh && \
Expand Down
8 changes: 8 additions & 0 deletions nvidia-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ rpm-ostree install \
# 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

# ensure kernel.conf matches NVIDIA_FLAVOR (which must be nvidia or nvidia-open)
# kmod-nvidia-common defaults the value to 'nvidia-open' but this will match on $NVIDIA_FLAVOR
KERNEL_MODULE_TYPE="kernel"
if [[ "${NVIDIA_FLAVOR}" == "nvidia-open" ]]; then
KERNEL_MODULE_TYPE="kernel-open"
fi
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
Expand Down

0 comments on commit 527e668

Please sign in to comment.