From 576fe0ccc8d0c8cda38fd52935ffaeae89cf42c2 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 3 Mar 2024 17:59:15 +0700 Subject: [PATCH] add: prime-run (#966) * new package: prime-run * add better metadata * oop * apply review suggestions --- anda/misc/prime-run/anda.hcl | 6 +++++ anda/misc/prime-run/prime-run.sh | 6 +++++ anda/misc/prime-run/prime-run.spec | 37 ++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 anda/misc/prime-run/anda.hcl create mode 100644 anda/misc/prime-run/prime-run.sh create mode 100644 anda/misc/prime-run/prime-run.spec diff --git a/anda/misc/prime-run/anda.hcl b/anda/misc/prime-run/anda.hcl new file mode 100644 index 0000000000..cd32da321c --- /dev/null +++ b/anda/misc/prime-run/anda.hcl @@ -0,0 +1,6 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "prime-run.spec" + } +} diff --git a/anda/misc/prime-run/prime-run.sh b/anda/misc/prime-run/prime-run.sh new file mode 100644 index 0000000000..2324998462 --- /dev/null +++ b/anda/misc/prime-run/prime-run.sh @@ -0,0 +1,6 @@ +#!/bin/bash +export __NV_PRIME_RENDER_OFFLOAD=1 +export __GLX_VENDOR_LIBRARY_NAME=nvidia +export __VK_LAYER_NV_optimus=NVIDIA_only +export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json +exec "$@" diff --git a/anda/misc/prime-run/prime-run.spec b/anda/misc/prime-run/prime-run.spec new file mode 100644 index 0000000000..6b9d547dfe --- /dev/null +++ b/anda/misc/prime-run/prime-run.spec @@ -0,0 +1,37 @@ +Name: prime-run +Version: 1.0.0 +Release: 1%{?dist} +Summary: A simple script to run an application with NVIDIA PRIME GPU offloading + +License: MIT +URL: https://terra.fyralabs.com +Source0: prime-run.sh + +# Bash script +Requires: bash +BuildArch: noarch + +%description +A simple Bash script to force an application to run with PRIME GPU offloading. This is useful for +laptops with NVIDIA Optimus technology, where the integrated GPU is switchable alongside the dedicated +NVIDIA GPU. By default, the integrated GPU is used to save power, but this can be overridden for +specific applications using the prime-run script. + +%prep + + +%build + + +%install +install -Dm755 %{SOURCE0} %{buildroot}%{_bindir}/prime-run + + +%files +%{_bindir}/prime-run + + + +%changelog +* Sun Mar 03 2024 Cappy Ishihara +- Initial release