Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, makeWrapper
4, fetchurl
5, autoPatchelfHook
6, dbus
7, fontconfig
8, freetype
9, glib
10, libdrm
11, libGLU
12, libglvnd
13, libICE
14, libkrb5
15, libSM
16, libX11
17, libxcb
18, libXi
19, libxkbcommon
20, ncurses
21, zlib
22}:
23
24let
25 buildNum = "2024-04-18-1396";
26in
27stdenv.mkDerivation {
28 pname = "rgp";
29 version = "2.1";
30
31 src = fetchurl {
32 url = "https://gpuopen.com/download/radeon-developer-tool-suite/RadeonDeveloperToolSuite-${buildNum}.tgz";
33 hash = "sha256-mP5tmq252IsWYVRGNKVib8ZbM5M4srUKXJ3x2ff4YhM=";
34 };
35
36 nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
37
38 buildInputs = [
39 dbus
40 fontconfig
41 freetype
42 glib
43 libdrm
44 libGLU
45 libglvnd
46 libICE
47 libkrb5
48 libSM
49 libX11
50 libxcb
51 libXi
52 libxkbcommon
53 ncurses
54 zlib
55 ];
56
57 installPhase = ''
58 mkdir -p $out/opt/rgp $out/bin
59 cp -r . $out/opt/rgp/
60
61 chmod +x $out/opt/rgp/scripts/*
62 patchShebangs $out/opt/rgp/scripts
63
64 for prog in RadeonDeveloperPanel RadeonDeveloperService RadeonDeveloperServiceCLI RadeonGPUAnalyzer RadeonGPUProfiler RadeonMemoryVisualizer RadeonRaytracingAnalyzer rga rtda; do
65 # makeWrapper is needed so that executables are started from the opt
66 # directory, where qt.conf and other tools are.
67 # Unset Qt theme, it does not work if the nixos Qt version is different from the packaged one.
68 # The packaged Qt version only supports X11, so enforce that.
69 makeWrapper \
70 $out/opt/rgp/$prog \
71 $out/bin/$prog \
72 --unset QT_QPA_PLATFORMTHEME \
73 --unset QT_STYLE_OVERRIDE \
74 --set QT_QPA_PLATFORM xcb \
75 --prefix LD_LIBRARY_PATH : $out/opt/rgp/lib
76 done
77 '';
78
79 meta = with lib; {
80 description = "Tool from AMD that allows for deep inspection of GPU workloads";
81 homepage = "https://gpuopen.com/rgp/";
82 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
83 license = licenses.unfree;
84 platforms = [ "x86_64-linux" ];
85 maintainers = with maintainers; [ Flakebi ];
86 };
87}