| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (define-module (gnu packages rocm-apps)
|
| 20 | #:use-module (guix gexp)
|
| 21 | #:use-module (guix build-system cmake)
|
| 22 | #:use-module (guix git-download)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module ((guix licenses) #:prefix license:)
|
| 25 | #:use-module (gnu packages)
|
| 26 | #:use-module (gnu packages linux)
|
| 27 | #:use-module (gnu packages llvm)
|
| 28 | #:use-module (gnu packages mpi)
|
| 29 | #:use-module (gnu packages rocm)
|
| 30 | #:use-module (gnu packages rocm-libs)
|
| 31 | #:use-module (gnu packages version-control))
|
| 32 |
|
| 33 | (define-public rochpl
|
| 34 | (package
|
| 35 | (name "rochpl")
|
| 36 | (version "7.0.2")
|
| 37 | (home-page "https://github.com/ROCm/rocHPL")
|
| 38 | (source
|
| 39 | (origin
|
| 40 | (method git-fetch)
|
| 41 | (uri (git-reference
|
| 42 | (url home-page)
|
| 43 | (commit (string-append "v" version))))
|
| 44 | (file-name (git-file-name name version))
|
| 45 | (sha256
|
| 46 | (base32 "0i3aqd2jnd4ivcpqli75kr9019fcraylxxv9laixmyx9gfxv20f0"))
|
| 47 | (patches (search-patches "rochpl-supported-distros.patch"))))
|
| 48 | (build-system cmake-build-system)
|
| 49 | (arguments
|
| 50 | (list
|
| 51 | #:configure-flags
|
| 52 | #~(list (string-append "-DGPU_TARGETS="
|
| 53 | #$(current-amd-gpu-targets-string))
|
| 54 |
|
| 55 | |
| 56 | |
| 57 | "-DROCM_FOUND=ON"
|
| 58 |
|
| 59 | (string-append "-DHIP_ROOT_DIR="
|
| 60 | #$(this-package-native-input "rocm-toolchain"))
|
| 61 | (string-append "-DROCM_PATH="
|
| 62 | #$(this-package-input "rocm-hip-runtime"))
|
| 63 | (string-append "-DHPL_MPI_DIR="
|
| 64 | #$(this-package-input "openmpi-rocm")))
|
| 65 | #:tests? #f |
| 66 | #:phases
|
| 67 | #~(modify-phases %standard-phases
|
| 68 | (add-after 'unpack 'avoid-native-optimizations
|
| 69 | (lambda _
|
| 70 | (substitute* "CMakeLists.txt"
|
| 71 | (("-march=native")
|
| 72 | ""))))
|
| 73 | (add-after 'unpack 'record-file-names-in-scripts
|
| 74 | (lambda* (#:key inputs #:allow-other-keys)
|
| 75 | (substitute* (find-files "scripts" "\\.in")
|
| 76 | |
| 77 | (("filename=HPL\\.dat")
|
| 78 | (string-append "filename=" #$output
|
| 79 | "/share/rochpl/HPL.dat"))
|
| 80 | |
| 81 | (("^rochpl_runscript=.*")
|
| 82 | (string-append "rochpl_runscript="
|
| 83 | #$output "/bin/run_rochpl\n"))
|
| 84 | (("\\$\\{rocm_dir\\}/bin/rocm-smi")
|
| 85 | (search-input-file inputs "/bin/rocm-smi"))
|
| 86 | (("lscpu")
|
| 87 | (search-input-file inputs "/bin/lscpu")))))
|
| 88 | (add-after 'install 'move-files-where-they-belong
|
| 89 | (lambda _
|
| 90 | |
| 91 | (let ((datadir (string-append #$output "/share/rochpl")))
|
| 92 | (for-each (lambda (program)
|
| 93 | (rename-file
|
| 94 | (string-append #$output "/" program)
|
| 95 | (string-append #$output "/bin/"
|
| 96 | program)))
|
| 97 | '("mpirun_rochpl" "run_rochpl"))
|
| 98 |
|
| 99 | (mkdir-p datadir)
|
| 100 | (rename-file (string-append #$output "/HPL.dat")
|
| 101 | (string-append datadir "/HPL.dat"))))))))
|
| 102 | (native-inputs
|
| 103 | (list rocm-toolchain rocm-cmake git-minimal/pinned))
|
| 104 | (inputs
|
| 105 | (list rocm-hip-runtime
|
| 106 | rocblas
|
| 107 | (list rocm-smi-lib "bin") |
| 108 | util-linux |
| 109 | libomp-rocm
|
| 110 | openmpi-rocm))
|
| 111 | (synopsis "Linear algebra benchmark for AMD GPUs")
|
| 112 | (description
|
| 113 | "rocHPL is a benchmark based on the @acronym{HPL, high-performance
|
| 114 | LINPACK} benchmark, a reference linear-algebra benchmark, implemented on top
|
| 115 | of AMD's Radeon Open Compute (ROCm) platform. rocHPL is created using the HIP
|
| 116 | programming language and optimized for AMD's discrete GPUs.")
|
| 117 | (properties
|
| 118 | `((amd-gpu-targets . ,%default-amd-gpu-targets)
|
| 119 | (tunable? . #t)))
|
| 120 | (license (list license:bsd-4 license:bsd-3))))
|
| 121 |
|