nixpkgs/pkgs/development/rocm-modules/5/rocprofiler/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

137 lines
3.1 KiB
Nix
Raw Normal View History

2022-12-16 09:27:28 +00:00
{ lib
, stdenv
, fetchFromGitHub
, rocmUpdateScript
, symlinkJoin
, substituteAll
2022-12-16 09:27:28 +00:00
, cmake
, clang
, clr
, rocm-core
2022-12-16 09:27:28 +00:00
, rocm-thunk
, rocm-device-libs
2022-12-16 09:27:28 +00:00
, roctracer
, rocdbgapi
, rocm-smi
, hsa-amd-aqlprofile-bin
2022-12-16 09:27:28 +00:00
, numactl
, libpciaccess
, libxml2
, elfutils
, mpi
, systemd
, gtest
, python3Packages
, gpuTargets ? clr.gpuTargets
2022-12-16 09:27:28 +00:00
}:
let
rocmtoolkit-merged = symlinkJoin {
name = "rocmtoolkit-merged";
paths = [
rocm-core
rocm-thunk
rocm-device-libs
roctracer
rocdbgapi
rocm-smi
hsa-amd-aqlprofile-bin
clr
];
postBuild = ''
rm -rf $out/nix-support
'';
};
in stdenv.mkDerivation (finalAttrs: {
2022-12-16 09:27:28 +00:00
pname = "rocprofiler";
rocmPackages: 5.7.0 -> 5.7.1 rocmPackages.clang-ocl: 5.7.0 -> 5.7.1 rocmPackages.hip-common: 5.7.0 -> 5.7.1 rocmPackages.half: 5.7.0 -> 5.7.1 rocmPackages.hipcc: 5.7.0 -> 5.7.1 rocmPackages.hipcub: 5.7.0 -> 5.7.1 rocmPackages.hipfft: 5.7.0 -> 5.7.1 rocmPackages.composable_kernel: 5.7.0 -> 5.7.1 rocmPackages.hipblas: 5.7.0 -> 5.7.1 rocmPackages.hiprand: 5.7.0 -> 5.7.1 rocmPackages.hipsolver: 5.7.0 -> 5.7.1 rocmPackages.hipsparse: 5.7.0 -> 5.7.1 rocmPackages.llvm.llvm: 5.7.0 -> 5.7.1 rocmPackages.migraphx: 5.7.0 -> 5.7.1 rocmPackages.hipfort: 5.7.0 -> 5.7.1 rocmPackages.miopen: 5.7.0 -> 5.7.1 rocmPackages.mivisionx: 5.7.0 -> 5.7.1 rocmPackages.hipify: 5.7.0 -> 5.7.1 rocmPackages.rocalution: 5.7.0 -> 5.7.1 rocmPackages.rocblas: 5.7.0 -> 5.7.1 rocmPackages.rdc: 5.7.0 -> 5.7.1 rocmPackages.rocfft: 5.7.0 -> 5.7.1 rocmPackages.rocgdb: 5.7.0 -> 5.7.1 rocmPackages.rccl: 5.7.0 -> 5.7.1 rocmPackages.rocm-comgr: 5.7.0 -> 5.7.1 rocmPackages.rocm-cmake: 5.7.0 -> 5.7.1 rocmPackages.rocm-device-libs: 5.7.0 -> 5.7.1 rocmPackages.rocm-runtime: 5.7.0 -> 5.7.1 rocmPackages.rocm-smi: 5.7.0 -> 5.7.1 rocmPackages.rocm-thunk: 5.7.0 -> 5.7.1 rocmPackages.rocminfo: 5.7.0 -> 5.7.1 rocmPackages.rocmlir: 5.7.0 -> 5.7.1 rocmPackages.rocdbgapi: 5.7.0 -> 5.7.1 rocmPackages.rocprim: 5.7.0 -> 5.7.1 rocmPackages.rocr-debug-agent: 5.7.0 -> 5.7.1 rocmPackages.rocsolver: 5.7.0 -> 5.7.1 rocmPackages.rocm-docs-core: 0.25.0 -> 0.26.0 rocmPackages.rocthrust: 5.7.0 -> 5.7.1 rocmPackages.rocprofiler: 5.7.0 -> 5.7.1 rocmPackages.roctracer: 5.7.0 -> 5.7.1 rocmPackages.rocsparse: 5.7.0 -> 5.7.1 rocmPackages.rpp: 5.7.0 -> 5.7.1 rocmPackages.tensile: 5.7.0 -> 5.7.1 rocmPackages.rocwmma: 5.7.0 -> 5.7.1 rocmPackages.clr: 5.7.0 -> 5.7.1
2023-10-17 05:53:19 +00:00
version = "5.7.1";
2022-12-16 09:27:28 +00:00
src = fetchFromGitHub {
owner = "ROCm";
2022-12-16 09:27:28 +00:00
repo = "rocprofiler";
rev = "rocm-${finalAttrs.version}";
rocmPackages: 5.7.0 -> 5.7.1 rocmPackages.clang-ocl: 5.7.0 -> 5.7.1 rocmPackages.hip-common: 5.7.0 -> 5.7.1 rocmPackages.half: 5.7.0 -> 5.7.1 rocmPackages.hipcc: 5.7.0 -> 5.7.1 rocmPackages.hipcub: 5.7.0 -> 5.7.1 rocmPackages.hipfft: 5.7.0 -> 5.7.1 rocmPackages.composable_kernel: 5.7.0 -> 5.7.1 rocmPackages.hipblas: 5.7.0 -> 5.7.1 rocmPackages.hiprand: 5.7.0 -> 5.7.1 rocmPackages.hipsolver: 5.7.0 -> 5.7.1 rocmPackages.hipsparse: 5.7.0 -> 5.7.1 rocmPackages.llvm.llvm: 5.7.0 -> 5.7.1 rocmPackages.migraphx: 5.7.0 -> 5.7.1 rocmPackages.hipfort: 5.7.0 -> 5.7.1 rocmPackages.miopen: 5.7.0 -> 5.7.1 rocmPackages.mivisionx: 5.7.0 -> 5.7.1 rocmPackages.hipify: 5.7.0 -> 5.7.1 rocmPackages.rocalution: 5.7.0 -> 5.7.1 rocmPackages.rocblas: 5.7.0 -> 5.7.1 rocmPackages.rdc: 5.7.0 -> 5.7.1 rocmPackages.rocfft: 5.7.0 -> 5.7.1 rocmPackages.rocgdb: 5.7.0 -> 5.7.1 rocmPackages.rccl: 5.7.0 -> 5.7.1 rocmPackages.rocm-comgr: 5.7.0 -> 5.7.1 rocmPackages.rocm-cmake: 5.7.0 -> 5.7.1 rocmPackages.rocm-device-libs: 5.7.0 -> 5.7.1 rocmPackages.rocm-runtime: 5.7.0 -> 5.7.1 rocmPackages.rocm-smi: 5.7.0 -> 5.7.1 rocmPackages.rocm-thunk: 5.7.0 -> 5.7.1 rocmPackages.rocminfo: 5.7.0 -> 5.7.1 rocmPackages.rocmlir: 5.7.0 -> 5.7.1 rocmPackages.rocdbgapi: 5.7.0 -> 5.7.1 rocmPackages.rocprim: 5.7.0 -> 5.7.1 rocmPackages.rocr-debug-agent: 5.7.0 -> 5.7.1 rocmPackages.rocsolver: 5.7.0 -> 5.7.1 rocmPackages.rocm-docs-core: 0.25.0 -> 0.26.0 rocmPackages.rocthrust: 5.7.0 -> 5.7.1 rocmPackages.rocprofiler: 5.7.0 -> 5.7.1 rocmPackages.roctracer: 5.7.0 -> 5.7.1 rocmPackages.rocsparse: 5.7.0 -> 5.7.1 rocmPackages.rpp: 5.7.0 -> 5.7.1 rocmPackages.tensile: 5.7.0 -> 5.7.1 rocmPackages.rocwmma: 5.7.0 -> 5.7.1 rocmPackages.clr: 5.7.0 -> 5.7.1
2023-10-17 05:53:19 +00:00
hash = "sha256-1s/7C9y+73ADLF/17Vepw0pZNVtYnKoP24GdwKc9X2Y=";
2022-12-16 09:27:28 +00:00
};
patches = [
# These just simply won't build
./0000-dont-install-tests-hsaco.patch
# Fix bad paths
(substituteAll {
src = ./0001-fix-shell-scripts.patch;
rocmtoolkit_merged = rocmtoolkit-merged;
})
];
nativeBuildInputs = [
cmake
clang
clr
python3Packages.lxml
python3Packages.cppheaderparser
python3Packages.pyyaml
python3Packages.barectf
];
2022-12-16 09:27:28 +00:00
buildInputs = [
numactl
libpciaccess
libxml2
elfutils
mpi
systemd
gtest
2022-12-16 09:27:28 +00:00
];
propagatedBuildInputs = [ rocmtoolkit-merged ];
2022-12-16 09:27:28 +00:00
cmakeFlags = [
"-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip"
"-DHIP_ROOT_DIR=${clr}"
"-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
2022-12-16 09:27:28 +00:00
# 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"
];
postPatch = ''
patchShebangs .
2022-12-16 09:27:28 +00:00
substituteInPlace tests-v2/featuretests/profiler/CMakeLists.txt \
--replace "--build-id=sha1" "--build-id=sha1 --rocm-path=${clr} --rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode"
substituteInPlace test/CMakeLists.txt \
--replace "\''${ROCM_ROOT_DIR}/amdgcn/bitcode" "${rocm-device-libs}/amdgcn/bitcode"
2022-12-16 09:27:28 +00:00
'';
postInstall = ''
# Why do these not already have the executable bit set?
chmod +x $out/lib/rocprofiler/librocprof-tool.so
chmod +x $out/share/rocprofiler/tests-v1/test/ocl/SimpleConvolution
# Why do these have the executable bit set?
chmod -x $out/libexec/rocprofiler/counters/basic_counters.xml
chmod -x $out/libexec/rocprofiler/counters/derived_counters.xml
2022-12-16 09:27:28 +00:00
'';
passthru.updateScript = rocmUpdateScript {
name = finalAttrs.pname;
owner = finalAttrs.src.owner;
repo = finalAttrs.src.repo;
};
meta = with lib; {
description = "Profiling with perf-counters and derived metrics";
homepage = "https://github.com/ROCm/rocprofiler";
2022-12-16 09:27:28 +00:00
license = with licenses; [ mit ]; # mitx11
maintainers = teams.rocm.members;
2023-01-18 08:25:46 +00:00
platforms = platforms.linux;
broken = versions.minor finalAttrs.version != versions.minor clr.version || versionAtLeast finalAttrs.version "6.0.0";
2022-12-16 09:27:28 +00:00
};
})