mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-16 01:19:22 +03:00
dcgm: 3.2.5 -> 3.3.5, etc. (#292459)
This commit is contained in:
commit
f03439c94e
@ -2,6 +2,8 @@
|
|||||||
, updateAutotoolsGnuConfigScriptsHook
|
, updateAutotoolsGnuConfigScriptsHook
|
||||||
, sslSupport ? true, openssl
|
, sslSupport ? true, openssl
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
|
|
||||||
|
, static ? stdenv.hostPlatform.isStatic
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -21,7 +23,10 @@ stdenv.mkDerivation rec {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
configureFlags = lib.optional (!sslSupport) "--disable-openssl";
|
configureFlags = lib.flatten [
|
||||||
|
(lib.optional (!sslSupport) "--disable-openssl")
|
||||||
|
(lib.optionals static ["--disable-shared" "--with-pic"])
|
||||||
|
];
|
||||||
|
|
||||||
preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
|
preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.16
|
MACOSX_DEPLOYMENT_TARGET=10.16
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, gitUpdater
|
, gitUpdater
|
||||||
, cmake
|
, cmake
|
||||||
|
, static ? stdenv.hostPlatform.isStatic
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DYAML_CPP_BUILD_TOOLS=false"
|
"-DYAML_CPP_BUILD_TOOLS=false"
|
||||||
"-DYAML_BUILD_SHARED_LIBS=${lib.boolToString (!stdenv.hostPlatform.isStatic)}"
|
(lib.cmakeBool "YAML_BUILD_SHARED_LIBS" (!static))
|
||||||
"-DINSTALL_GTEST=false"
|
"-DINSTALL_GTEST=false"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -16,18 +16,10 @@
|
|||||||
, symlinkJoin
|
, symlinkJoin
|
||||||
, tclap_1_4
|
, tclap_1_4
|
||||||
, yaml-cpp
|
, yaml-cpp
|
||||||
|
|
||||||
|
, static ? gcc11Stdenv.hostPlatform.isStatic
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# Flags copied from DCGM's libevent build script
|
|
||||||
libevent-nossl = libevent.override { sslSupport = false; };
|
|
||||||
libevent-nossl-static = libevent-nossl.overrideAttrs (super: {
|
|
||||||
CFLAGS = "-Wno-cast-function-type -Wno-implicit-fallthrough -fPIC";
|
|
||||||
CXXFLAGS = "-Wno-cast-function-type -Wno-implicit-fallthrough -fPIC";
|
|
||||||
configureFlags = super.configureFlags ++ [ "--disable-shared" "--with-pic" ];
|
|
||||||
});
|
|
||||||
|
|
||||||
jsoncpp-static = jsoncpp.override { enableStatic = true; };
|
|
||||||
|
|
||||||
# DCGM depends on 3 different versions of CUDA at the same time.
|
# DCGM depends on 3 different versions of CUDA at the same time.
|
||||||
# The runtime closure, thankfully, is quite small because most things
|
# The runtime closure, thankfully, is quite small because most things
|
||||||
# are statically linked.
|
# are statically linked.
|
||||||
@ -86,13 +78,13 @@ let
|
|||||||
# C.f. https://github.com/NVIDIA/DCGM/blob/7e1012302679e4bb7496483b32dcffb56e528c92/dcgmbuild/build.sh#L22
|
# C.f. https://github.com/NVIDIA/DCGM/blob/7e1012302679e4bb7496483b32dcffb56e528c92/dcgmbuild/build.sh#L22
|
||||||
in gcc11Stdenv.mkDerivation rec {
|
in gcc11Stdenv.mkDerivation rec {
|
||||||
pname = "dcgm";
|
pname = "dcgm";
|
||||||
version = "3.2.5"; # N.B: If you change this, be sure prometheus-dcgm-exporter supports this version.
|
version = "3.3.5"; # N.B: If you change this, be sure prometheus-dcgm-exporter supports this version.
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "NVIDIA";
|
owner = "NVIDIA";
|
||||||
repo = "DCGM";
|
repo = "DCGM";
|
||||||
rev = "refs/tags/v${version}";
|
rev = "refs/tags/v${version}";
|
||||||
hash = "sha256-iMyYOr3dSpdRV2S/TlB/tEOAWYhK09373ZRbd5vzogQ=";
|
hash = "sha256-n/uWvgvxAGfr1X51XgtHfFGDOO5AMBSV5UWQQpsylpg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Add our paths to the CUDA paths so FindCuda.cmake can find them.
|
# Add our paths to the CUDA paths so FindCuda.cmake can find them.
|
||||||
@ -117,14 +109,18 @@ in gcc11Stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
plog.dev # header-only
|
# Header-only
|
||||||
tclap_1_4 # header-only
|
|
||||||
|
|
||||||
catch2
|
catch2
|
||||||
fmt_9
|
plog.dev
|
||||||
jsoncpp-static
|
tclap_1_4
|
||||||
libevent-nossl-static
|
|
||||||
yaml-cpp
|
# Dependencies that can be either static or dynamic.
|
||||||
|
(fmt_9.override { enableShared = !static; }) # DCGM's build uses the static outputs regardless of enableShared
|
||||||
|
(yaml-cpp.override { inherit static; stdenv = gcc11Stdenv; })
|
||||||
|
|
||||||
|
# TODO: Dependencies that DCGM's CMake hard-codes to be static-only.
|
||||||
|
(jsoncpp.override { enableStatic = true; })
|
||||||
|
(libevent.override { sslSupport = false; static = true; })
|
||||||
];
|
];
|
||||||
|
|
||||||
disallowedReferences = lib.concatMap (x: x.pkgSet) cudaPackageSetByVersion;
|
disallowedReferences = lib.concatMap (x: x.pkgSet) cudaPackageSetByVersion;
|
||||||
|
@ -3,31 +3,19 @@
|
|||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, autoAddDriverRunpath
|
, autoAddDriverRunpath
|
||||||
, dcgm
|
, dcgm
|
||||||
, linuxPackages
|
|
||||||
}:
|
}:
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "dcgm-exporter";
|
pname = "dcgm-exporter";
|
||||||
|
|
||||||
# The first portion of this version string corresponds to a compatible DCGM
|
# The first portion of this version string corresponds to a compatible DCGM
|
||||||
# version.
|
# version.
|
||||||
version = "3.2.5-3.1.7"; # N.B: If you change this, update dcgm as well to the matching version.
|
version = "3.3.5-3.4.0"; # N.B: If you change this, update dcgm as well to the matching version.
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "NVIDIA";
|
owner = "NVIDIA";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "refs/tags/${version}";
|
rev = "refs/tags/${version}";
|
||||||
hash = "sha256-+Hviq+iu1LBcy2VwmCX5xOq1I/zevfydesVlrVorGOI=";
|
hash = "sha256-IOVPEK+9ogBZJYns2pTyJwHUBMN8JqG1THTJPvpCwdo=";
|
||||||
};
|
|
||||||
|
|
||||||
# Upgrade to go 1.17 during the vendoring FOD build because it fails otherwise.
|
|
||||||
overrideModAttrs = _: {
|
|
||||||
preBuild = ''
|
|
||||||
substituteInPlace go.mod --replace 'go 1.16' 'go 1.17'
|
|
||||||
go mod tidy
|
|
||||||
'';
|
|
||||||
postInstall = ''
|
|
||||||
cp go.mod "$out/go.mod"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CGO_LDFLAGS = "-ldcgm";
|
CGO_LDFLAGS = "-ldcgm";
|
||||||
@ -40,12 +28,7 @@ buildGoModule rec {
|
|||||||
# symbols are available on startup.
|
# symbols are available on startup.
|
||||||
hardeningDisable = [ "bindnow" ];
|
hardeningDisable = [ "bindnow" ];
|
||||||
|
|
||||||
# Copy the modified go.mod we got from the vendoring process.
|
vendorHash = "sha256-urKa0O8QZnM8cWjPcGVhoAWhx6fCdMmhRX0JOriRaig=";
|
||||||
preBuild = ''
|
|
||||||
cp vendor/go.mod go.mod
|
|
||||||
'';
|
|
||||||
|
|
||||||
vendorHash = "sha256-Fjvx15e/psxoqoS6c6GhiQfe7g2aI40EmPR26xLhrzg=";
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoAddDriverRunpath
|
autoAddDriverRunpath
|
||||||
|
Loading…
Reference in New Issue
Block a user