From 20000b9aeab0ee5ad436ad394983dfb20baecb37 Mon Sep 17 00:00:00 2001 From: joshua-stone Date: Wed, 29 Mar 2023 09:26:53 -0400 Subject: [PATCH] feat: add supergfxctl package (#77) --- README.md | 1 + build.Containerfile | 5 +++++ install.sh | 4 +++- ublue-os-nvidia-addons.spec | 24 ++++++++++++++++-------- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 110da6d..42ab06c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Note: This project is a work-in-progress. You should at a minimum be familiar wi - Selinux support - [Multiple Fedora flavors and releases](https://github.com/ublue-os/nvidia#setup) - Post-install setup with [`just`](https://github.com/ublue-os/nvidia/blob/main/justfile) +- Multi-GPU support with [`supergfxctl`](https://gitlab.com/asus-linux/supergfxctl) ([optional Gnome Shell extension](https://extensions.gnome.org/extension/5344/supergfxctl-gex/)) ## Setup diff --git a/build.Containerfile b/build.Containerfile index 7fef5af..7773bbe 100644 --- a/build.Containerfile +++ b/build.Containerfile @@ -5,6 +5,7 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}" FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-525}" +ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}" COPY --from=ghcr.io/ublue-os/config:latest /build /tmp/build COPY justfile /tmp/build/ublue-os-just/justfile @@ -16,6 +17,8 @@ ADD ublue-os-nvidia-addons.spec /tmp/ublue-os-nvidia-addons/ublue-os-nvidia-addo ADD https://nvidia.github.io/nvidia-docker/rhel9.0/nvidia-docker.repo \ /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/nvidia-container-runtime.repo +ADD https://copr.fedorainfracloud.org/coprs/lukenukem/asus-linux/repo/fedora-${FEDORA_MAJOR_VERSION}/lukenukem-asus-linux-fedora-${FEDORA_MAJOR_VERSION}.repo \ + /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/lukenukem-asus-linux.repo ADD https://nvidia.github.io/nvidia-docker/rhel9.0/nvidia-docker.repo \ /etc/yum.repos.d/nvidia-container-runtime.repo @@ -28,6 +31,8 @@ ADD files/etc/sway/environment /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/envi RUN /tmp/build.sh +RUN rpm -ql /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/*/*.rpm + FROM scratch COPY --from=builder /var/cache /var/cache diff --git a/install.sh b/install.sh index 5521f2a..420c058 100755 --- a/install.sh +++ b/install.sh @@ -6,12 +6,14 @@ sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-{cisco-openh264,modular install -D /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/nvidia-container-runtime.repo \ /etc/yum.repos.d/nvidia-container-runtime.repo +install -D /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/lukenukem-asus-linux.repo \ + /etc/yum.repos.d/lukenukem-asus-linux.repo source /var/cache/akmods/nvidia-vars rpm-ostree install \ xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \ - nvidia-container-toolkit nvidia-vaapi-driver \ + nvidia-container-toolkit nvidia-vaapi-driver supergfxctl \ /var/cache/akmods/${NVIDIA_PACKAGE_NAME}/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm \ /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons-*.rpm \ /tmp/ublue-os/rpmbuild/RPMS/noarch/ublue-os-just-*.noarch.rpm diff --git a/ublue-os-nvidia-addons.spec b/ublue-os-nvidia-addons.spec index e13dfa7..f4035b1 100644 --- a/ublue-os-nvidia-addons.spec +++ b/ublue-os-nvidia-addons.spec @@ -1,5 +1,5 @@ Name: ublue-os-nvidia-addons -Version: 0.3 +Version: 0.4 Release: 1%{?dist} Summary: Additional files for nvidia driver support @@ -11,9 +11,10 @@ Supplements: mokutil policycoreutils Source0: public_key.der Source1: nvidia-container-runtime.repo -Source2: config-rootless.toml -Source3: nvidia-container.pp -Source4: environment +Source2: lukenukem-asus-linux.repo +Source3: config-rootless.toml +Source4: nvidia-container.pp +Source5: environment %description Adds various runtime files for nvidia support. These include a key for importing with mokutil to enable secure boot for nvidia kernel modules @@ -26,29 +27,36 @@ Adds various runtime files for nvidia support. These include a key for importing # Have different name for *.der in case kmodgenca is needed for creating more keys install -Dm0644 %{SOURCE0} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-nvidia.der install -Dm0644 %{SOURCE1} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/nvidia-container-runtime.repo -install -Dm0644 %{SOURCE2} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/nvidia-container-runtime/config-rootless.toml -install -Dm0644 %{SOURCE3} %{buildroot}%{_datadir}/ublue-os/%{_datadir}/selinux/packages/nvidia-container.pp -install -Dm0644 %{SOURCE4} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/sway/environment +install -Dm0644 %{SOURCE2} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/lukenukem-asus-linux.repo +install -Dm0644 %{SOURCE3} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/nvidia-container-runtime/config-rootless.toml +install -Dm0644 %{SOURCE4} %{buildroot}%{_datadir}/ublue-os/%{_datadir}/selinux/packages/nvidia-container.pp +install -Dm0644 %{SOURCE5} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/sway/environment -sed -i 's@enabled=1@enabled=0@g' %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/nvidia-container-runtime.repo +sed -i 's@enabled=1@enabled=0@g' %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/{lukenukem-asus-linux,nvidia-container-runtime}.repo install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-nvidia.der %{buildroot}%{_sysconfdir}/pki/akmods/certs/akmods-nvidia.der install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/nvidia-container-runtime.repo %{buildroot}%{_sysconfdir}/yum.repos.d/nvidia-container-runtime.repo +install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/lukenukem-asus-linux.repo %{buildroot}%{_sysconfdir}/yum.repos.d/lukenukem-asus-linux.repo install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/nvidia-container-runtime/config-rootless.toml %{buildroot}%{_sysconfdir}/nvidia-container-runtime/config-rootless.toml install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_datadir}/selinux/packages/nvidia-container.pp %{buildroot}%{_datadir}/selinux/packages/nvidia-container.pp %files %attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-nvidia.der %attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/nvidia-container-runtime.repo +%attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/lukenukem-asus-linux.repo %attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/nvidia-container-runtime/config-rootless.toml %attr(0644,root,root) %{_datadir}/ublue-os/%{_datadir}/selinux/packages/nvidia-container.pp %attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/sway/environment %attr(0644,root,root) %{_sysconfdir}/pki/akmods/certs/akmods-nvidia.der %attr(0644,root,root) %{_sysconfdir}/yum.repos.d/nvidia-container-runtime.repo +%attr(0644,root,root) %{_sysconfdir}/yum.repos.d/lukenukem-asus-linux.repo %attr(0644,root,root) %{_sysconfdir}/nvidia-container-runtime/config-rootless.toml %attr(0644,root,root) %{_datadir}/selinux/packages/nvidia-container.pp %changelog +* Sun Mar 26 2023 Joshua Stone - 0.4 +- Add asus-linux COPR + * Fri Feb 24 2023 Joshua Stone - 0.3 - Add sway environment file - Put ublue-os modifications into a separate data directory