Skip to content

Commit

Permalink
ucx: fix the cudaPackages_12 variant; drop the cudatoolkit runfile de…
Browse files Browse the repository at this point in the history
…pendency
  • Loading branch information
SomeoneSerge committed Dec 4, 2023
1 parent ee10810 commit 58819d6
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions pkgs/development/libraries/ucx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
, rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config
, config
, enableCuda ? config.cudaSupport
, cudatoolkit
, cudaPackages
, enableRocm ? config.rocmSupport
, rocmPackages
}:

let
# Needed for configure to find all libraries
cudatoolkit' = symlinkJoin {
inherit (cudatoolkit) name meta;
paths = [ cudatoolkit cudatoolkit.lib ];
};

rocmList = with rocmPackages; [ rocm-core rocm-runtime rocm-device-libs clr ];

rocm = symlinkJoin {
Expand All @@ -35,7 +29,15 @@ stdenv.mkDerivation rec {

outputs = [ "out" "doc" "dev" ];

nativeBuildInputs = [ autoreconfHook doxygen pkg-config ];
nativeBuildInputs = [
autoreconfHook
doxygen
pkg-config
]
++ lib.optionals enableCuda [
cudaPackages.cuda_nvcc
cudaPackages.autoAddOpenGLRunpathHook
];

buildInputs = [
libbfd
Expand All @@ -44,16 +46,24 @@ stdenv.mkDerivation rec {
perl
rdma-core
zlib
] ++ lib.optional enableCuda cudatoolkit
++ lib.optionals enableRocm rocmList;
] ++ 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)
"-L${cudaPackages.cuda_nvml_dev}/lib/stubs"
];

configureFlags = [
"--with-rdmacm=${lib.getDev rdma-core}"
"--with-dc"
"--with-rc"
"--with-dm"
"--with-verbs=${lib.getDev rdma-core}"
] ++ lib.optional enableCuda "--with-cuda=${cudatoolkit'}"
] ++ lib.optionals enableCuda [ "--with-cuda=${cudaPackages.cuda_cudart}" ]
++ lib.optional enableRocm "--with-rocm=${rocm}";

postInstall = ''
Expand Down

0 comments on commit 58819d6

Please sign in to comment.