mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
rocm-related: standardize
rocminfo: standardize rocm-thunk: standardize rocm-opencl-icd: standardize rocclr: standardize rocm-device-libs: standardize rocm-comgr: standardize rocm-opencl-runtime: standardize rocm-runtime: standardize clang-ocl: standardize composable_kernel: standardize hipcub: standardize hipsparse: standardize miopengemm: standardize rccl: standardize rocfft: standardize rocprim: standardize rocsparse: standardize rocmlir: standardize rocrand: standardize tensile: standardize rocm-cmake: standardize rocm-smi: standardize miopen: standardize
This commit is contained in:
parent
0ee533a8e0
commit
785ed480aa
@ -5,7 +5,6 @@
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-device-libs
|
||||
, clang
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@ -22,17 +21,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
rocm-cmake
|
||||
clang
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-device-libs
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_C_COMPILER=clang"
|
||||
"-DCMAKE_CXX_COMPILER=clang++"
|
||||
];
|
||||
buildInputs = [ rocm-device-libs ];
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
@ -45,6 +36,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://github.com/RadeonOpenCompute/clang-ocl";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = teams.rocm.members;
|
||||
broken = finalAttrs.version != clang.version;
|
||||
broken = finalAttrs.version != stdenv.cc.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -6,6 +6,7 @@
|
||||
, rocm-cmake
|
||||
, hip
|
||||
, openmp
|
||||
, clang-tools-extra
|
||||
, gtest
|
||||
, buildTests ? false
|
||||
, buildExamples ? false
|
||||
@ -37,6 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
cmake
|
||||
rocm-cmake
|
||||
hip
|
||||
clang-tools-extra
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@ -85,8 +87,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://github.com/ROCmSoftwarePlatform/composable_kernel";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = teams.rocm.members;
|
||||
# Several tests seem to either not compile or have a race condition
|
||||
# Undefined reference to symbol '_ZTIN7testing4TestE'
|
||||
# Well, at least we're getting something that makes sense now
|
||||
# undefined symbol: testing::Message::Message()
|
||||
# Try removing this next update
|
||||
broken = buildTests;
|
||||
};
|
||||
|
@ -4,9 +4,6 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, rocprim
|
||||
, hip
|
||||
, gtest
|
||||
@ -42,9 +39,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
rocprim
|
||||
] ++ lib.optionals buildTests [
|
||||
gtest
|
||||
|
@ -4,9 +4,6 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, rocsparse
|
||||
, hip
|
||||
, gfortran
|
||||
@ -41,9 +38,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
rocsparse
|
||||
git
|
||||
] ++ lib.optionals buildTests [
|
||||
|
@ -6,14 +6,10 @@
|
||||
, pkg-config
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, rocm-opencl-runtime
|
||||
, rocblas
|
||||
, rocmlir
|
||||
, hip
|
||||
, clang
|
||||
, clang-tools-extra
|
||||
, clang-ocl
|
||||
, llvm
|
||||
, miopengemm
|
||||
@ -84,15 +80,11 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
cmake
|
||||
rocm-cmake
|
||||
hip
|
||||
clang
|
||||
llvm
|
||||
clang-tools-extra
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
rocm-opencl-runtime
|
||||
llvm
|
||||
rocblas
|
||||
rocmlir
|
||||
clang-ocl
|
||||
@ -126,8 +118,6 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
"-DCMAKE_CXX_COMPILER=hipcc"
|
||||
"-DMIOPEN_BACKEND=HIP"
|
||||
] ++ lib.optionals useOpenCL [
|
||||
"-DCMAKE_C_COMPILER=${clang}/bin/clang"
|
||||
"-DCMAKE_CXX_COMPILER=${clang}/bin/clang++"
|
||||
"-DMIOPEN_BACKEND=OpenCL"
|
||||
] ++ lib.optionals buildTests [
|
||||
"-DBUILD_TESTS=ON"
|
||||
@ -148,8 +138,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
--replace "3 REQUIRED PATHS /opt/rocm)" "3 REQUIRED PATHS ${hip})" \
|
||||
--replace "hip REQUIRED PATHS /opt/rocm" "hip REQUIRED PATHS ${hip}" \
|
||||
--replace "rocblas REQUIRED PATHS /opt/rocm" "rocblas REQUIRED PATHS ${rocblas}" \
|
||||
--replace "miopengemm PATHS /opt/rocm" "miopengemm PATHS ${miopengemm}" \
|
||||
--replace "set(MIOPEN_TIDY_ERRORS ALL)" "" # Fix clang-tidy at some point
|
||||
--replace "miopengemm PATHS /opt/rocm" "miopengemm PATHS ${miopengemm}"
|
||||
'' + lib.optionalString (!buildTests) ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace "add_subdirectory(test)" ""
|
||||
@ -180,7 +169,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
'' + lib.optionalString buildTests ''
|
||||
mkdir -p $test/bin
|
||||
mv bin/test_* $test/bin
|
||||
patchelf --set-rpath ${lib.makeLibraryPath (finalAttrs.buildInputs ++ [ hip ])}:$out/lib $test/bin/*
|
||||
patchelf --set-rpath $out/lib:${lib.makeLibraryPath (finalAttrs.buildInputs ++ [ hip ])} $test/bin/*
|
||||
'';
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
|
@ -5,7 +5,6 @@
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-opencl-runtime
|
||||
, clang
|
||||
, texlive
|
||||
, doxygen
|
||||
, sphinx
|
||||
@ -54,7 +53,6 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
rocm-cmake
|
||||
clang
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@ -70,8 +68,6 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_C_COMPILER=clang"
|
||||
"-DCMAKE_CXX_COMPILER=clang++"
|
||||
# Manually define CMAKE_INSTALL_<DIR>
|
||||
# See: https://github.com/NixOS/nixpkgs/pull/197838
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
@ -121,6 +117,6 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://github.com/ROCmSoftwarePlatform/MIOpenGEMM";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = teams.rocm.members;
|
||||
broken = finalAttrs.version != clang.version;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -4,9 +4,6 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, rocm-smi
|
||||
, hip
|
||||
, gtest
|
||||
@ -38,9 +35,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
rocm-smi
|
||||
gtest
|
||||
] ++ lib.optionals buildTests [
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ lib, stdenv
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, rocmUpdateScript
|
||||
@ -26,18 +27,19 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
})
|
||||
];
|
||||
|
||||
prePatch = ''
|
||||
postPatch = ''
|
||||
substituteInPlace device/comgrctx.cpp \
|
||||
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
|
||||
'';
|
||||
|
||||
buildPhase = "";
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
cp -r * $out/
|
||||
cp -a * $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
@ -57,5 +59,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# to be supported yet by the build infrastructure. Recheck in
|
||||
# the future.
|
||||
platforms = [ "x86_64-linux" ];
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -4,17 +4,14 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, hip
|
||||
, openmp
|
||||
, sqlite
|
||||
, python3
|
||||
, gtest
|
||||
, boost
|
||||
, fftw
|
||||
, fftwFloat
|
||||
, llvmPackages
|
||||
, buildTests ? false
|
||||
, buildBenchmarks ? false
|
||||
}:
|
||||
@ -45,9 +42,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
sqlite
|
||||
python3
|
||||
] ++ lib.optionals buildTests [
|
||||
@ -56,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
boost
|
||||
fftw
|
||||
fftwFloat
|
||||
llvmPackages.openmp
|
||||
openmp
|
||||
];
|
||||
|
||||
propogatedBuildInputs = lib.optionals buildTests [
|
||||
|
@ -3,12 +3,17 @@
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, clang
|
||||
, rocm-cmake
|
||||
, rocm-device-libs
|
||||
, llvm
|
||||
, libxml2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
let
|
||||
llvmNativeTarget =
|
||||
if stdenv.isx86_64 then "X86"
|
||||
else if stdenv.isAarch64 then "AArch64"
|
||||
else throw "Unsupported ROCm LLVM platform";
|
||||
in stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocm-comgr";
|
||||
version = "5.4.0";
|
||||
|
||||
@ -19,21 +24,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-qLsrBTeSop7lIQv8gZDwgpvGZJOAq90zsvMi1QpfbAs=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/lib/comgr";
|
||||
patches = [ ./cmake.patch ];
|
||||
sourceRoot = "${finalAttrs.src.name}/lib/comgr";
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [ clang rocm-device-libs llvm ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_C_COMPILER=${clang}/bin/clang"
|
||||
"-DCMAKE_CXX_COMPILER=${clang}/bin/clang++"
|
||||
"-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm"
|
||||
"-DLLD_INCLUDE_DIRS=${llvm}/include"
|
||||
"-DLLVM_TARGETS_TO_BUILD=\"AMDGPU;X86\""
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
rocm-cmake
|
||||
];
|
||||
|
||||
patches = [ ./cmake.patch ];
|
||||
buildInputs = [
|
||||
rocm-device-libs
|
||||
libxml2
|
||||
];
|
||||
|
||||
cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86" ];
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
@ -47,5 +51,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = licenses.ncsa;
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
platforms = platforms.linux;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -1,12 +1,18 @@
|
||||
{ lib, stdenv
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, clang
|
||||
, llvm
|
||||
, rocm-cmake
|
||||
, libxml2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
let
|
||||
llvmNativeTarget =
|
||||
if stdenv.isx86_64 then "X86"
|
||||
else if stdenv.isAarch64 then "AArch64"
|
||||
else throw "Unsupported ROCm LLVM platform";
|
||||
in stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocm-device-libs";
|
||||
version = "5.4.0";
|
||||
|
||||
@ -17,17 +23,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-8gxvgy2GlROxM5qKtZVu5Lxa1FmTIVlBTpfp8rxhNhk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
patches = [ ./cmake.patch ];
|
||||
|
||||
buildInputs = [ clang llvm ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm;${llvm}/lib/cmake/clang"
|
||||
"-DLLVM_TARGETS_TO_BUILD='AMDGPU;X86'"
|
||||
"-DCLANG=${clang}/bin/clang"
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
rocm-cmake
|
||||
];
|
||||
|
||||
patches = [ ./cmake.patch ];
|
||||
buildInputs = [ libxml2 ];
|
||||
cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" ];
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
@ -41,5 +45,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = licenses.ncsa;
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
platforms = platforms.linux;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -1,4 +1,8 @@
|
||||
{ lib, callPackage, stdenv, rocm-opencl-runtime }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, callPackage
|
||||
, rocm-opencl-runtime
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "rocm-opencl-icd";
|
||||
@ -11,12 +15,12 @@ stdenv.mkDerivation rec {
|
||||
echo "${rocm-opencl-runtime}/lib/libamdocl64.so" > $out/etc/OpenCL/vendors/amdocl64.icd
|
||||
'';
|
||||
|
||||
passthru.impureTests = { rocm-opencl = callPackage ./test.nix {}; };
|
||||
passthru.impureTests = { rocm-opencl = callPackage ./test.nix { }; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "OpenCL ICD definition for AMD GPUs using the ROCm stack";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ lovesegfault ];
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
@ -1,23 +1,15 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, addOpenGLRunpath
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, clang
|
||||
, glew
|
||||
, libglvnd
|
||||
, libX11
|
||||
, llvm
|
||||
, mesa
|
||||
, numactl
|
||||
, python3
|
||||
, rocclr
|
||||
, rocm-comgr
|
||||
, rocm-device-libs
|
||||
, rocm-runtime
|
||||
, rocm-thunk
|
||||
, rocclr
|
||||
, glew
|
||||
, libX11
|
||||
, numactl
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@ -31,27 +23,19 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-E1+Y/fgp5b+7H1LN+O1fwVi0/XRCgvsiSxTY3u/q+8I=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake rocm-cmake ];
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [
|
||||
clang
|
||||
glew
|
||||
libglvnd
|
||||
libX11
|
||||
llvm
|
||||
mesa
|
||||
numactl
|
||||
python3
|
||||
rocm-comgr
|
||||
rocm-device-libs
|
||||
rocm-runtime
|
||||
rocm-thunk
|
||||
glew
|
||||
libX11
|
||||
numactl
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DAMD_OPENCL_PATH=${finalAttrs.src}"
|
||||
"-DROCCLR_PATH=${rocclr}"
|
||||
"-DCPACK_PACKAGING_INSTALL_PREFIX=/opt/rocm/opencl"
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
@ -80,5 +64,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = with licenses; [ asl20 mit ];
|
||||
maintainers = with maintainers; [ acowley lovesegfault ] ++ teams.rocm.members;
|
||||
platforms = platforms.linux;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -1,17 +1,18 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, addOpenGLRunpath
|
||||
, cmake
|
||||
, pkg-config
|
||||
, cmake
|
||||
, xxd
|
||||
, elfutils
|
||||
, libdrm
|
||||
, llvm
|
||||
, numactl
|
||||
, rocm-device-libs
|
||||
, rocm-thunk }:
|
||||
, rocm-thunk
|
||||
, libelf
|
||||
, libdrm
|
||||
, numactl
|
||||
, valgrind
|
||||
, libxml2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocm-runtime";
|
||||
@ -24,13 +25,22 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-M9kv1Oe5ZZfd9H/+KUJUoK9L1EdyS2qRp2mJDK0dnPE=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/src";
|
||||
sourceRoot = "${finalAttrs.src.name}/src";
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config xxd ];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
cmake
|
||||
xxd
|
||||
];
|
||||
|
||||
buildInputs = [ elfutils libdrm llvm numactl ];
|
||||
|
||||
cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${rocm-thunk}" ];
|
||||
buildInputs = [
|
||||
rocm-thunk
|
||||
libelf
|
||||
libdrm
|
||||
numactl
|
||||
valgrind
|
||||
libxml2
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs image/blit_src/create_hsaco_ascii_file.sh
|
||||
@ -45,7 +55,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
|
||||
fixupPhase = ''
|
||||
rm -rf $out/hsa
|
||||
rm -rf $out/hsa/*
|
||||
ln -s $out/{include,lib} $out/hsa
|
||||
'';
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
@ -59,5 +70,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
|
||||
license = with licenses; [ ncsa ];
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -2,10 +2,12 @@
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, pkg-config
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, libdrm
|
||||
, numactl
|
||||
, valgrind
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@ -19,24 +21,25 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-EU5toaKzVeZpdm/YhaQ0bXq0eoYwYQ5qGLUJzxgZVjE=";
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
export cmakeFlags="$cmakeFlags "
|
||||
'';
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
cmake
|
||||
rocm-cmake
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
buildInputs = [
|
||||
libdrm
|
||||
numactl
|
||||
valgrind
|
||||
];
|
||||
|
||||
buildInputs = [ libdrm numactl ];
|
||||
|
||||
# https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/issues/75
|
||||
postPatch = ''
|
||||
substituteInPlace libhsakmt.pc.in \
|
||||
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
||||
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
cp -r $src/include $out
|
||||
'';
|
||||
cmakeFlags = [
|
||||
# Manually define CMAKE_INSTALL_<DIR>
|
||||
# See: https://github.com/NixOS/nixpkgs/pull/197838
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||
];
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
@ -49,5 +52,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
|
||||
license = with licenses; [ bsd2 mit ];
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -3,17 +3,36 @@
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, clang
|
||||
, ninja
|
||||
, hip
|
||||
, rocminfo
|
||||
, git
|
||||
, libxml2
|
||||
, libedit
|
||||
, zlib
|
||||
, ncurses
|
||||
, python3
|
||||
, buildRockCompiler ? false
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
# Theoretically, we could have our MLIR have an output
|
||||
# with the source and built objects so that we can just
|
||||
# use it as the external LLVM repo for this
|
||||
let
|
||||
llvmNativeTarget =
|
||||
if stdenv.isx86_64 then "X86"
|
||||
else if stdenv.isAarch64 then "AArch64"
|
||||
else throw "Unsupported ROCm LLVM platform";
|
||||
in stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocmlir";
|
||||
version = "5.4.0";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
] ++ lib.optionals (!buildRockCompiler) [
|
||||
"external"
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ROCmSoftwarePlatform";
|
||||
repo = "rocMLIR";
|
||||
@ -23,7 +42,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
clang
|
||||
ninja
|
||||
] ++ lib.optionals (!buildRockCompiler) [
|
||||
hip
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@ -33,12 +54,39 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
python3
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_C_COMPILER=clang"
|
||||
"-DCMAKE_CXX_COMPILER=clang++"
|
||||
"-DBUILD_FAT_LIBROCKCOMPILER=ON"
|
||||
propagatedBuildInputs = [
|
||||
zlib
|
||||
ncurses
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}"
|
||||
"-DLLVM_ENABLE_ZLIB=ON"
|
||||
"-DLLVM_ENABLE_TERMINFO=ON"
|
||||
] ++ lib.optionals buildRockCompiler [
|
||||
"-DBUILD_FAT_LIBROCKCOMPILER=ON"
|
||||
] ++ lib.optionals (!buildRockCompiler) [
|
||||
"-DROCM_PATH=${rocminfo}"
|
||||
"-DROCM_TEST_CHIPSET=gfx000"
|
||||
];
|
||||
|
||||
dontBuild = true;
|
||||
doCheck = true;
|
||||
|
||||
# Certain libs aren't being generated, try enabling tests next update
|
||||
checkTarget = if buildRockCompiler
|
||||
then "librockCompiler"
|
||||
else "check-mlir-miopen-build-only";
|
||||
|
||||
postInstall = let
|
||||
libPath = lib.makeLibraryPath [ zlib ncurses hip stdenv.cc.cc ];
|
||||
in lib.optionals (!buildRockCompiler) ''
|
||||
mkdir -p $external/lib
|
||||
cp -a external/llvm-project/llvm/lib/{*.a*,*.so*} $external/lib
|
||||
patchelf --set-rpath $external/lib:$out/lib:${libPath} $external/lib/*.so*
|
||||
patchelf --set-rpath $out/lib:$external/lib:${libPath} $out/{bin/*,lib/*.so*}
|
||||
'';
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
name = finalAttrs.pname;
|
||||
owner = finalAttrs.src.owner;
|
||||
@ -52,6 +100,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://github.com/ROCmSoftwarePlatform/rocMLIR";
|
||||
license = with licenses; [ asl20 ];
|
||||
maintainers = teams.rocm.members;
|
||||
broken = finalAttrs.version != clang.version;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -4,9 +4,6 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, hip
|
||||
, gtest
|
||||
, gbenchmark
|
||||
@ -39,11 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hip
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
] ++ lib.optionals buildTests [
|
||||
buildInputs = lib.optionals buildTests [
|
||||
gtest
|
||||
] ++ lib.optionals buildBenchmarks [
|
||||
gbenchmark
|
||||
|
@ -4,9 +4,6 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, hip
|
||||
, gtest
|
||||
, gbenchmark
|
||||
@ -40,11 +37,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hip
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
] ++ lib.optionals buildTests [
|
||||
buildInputs = lib.optionals buildTests [
|
||||
gtest
|
||||
] ++ lib.optionals buildBenchmarks [
|
||||
gbenchmark
|
||||
|
@ -5,9 +5,6 @@
|
||||
, rocmUpdateScript
|
||||
, cmake
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, rocm-device-libs
|
||||
, rocm-comgr
|
||||
, rocprim
|
||||
, hip
|
||||
, gfortran
|
||||
@ -46,9 +43,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocm-runtime
|
||||
rocm-device-libs
|
||||
rocm-comgr
|
||||
rocprim
|
||||
git
|
||||
] ++ lib.optionals (buildTests || buildBenchmarks) [
|
||||
|
@ -36,5 +36,6 @@ buildPythonPackage rec {
|
||||
homepage = "https://github.com/ROCmSoftwarePlatform/Tensile";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = teams.rocm.members;
|
||||
broken = version != stdenv.cc.version;
|
||||
};
|
||||
}
|
||||
|
@ -30,5 +30,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = licenses.mit;
|
||||
maintainers = teams.rocm.members;
|
||||
platforms = platforms.unix;
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -1,13 +1,12 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rocmUpdateScript
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, rocm-runtime
|
||||
, python3
|
||||
, rocm-cmake
|
||||
, rocm-runtime
|
||||
, busybox
|
||||
, python3
|
||||
, gnugrep
|
||||
# rocminfo requires that the calling user have a password and be in
|
||||
# the video group. If we let rocm_agent_enumerator rely upon
|
||||
@ -29,25 +28,21 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
sha256 = "sha256-4wZTm5AZgG8xEd6uYqxWq4bWZgcSYZ2WYA1z4RAPF8U=";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ rocm-cmake rocm-runtime ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DROCM_DIR=${rocm-runtime}"
|
||||
"-DROCRTST_BLD_TYPE=Release"
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
rocm-cmake
|
||||
];
|
||||
|
||||
buildInputs = [ rocm-runtime ];
|
||||
propagatedBuildInputs = [ python3 ];
|
||||
cmakeFlags = [ "-DROCRTST_BLD_TYPE=Release" ];
|
||||
|
||||
prePatch = ''
|
||||
sed 's,#!/usr/bin/env python3,#!${python3}/bin/python,' -i rocm_agent_enumerator
|
||||
patchShebangs rocm_agent_enumerator
|
||||
sed 's,lsmod | grep ,${busybox}/bin/lsmod | ${gnugrep}/bin/grep ,' -i rocminfo.cc
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp rocminfo $out/bin
|
||||
cp rocm_agent_enumerator $out/bin
|
||||
'' + lib.optionalString (defaultTargets != []) ''
|
||||
postInstall = lib.optionalString (defaultTargets != [ ]) ''
|
||||
echo '${lib.concatStringsSep "\n" defaultTargets}' > $out/bin/target.lst
|
||||
'';
|
||||
|
||||
@ -63,6 +58,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = licenses.ncsa;
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
platforms = platforms.linux;
|
||||
broken = stdenv.isAarch64;
|
||||
broken = stdenv.isAarch64 || finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -37,5 +37,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
broken = finalAttrs.version != stdenv.cc.version;
|
||||
};
|
||||
})
|
||||
|
@ -15133,66 +15133,100 @@ with pkgs;
|
||||
rml = callPackage ../development/compilers/rml { };
|
||||
|
||||
composable_kernel = callPackage ../development/libraries/composable_kernel {
|
||||
inherit (llvmPackages) openmp;
|
||||
inherit (llvmPackages_rocm) openmp clang-tools-extra;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
clang-ocl = callPackage ../development/libraries/clang-ocl {
|
||||
inherit (llvmPackages_rocm) clang;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rgxg = callPackage ../tools/text/rgxg { };
|
||||
|
||||
rocclr = callPackage ../development/libraries/rocclr { };
|
||||
rocclr = callPackage ../development/libraries/rocclr {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
hip = callPackage ../development/compilers/hip {
|
||||
inherit (llvmPackages_rocm) clang llvm;
|
||||
};
|
||||
|
||||
hipcub = callPackage ../development/libraries/hipcub { };
|
||||
hipcub = callPackage ../development/libraries/hipcub {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
hipsparse = callPackage ../development/libraries/hipsparse { };
|
||||
hipsparse = callPackage ../development/libraries/hipsparse {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rccl = callPackage ../development/libraries/rccl { };
|
||||
rccl = callPackage ../development/libraries/rccl {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-cmake = callPackage ../development/tools/build-managers/rocm-cmake { };
|
||||
rocm-cmake = callPackage ../development/tools/build-managers/rocm-cmake {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-comgr = callPackage ../development/libraries/rocm-comgr {
|
||||
inherit (llvmPackages_rocm) clang llvm;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-device-libs = callPackage ../development/libraries/rocm-device-libs {
|
||||
inherit (llvmPackages_rocm) clang llvm;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-opencl-icd = callPackage ../development/libraries/rocm-opencl-icd { };
|
||||
rocm-opencl-icd = callPackage ../development/libraries/rocm-opencl-icd {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-opencl-runtime = callPackage ../development/libraries/rocm-opencl-runtime {
|
||||
inherit (llvmPackages_rocm) clang llvm;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-runtime = callPackage ../development/libraries/rocm-runtime {
|
||||
inherit (llvmPackages_rocm) llvm;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-smi = python3Packages.callPackage ../tools/system/rocm-smi { };
|
||||
rocm-smi = python3Packages.callPackage ../tools/system/rocm-smi {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocm-thunk = callPackage ../development/libraries/rocm-thunk { };
|
||||
rocm-thunk = callPackage ../development/libraries/rocm-thunk {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocminfo = callPackage ../development/tools/rocminfo { };
|
||||
rocminfo = callPackage ../development/tools/rocminfo {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocmlir = callPackage ../development/libraries/rocmlir {
|
||||
inherit (llvmPackages_rocm) clang;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocprim = callPackage ../development/libraries/rocprim { };
|
||||
rocmlir-rock = rocmlir.override {
|
||||
buildRockCompiler = true;
|
||||
};
|
||||
|
||||
rocsparse = callPackage ../development/libraries/rocsparse { };
|
||||
rocprim = callPackage ../development/libraries/rocprim {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocfft = callPackage ../development/libraries/rocfft { };
|
||||
rocsparse = callPackage ../development/libraries/rocsparse {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocrand = callPackage ../development/libraries/rocrand { };
|
||||
rocfft = callPackage ../development/libraries/rocfft {
|
||||
inherit (llvmPackages_rocm) openmp;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
tensile = python3Packages.callPackage ../development/libraries/tensile { };
|
||||
rocrand = callPackage ../development/libraries/rocrand {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
tensile = python3Packages.callPackage ../development/libraries/tensile {
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocwmma = callPackage ../development/libraries/rocwmma {
|
||||
inherit (llvmPackages) openmp;
|
||||
@ -15203,13 +15237,15 @@ with pkgs;
|
||||
};
|
||||
|
||||
miopengemm = callPackage ../development/libraries/miopengemm {
|
||||
inherit (llvmPackages_rocm) clang;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
rocthrust = callPackage ../development/libraries/rocthrust { };
|
||||
|
||||
miopen = callPackage ../development/libraries/miopen {
|
||||
inherit (llvmPackages_rocm) clang llvm;
|
||||
inherit (llvmPackages_rocm) llvm clang-tools-extra;
|
||||
stdenv = rocmClangStdenv;
|
||||
rocmlir = rocmlir-rock;
|
||||
boost = boost.override { enableStatic = true; };
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user