9 pname = "dcgm-exporter";
11 # The first portion of this version string corresponds to a compatible DCGM
13 version = "3.2.5-3.1.7"; # N.B: If you change this, update dcgm as well to the matching version.
15 src = fetchFromGitHub {
18 rev = "refs/tags/${version}";
19 hash = "sha256-+Hviq+iu1LBcy2VwmCX5xOq1I/zevfydesVlrVorGOI=";
22 # Upgrade to go 1.17 during the vendoring FOD build because it fails otherwise.
23 overrideModAttrs = _: {
25 substituteInPlace go.mod --replace 'go 1.16' 'go 1.17'
29 cp go.mod "$out/go.mod"
33 CGO_LDFLAGS = "-ldcgm";
39 # gonvml and go-dcgm do not work with ELF BIND_NOW hardening because not all
40 # symbols are available on startup.
41 hardeningDisable = [ "bindnow" ];
43 # Copy the modified go.mod we got from the vendoring process.
45 cp vendor/go.mod go.mod
48 vendorHash = "sha256-Fjvx15e/psxoqoS6c6GhiQfe7g2aI40EmPR26xLhrzg=";
54 # Tests try to interact with running DCGM service.
58 patchelf --add-needed libnvidia-ml.so "$out/bin/dcgm-exporter"
62 description = "NVIDIA GPU metrics exporter for Prometheus leveraging DCGM";
63 homepage = "https://github.com/NVIDIA/dcgm-exporter";
64 license = licenses.asl20;
65 maintainers = teams.deshaw.members;
66 mainProgram = "dcgm-exporter";
67 platforms = platforms.linux;