Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pkgs/development/compilers/hip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
, rocm-runtime
, rocm-thunk
, rocminfo
, writeScript
, writeText
}:

Expand Down Expand Up @@ -163,4 +164,19 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/hipcc --set HIP_PATH $out --set HSA_PATH ${rocm-runtime} --set HIP_CLANG_PATH ${clang}/bin --prefix PATH : ${lld}/bin --set NIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt} 1 --prefix NIX_LDFLAGS ' ' -L${compiler-rt}/lib --prefix NIX_LDFLAGS_FOR_TARGET ' ' -L${compiler-rt}/lib
wrapProgram $out/bin/hipconfig --set HIP_PATH $out --set HSA_PATH ${rocm-runtime} --set HIP_CLANG_PATH ${clang}/bin
'';

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -sL "https://api.github.com/repos/ROCm-Developer-Tools/HIP/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
update-source-version hip "$version"
'';

meta = with lib; {
description = "C++ Heterogeneous-Compute Interface for Portability";
homepage = "https://github.com/ROCm-Developer-Tools/HIP";
license = licenses.mit;
maintainers = with maintainers; [ lovesegfault ];
platforms = platforms.linux;
};
}
18 changes: 18 additions & 0 deletions pkgs/development/compilers/llvm/rocm/llvm/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchFromGitHub
, writeScript
, cmake
, python3
, libxml2
Expand Down Expand Up @@ -88,6 +89,23 @@ in stdenv.mkDerivation rec {

passthru.src = src;

updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github

version="$(curl -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
'';

meta = with lib; {
description = "ROCm fork of the LLVM compiler infrastructure";
homepage = "https://github.com/RadeonOpenCompute/llvm-project";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/rocclr/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib, stdenv
, fetchFromGitHub
, writeScript
, cmake
, rocm-cmake
, clang
Expand Down Expand Up @@ -51,6 +52,13 @@ stdenv.mkDerivation rec {
--replace "/build/source/build" "$out"
'';

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -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"
'';

meta = with lib; {
description = "Radeon Open Compute common language runtime";
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
Expand Down
9 changes: 8 additions & 1 deletion pkgs/development/libraries/rocm-comgr/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, clang, rocm-device-libs, lld, llvm }:
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, clang, rocm-device-libs, lld, llvm }:

stdenv.mkDerivation rec {
pname = "rocm-comgr";
Expand Down Expand Up @@ -36,6 +36,13 @@ stdenv.mkDerivation rec {
-i CMakeLists.txt
'';

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -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"
'';

meta = with lib; {
description = "APIs for compiling and inspecting AMDGPU code objects";
homepage = "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/tree/amd-stg-open/lib/comgr";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/rocm-device-libs/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib, stdenv
, fetchFromGitHub
, writeScript
, cmake
, clang
, clang-unwrapped
Expand Down Expand Up @@ -30,6 +31,13 @@ stdenv.mkDerivation rec {
"-DCLANG=${clang}/bin/clang"
];

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -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"
'';

meta = with lib; {
description = "Set of AMD-specific device-side language runtime libraries";
homepage = "https://github.com/RadeonOpenCompute/ROCm-Device-Libs";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/rocm-opencl-runtime/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchFromGitHub
, writeScript
, addOpenGLRunpath
, cmake
, rocm-cmake
Expand Down Expand Up @@ -74,6 +75,13 @@ stdenv.mkDerivation rec {
echo 'add_dependencies(amdocl64 OpenCL)' >> amdocl/CMakeLists.txt
'';

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -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"
'';

meta = with lib; {
description = "OpenCL runtime for AMD GPUs, part of the ROCm stack";
homepage = "https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/rocm-runtime/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchFromGitHub
, writeScript
, addOpenGLRunpath
, clang-unwrapped
, cmake
Expand Down Expand Up @@ -41,6 +42,13 @@ stdenv.mkDerivation rec {
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 -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"
'';

meta = with lib; {
description = "Platform runtime for ROCm";
homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/rocm-thunk/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib, stdenv
, fetchFromGitHub
, writeScript
, cmake
, pkg-config
, numactl
Expand Down Expand Up @@ -28,6 +29,13 @@ stdenv.mkDerivation rec {
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 -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"
'';

meta = with lib; {
description = "Radeon open compute thunk interface";
homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
Expand Down
9 changes: 8 additions & 1 deletion pkgs/development/tools/build-managers/rocm-cmake/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake }:
{ lib, stdenv, fetchFromGitHub, writeScript, cmake }:

stdenv.mkDerivation rec {
pname = "rocm-cmake";
Expand All @@ -13,6 +13,13 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ cmake ];

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -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"
'';

meta = with lib; {
description = "CMake modules for common build tasks for the ROCm stack";
homepage = "https://github.com/RadeonOpenCompute/rocm-cmake";
Expand Down
17 changes: 16 additions & 1 deletion pkgs/development/tools/rocminfo/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, rocm-runtime, python3, rocm-cmake, busybox, gnugrep
{ stdenv, lib, fetchFromGitHub, writeScript, 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,
Expand Down Expand Up @@ -35,4 +35,19 @@ stdenv.mkDerivation rec {
'' + lib.optionalString (defaultTargets != []) ''
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 -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"
'';

meta = with lib; {
description = "ROCm Application for Reporting System Info";
homepage = "https://github.com/RadeonOpenCompute/rocminfo";
license = licenses.ncsa;
maintainers = with maintainers; [ lovesegfault ];
platforms = platforms.linux;
};
}
11 changes: 9 additions & 2 deletions pkgs/tools/system/rocm-smi/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, wrapPython }:
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, wrapPython }:

stdenv.mkDerivation rec {
pname = "rocm-smi";
Expand Down Expand Up @@ -42,9 +42,16 @@ stdenv.mkDerivation rec {
wrapPythonProgramsIn $out/bin
'';

passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version="$(curl -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"
'';

meta = with lib; {
description = "System management interface for AMD GPUs supported by ROCm";
homepage = "https://github.com/RadeonOpenCompute/ROC-smi";
homepage = "https://github.com/RadeonOpenCompute/rocm_smi_lib";
license = with licenses; [ mit ];
maintainers = with maintainers; [ lovesegfault ];
platforms = [ "x86_64-linux" ];
Expand Down