diff options
| -rw-r--r-- | Makefile.am | 3 | ||||
| -rw-r--r-- | gnu/packages/rocm.scm | 19 | ||||
| -rw-r--r-- | guix/amd-gpu.scm | 44 |
3 files changed, 50 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am index 546e3ed7585..1ef57af7a58 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # GNU Guix --- Functional package management for GNU | 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2012-2025 Ludovic Courtès <ludo@gnu.org> | 2 | # Copyright © 2012-2026 Ludovic Courtès <ludo@gnu.org> |
| 3 | # Copyright © 2013 Andreas Enge <andreas@enge.fr> | 3 | # Copyright © 2013 Andreas Enge <andreas@enge.fr> |
| 4 | # Copyright © 2015, 2017 Alex Kost <alezost@gmail.com> | 4 | # Copyright © 2015, 2017 Alex Kost <alezost@gmail.com> |
| 5 | # Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org> | 5 | # Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org> |
| @@ -87,6 +87,7 @@ MODULES = \ | |||
| 87 | guix/base64.scm \ | 87 | guix/base64.scm \ |
| 88 | guix/ci.scm \ | 88 | guix/ci.scm \ |
| 89 | guix/cpio.scm \ | 89 | guix/cpio.scm \ |
| 90 | guix/amd-gpu.scm \ | ||
| 90 | guix/cpu.scm \ | 91 | guix/cpu.scm \ |
| 91 | guix/deprecation.scm \ | 92 | guix/deprecation.scm \ |
| 92 | guix/docker.scm \ | 93 | guix/docker.scm \ |
diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index 6b5bc632ddf..1f2175ecc17 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #:use-module (guix utils) | 26 | #:use-module (guix utils) |
| 27 | #:use-module (guix git-download) | 27 | #:use-module (guix git-download) |
| 28 | #:use-module (guix build-system cmake) | 28 | #:use-module (guix build-system cmake) |
| 29 | #:use-module (guix amd-gpu) | ||
| 29 | #:use-module (gnu packages) | 30 | #:use-module (gnu packages) |
| 30 | #:use-module (gnu packages base) | 31 | #:use-module (gnu packages base) |
| 31 | #:use-module (gnu packages boost) | 32 | #:use-module (gnu packages boost) |
| @@ -53,9 +54,9 @@ | |||
| 53 | #:use-module (gnu packages xorg) | 54 | #:use-module (gnu packages xorg) |
| 54 | #:use-module (gnu packages libffi) | 55 | #:use-module (gnu packages libffi) |
| 55 | #:use-module (ice-9 match) | 56 | #:use-module (ice-9 match) |
| 56 | #:export (%default-amd-gpu-targets | 57 | #:re-export (%default-amd-gpu-targets |
| 57 | current-amd-gpu-targets | 58 | current-amd-gpu-targets |
| 58 | current-amd-gpu-targets-string)) | 59 | current-amd-gpu-targets-string)) |
| 59 | 60 | ||
| 60 | ;; The components are tightly integrated and can only be upgraded as a unit. If | 61 | ;; The components are tightly integrated and can only be upgraded as a unit. If |
| 61 | ;; you want to upgrade ROCm, bump this version number and the version number in | 62 | ;; you want to upgrade ROCm, bump this version number and the version number in |
| @@ -328,18 +329,6 @@ CPUs to execute unmodified HIP code. It is generic and does not assume a | |||
| 328 | particular CPU vendor or architecture.") | 329 | particular CPU vendor or architecture.") |
| 329 | (license license:expat)))) | 330 | (license license:expat)))) |
| 330 | 331 | ||
| 331 | (define %default-amd-gpu-targets | ||
| 332 | '("gfx908" "gfx90a" "gfx942" "gfx1030" "gfx1100" "gfx1101" "gfx1200" "gfx1201")) | ||
| 333 | |||
| 334 | (define-syntax-rule (current-amd-gpu-targets) | ||
| 335 | "Return the list of AMD GPU targets for this package, as a list of strings." | ||
| 336 | (or (assoc-ref (package-properties this-package) 'amd-gpu-targets) | ||
| 337 | %default-amd-gpu-targets)) | ||
| 338 | |||
| 339 | (define-syntax-rule (current-amd-gpu-targets-string) | ||
| 340 | "Return the list of AMD GPU targets for this package, as a string separated by \";\"." | ||
| 341 | (string-join (current-amd-gpu-targets) ";")) | ||
| 342 | |||
| 343 | (define-public rocm-bandwidth-test | 332 | (define-public rocm-bandwidth-test |
| 344 | (package | 333 | (package |
| 345 | (name "rocm-bandwidth-test") | 334 | (name "rocm-bandwidth-test") |
diff --git a/guix/amd-gpu.scm b/guix/amd-gpu.scm new file mode 100644 index 00000000000..d16fea2a053 --- /dev/null +++ b/guix/amd-gpu.scm | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2026 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; Copyright © 2026 David Elsing <david.elsing@posteo.net> | ||
| 4 | ;;; | ||
| 5 | ;;; This file is part of GNU Guix. | ||
| 6 | ;;; | ||
| 7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 8 | ;;; under the terms of the GNU General Public License as published by | ||
| 9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 10 | ;;; your option) any later version. | ||
| 11 | ;;; | ||
| 12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;;; GNU General Public License for more details. | ||
| 16 | ;;; | ||
| 17 | ;;; You should have received a copy of the GNU General Public License | ||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | (define-module (guix amd-gpu) | ||
| 21 | #:autoload (guix packages) (this-package package-properties) | ||
| 22 | #:export (%default-amd-gpu-targets | ||
| 23 | current-amd-gpu-targets | ||
| 24 | current-amd-gpu-targets-string)) | ||
| 25 | |||
| 26 | ;;; Commentary: | ||
| 27 | ;;; | ||
| 28 | ;;; This module provides helpers for packages targeting AMD GPUs. | ||
| 29 | ;;; | ||
| 30 | ;;; Code: | ||
| 31 | |||
| 32 | (define %default-amd-gpu-targets | ||
| 33 | '("gfx908" "gfx90a" "gfx942" "gfx1030" "gfx1100" "gfx1101" "gfx1200" "gfx1201")) | ||
| 34 | |||
| 35 | (define-syntax-rule (current-amd-gpu-targets) | ||
| 36 | "Return the list of AMD GPU targets for this package, as a list of strings." | ||
| 37 | (or (assoc-ref (package-properties this-package) 'amd-gpu-targets) | ||
| 38 | %default-amd-gpu-targets)) | ||
| 39 | |||
| 40 | (define-syntax-rule (current-amd-gpu-targets-string) | ||
| 41 | "Return the list of AMD GPU targets for this package, as a string separated | ||
| 42 | by \";\". This is useful for build options like 'AMDGPU_TARGETS' in many | ||
| 43 | CMake-based packages." | ||
| 44 | (string-join (current-amd-gpu-targets) ";")) | ||
