2023-03-24 00:07:29 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl
|
|
|
|
, rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config
|
2023-08-04 22:07:22 +00:00
|
|
|
, config
|
2024-04-21 15:54:59 +00:00
|
|
|
, autoAddDriverRunpath
|
2023-08-04 22:07:22 +00:00
|
|
|
, enableCuda ? config.cudaSupport
|
2024-01-02 11:29:13 +00:00
|
|
|
, cudaPackages
|
2023-11-16 04:20:00 +00:00
|
|
|
, enableRocm ? config.rocmSupport
|
2023-10-19 13:55:26 +00:00
|
|
|
, rocmPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2023-10-19 13:55:26 +00:00
|
|
|
rocmList = with rocmPackages; [ rocm-core rocm-runtime rocm-device-libs clr ];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
rocm = symlinkJoin {
|
|
|
|
name = "rocm";
|
2023-10-19 13:55:26 +00:00
|
|
|
paths = rocmList;
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "ucx";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.17.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openucx";
|
|
|
|
repo = "ucx";
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
sha256 = "sha256-Qd3c51LeF04haZA4wK6loNZwX2a3ju+ljwdPYPoUKCQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
outputs = [ "out" "doc" "dev" ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
doxygen
|
|
|
|
pkg-config
|
|
|
|
]
|
|
|
|
++ lib.optionals enableCuda [
|
|
|
|
cudaPackages.cuda_nvcc
|
2024-04-21 15:54:59 +00:00
|
|
|
autoAddDriverRunpath
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [
|
|
|
|
libbfd
|
|
|
|
libiberty
|
|
|
|
numactl
|
|
|
|
perl
|
|
|
|
rdma-core
|
|
|
|
zlib
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.optionals enableCuda [
|
|
|
|
cudaPackages.cuda_cudart
|
|
|
|
cudaPackages.cuda_nvml_dev
|
|
|
|
|
|
|
|
] ++ lib.optionals enableRocm rocmList;
|
|
|
|
|
|
|
|
LDFLAGS = lib.optionals enableCuda [
|
|
|
|
# Fake libnvidia-ml.so (the real one is deployed impurely)
|
2024-07-27 06:49:29 +00:00
|
|
|
"-L${lib.getLib cudaPackages.cuda_nvml_dev}/lib/stubs"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2023-10-09 19:29:22 +00:00
|
|
|
"--with-rdmacm=${lib.getDev rdma-core}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-dc"
|
|
|
|
"--with-rc"
|
|
|
|
"--with-dm"
|
2023-10-09 19:29:22 +00:00
|
|
|
"--with-verbs=${lib.getDev rdma-core}"
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.optionals enableCuda [ "--with-cuda=${cudaPackages.cuda_cudart}" ]
|
2023-03-24 00:07:29 +00:00
|
|
|
++ lib.optional enableRocm "--with-rocm=${rocm}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
postInstall = ''
|
|
|
|
find $out/lib/ -name "*.la" -exec rm -f \{} \;
|
|
|
|
|
|
|
|
moveToOutput bin/ucx_info $dev
|
|
|
|
|
|
|
|
moveToOutput share/ucx/examples $doc
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Unified Communication X library";
|
2023-02-22 10:55:15 +00:00
|
|
|
homepage = "https://www.openucx.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.markuskowa ];
|
|
|
|
};
|
|
|
|
}
|