rocm-related: create and use a generic updater script
This commit is contained in:
parent
72f5af191f
commit
9b98f8433a
28 changed files with 256 additions and 203 deletions
|
@ -165,10 +165,19 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
wrapProgram $out/bin/hipconfig --set HIP_PATH $out --set HSA_PATH ${rocm-runtime} --set HIP_CLANG_PATH ${clang}/bin
|
||||
'';
|
||||
|
||||
# TODO: Separate HIP and hipamd into separate derivations
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/ROCm-Developer-Tools/HIP/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
-sL "https://api.github.com/repos/ROCm-Developer-Tools/HIP/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
|
||||
IFS='.' read -a version_arr <<< "$version"
|
||||
|
||||
if [ "''${#version_arr[*]}" == 2 ]; then
|
||||
version="''${version}.0"
|
||||
fi
|
||||
|
||||
current_version="$(grep "version =" pkgs/development/compilers/hip/default.nix | head -n1 | cut -d'"' -f2)"
|
||||
if [[ "$version" != "$current_version" ]]; then
|
||||
tarball_meta="$(nix-prefetch-github ROCm-Developer-Tools HIP --rev "rocm-$version")"
|
||||
|
@ -180,7 +189,15 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
echo hip already up-to-date
|
||||
fi
|
||||
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/ROCm-Developer-Tools/hipamd/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
-sL "https://api.github.com/repos/ROCm-Developer-Tools/hipamd/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
|
||||
IFS='.' read -a version_arr <<< "$version"
|
||||
|
||||
if [ "''${#version_arr[*]}" == 2 ]; then
|
||||
version="''${version}.0"
|
||||
fi
|
||||
|
||||
current_version="$(grep "version =" pkgs/development/compilers/hip/default.nix | tail -n1 | cut -d'"' -f2)"
|
||||
if [[ "$version" != "$current_version" ]]; then
|
||||
tarball_meta="$(nix-prefetch-github ROCm-Developer-Tools hipamd --rev "rocm-$version")"
|
||||
|
|
|
@ -58,24 +58,34 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||
--replace 'FILES_MATCHING' 'NO_SOURCE_PERMISSIONS FILES_MATCHING'
|
||||
'';
|
||||
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github
|
||||
passthru = {
|
||||
isClang = true;
|
||||
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/llvm-project/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
current_version="$(grep "version =" pkgs/development/compilers/llvm/rocm/default.nix | cut -d'"' -f2)"
|
||||
if [[ "$version" != "$current_version" ]]; then
|
||||
tarball_meta="$(nix-prefetch-github RadeonOpenCompute llvm-project --rev "rocm-$version")"
|
||||
tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))"
|
||||
sed -i "pkgs/development/compilers/llvm/rocm/default.nix" \
|
||||
-e 's,version = "\(.*\)",version = "'"$version"'",' \
|
||||
-e 's,hash = "\(.*\)",hash = "sha256-'"$tarball_hash"'",'
|
||||
else
|
||||
echo rocm-llvm already up-to-date
|
||||
fi
|
||||
'';
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github
|
||||
|
||||
passthru.isClang = true;
|
||||
version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
-sL "https://api.github.com/repos/RadeonOpenCompute/llvm-project/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
|
||||
IFS='.' read -a version_arr <<< "$version"
|
||||
|
||||
if [ "''${#version_arr[*]}" == 2 ]; then
|
||||
version="''${version}.0"
|
||||
fi
|
||||
|
||||
current_version="$(grep "version =" pkgs/development/compilers/llvm/rocm/default.nix | cut -d'"' -f2)"
|
||||
if [[ "$version" != "$current_version" ]]; then
|
||||
tarball_meta="$(nix-prefetch-github RadeonOpenCompute llvm-project --rev "rocm-$version")"
|
||||
tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))"
|
||||
sed -i "pkgs/development/compilers/llvm/rocm/default.nix" \
|
||||
-e 's,version = "\(.*\)",version = "'"$version"'",' \
|
||||
-e 's,hash = "\(.*\)",hash = "sha256-'"$tarball_hash"'",'
|
||||
else
|
||||
echo rocm-llvm already up-to-date
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "ROCm fork of the LLVM compiler infrastructure";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-device-libs
|
||||
|
@ -34,13 +34,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"-DCMAKE_CXX_COMPILER=clang++"
|
||||
];
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/RadeonOpenCompute/clang-ocl/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version clang-ocl "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "OpenCL compilation with clang compiler";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -76,13 +76,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
rmdir $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/hipCUB/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version hipcub "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Thin wrapper library on top of rocPRIM or CUB";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -112,13 +112,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
rmdir $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/hipSPARSE/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version hipsparse "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "ROCm SPARSE marshalling library";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchurl
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, pkg-config
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
|
@ -179,13 +179,11 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||
patchelf --set-rpath ${lib.makeLibraryPath (finalAttrs.buildInputs ++ [ hip ])}:$out/lib $test/bin/*
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/MIOpen/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version miopen "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Machine intelligence library for ROCm";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-opencl-runtime
|
||||
|
@ -110,13 +110,11 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||
patchelf --set-rpath ${lib.makeLibraryPath finalAttrs.buildInputs}:$out/lib $benchmark/bin/*
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/MIOpenGEMM/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version miopengemm "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "OpenCL general matrix multiplication API for ROCm";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -72,13 +72,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
rmdir $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rccl/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rccl "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "ROCm communication collectives library";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
|
@ -113,13 +113,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
--replace "virtualenv_install(\''${Tensile_TEST_LOCAL_PATH})" ""
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocBLAS/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocblas "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "BLAS implementation for ROCm platform";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, rocm-comgr
|
||||
}:
|
||||
|
||||
|
@ -42,12 +42,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/ROCm-Developer-Tools/ROCclr/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
update-source-version rocclr "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Source package of the Radeon Open Compute common language runtime";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -98,13 +98,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
mv $out/rocfft_rtc_helper $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocFFT/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocfft "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "FFT implementation for ROCm ";
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, clang, rocm-device-libs, llvm }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, clang
|
||||
, rocm-device-libs
|
||||
, llvm
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocm-comgr";
|
||||
|
@ -27,12 +35,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
patches = [ ./cmake.patch ];
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/ROCm-CompilerSupport/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocm-comgr "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "APIs for compiling and inspecting AMDGPU code objects";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, clang
|
||||
, llvm
|
||||
|
@ -29,12 +29,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
patches = [ ./cmake.patch ];
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/ROCm-Device-Libs/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocm-device-libs "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Set of AMD-specific device-side language runtime libraries";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, addOpenGLRunpath
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
|
@ -68,12 +68,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
--replace 'ICD_VENDOR_PATH' '"${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors/"'
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/ROCm-OpenCL-Runtime/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
update-source-version rocm-opencl-runtime "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "OpenCL runtime for AMD GPUs, part of the ROCm stack";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, addOpenGLRunpath
|
||||
, cmake
|
||||
, pkg-config
|
||||
|
@ -48,12 +48,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
rm -rf $out/hsa
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/ROCR-Runtime/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocm-runtime "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Platform runtime for ROCm";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ lib, stdenv
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, pkg-config
|
||||
, libdrm
|
||||
|
@ -37,12 +38,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
cp -r $src/include $out
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/ROCT-Thunk-Interface/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
update-source-version rocm-thunk "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Radeon open compute thunk interface";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, clang
|
||||
, git
|
||||
|
@ -39,13 +39,13 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"-DBUILD_FAT_LIBROCKCOMPILER=ON"
|
||||
];
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocMLIR/tags?per_page=2" | jq '.[1].name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocmlir "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
page = "tags?per_page=2";
|
||||
filter = ".[1].name | split(\"-\") | .[1]";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "MLIR-based convolution and GEMM kernel generator";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -72,13 +72,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
rmdir $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocPRIM/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocprim "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "ROCm parallel primitives";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -75,13 +75,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
rmdir $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocRAND/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocrand "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Generate pseudo-random and quasi-random numbers";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchzip
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -134,13 +134,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
mirror2 = "https://www.cise.ufl.edu/research/sparse/MM";
|
||||
};
|
||||
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocSPARSE/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocsparse "$version" --ignore-same-hash
|
||||
'';
|
||||
updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
|
@ -74,13 +74,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
# rmdir $out/bin
|
||||
# '';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocThrust/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocthrust "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "ROCm parallel algorithm library";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, hip
|
||||
|
@ -121,13 +121,11 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||
rmdir $out/bin
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocWMMA/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocwmma "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Mixed precision matrix multiplication and accumulation";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeScript
|
||||
, rocmUpdateScript
|
||||
, buildPythonPackage
|
||||
, pyyaml
|
||||
, msgpack
|
||||
|
@ -25,13 +25,11 @@ buildPythonPackage rec {
|
|||
pandas
|
||||
];
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/Tensile/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version tensile "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = pname;
|
||||
owner = src.owner;
|
||||
repo = src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "GEMMs and tensor contractions";
|
||||
|
|
27
pkgs/development/rocm-modules/update-script/default.nix
Normal file
27
pkgs/development/rocm-modules/update-script/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ runtimeShell
|
||||
, writeScript
|
||||
}:
|
||||
|
||||
{ name ? ""
|
||||
, owner ? ""
|
||||
, repo ? ""
|
||||
, page ? "releases?per_page=1"
|
||||
, filter ? ".[0].tag_name | split(\"-\") | .[1]"
|
||||
}:
|
||||
|
||||
let
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
-sL "https://api.github.com/repos/${owner}/${repo}/${page}" | jq '${filter}' --raw-output)"
|
||||
|
||||
IFS='.' read -a version_arr <<< "$version"
|
||||
|
||||
if [ "''${#version_arr[*]}" == 2 ]; then
|
||||
version="''${version}.0"
|
||||
fi
|
||||
|
||||
update-source-version ${name} "$version" --ignore-same-hash
|
||||
'';
|
||||
in [ updateScript ]
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, stdenv, fetchFromGitHub, writeScript, cmake }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocm-cmake";
|
||||
|
@ -13,12 +18,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/rocm-cmake/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
update-source-version rocm-cmake "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "CMake modules for common build tasks for the ROCm stack";
|
||||
|
|
|
@ -1,14 +1,27 @@
|
|||
{ stdenv, lib, fetchFromGitHub, writeScript, fetchpatch, cmake, rocm-runtime, python3, rocm-cmake, busybox, gnugrep
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, rocm-runtime
|
||||
, python3
|
||||
, rocm-cmake
|
||||
, busybox
|
||||
, gnugrep
|
||||
# rocminfo requires that the calling user have a password and be in
|
||||
# the video group. If we let rocm_agent_enumerator rely upon
|
||||
# rocminfo's output, then it, too, has those requirements. Instead,
|
||||
# we can specify the GPU targets for this system (e.g. "gfx803" for
|
||||
# Polaris) such that no system call is needed for downstream
|
||||
# compilers to determine the desired target.
|
||||
, defaultTargets ? []}:
|
||||
, defaultTargets ? []
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
version = "5.4.0";
|
||||
pname = "rocminfo";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "RadeonOpenCompute";
|
||||
repo = "rocminfo";
|
||||
|
@ -19,6 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
enableParallelBuilding = true;
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ rocm-cmake rocm-runtime ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DROCM_DIR=${rocm-runtime}"
|
||||
"-DROCRTST_BLD_TYPE=Release"
|
||||
|
@ -37,12 +51,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
echo '${lib.concatStringsSep "\n" defaultTargets}' > $out/bin/target.lst
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/rocminfo/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
||||
update-source-version rocminfo "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "ROCm Application for Reporting System Info";
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, wrapPython }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, wrapPython
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocm-smi";
|
||||
|
@ -19,12 +25,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
wrapPythonProgramsIn $out
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/rocm_smi_lib/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
||||
update-source-version rocm-smi "$version" --ignore-same-hash
|
||||
'';
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
repo = finalAttrs.src.repo;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "System management interface for AMD GPUs supported by ROCm";
|
||||
|
|
|
@ -15149,6 +15149,8 @@ with pkgs;
|
|||
useOpenCL = true;
|
||||
};
|
||||
|
||||
rocmUpdateScript = callPackage ../development/rocm-modules/update-script { };
|
||||
|
||||
rtags = callPackage ../development/tools/rtags {
|
||||
inherit (darwin) apple_sdk;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue