From 8f0675dafee6f3f649ece528952879a0f098b858 Mon Sep 17 00:00:00 2001 From: Tulili Date: Thu, 7 Mar 2024 23:47:36 -0300 Subject: [PATCH] feat(nvidia): CUDA toolkit --- config/common/shared/nvidia/scripts.yml | 1 + config/scripts/cuda-toolkit.nu | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100755 config/scripts/cuda-toolkit.nu diff --git a/config/common/shared/nvidia/scripts.yml b/config/common/shared/nvidia/scripts.yml index 6a911c9..1a93ada 100644 --- a/config/common/shared/nvidia/scripts.yml +++ b/config/common/shared/nvidia/scripts.yml @@ -1,3 +1,4 @@ type: script-nu scripts: - nvidia-explicit-sync.nu + - cuda-toolkit.nu diff --git a/config/scripts/cuda-toolkit.nu b/config/scripts/cuda-toolkit.nu new file mode 100755 index 0000000..3029355 --- /dev/null +++ b/config/scripts/cuda-toolkit.nu @@ -0,0 +1,12 @@ +#!/usr/bin/env -S nu + +use lib/std.nu [ARCH] + +let FEDORA_MAJOR_VERSION = (run-external --redirect-combine rpm '-E' '%fedora' | complete).stdout +const COPR_FILE = "/etc/yum.repos.d/_cuda-toolkit.repo" + +http get $"https://developer.download.nvidia.com/compute/cuda/repos/fedora($FEDORA_MAJOR_VERSION)/($ARCH)/cuda-fedora($FEDORA_MAJOR_VERSION).repo" | save -f $COPR_FILE + +rpm-ostree install cuda-toolkit-12-4 + +rm -f $COPR_FILE