mxnet: remove cuda support (#382891)

This commit is contained in:
Pavol Rusnak
2025-02-28 21:45:49 +01:00
committed by GitHub
3 changed files with 16 additions and 52 deletions
@@ -12,22 +12,15 @@
gomp,
llvmPackages,
perl,
# mxnet cuda support is turned off, but dependencies like opencv can still be built with cudaSupport
# and fail to compile without the cudatoolkit
# mxnet cuda support will not be availaible, as mxnet requires version <=11
cudaSupport ? config.cudaSupport,
cudaPackages ? { },
nvidia_x11,
cudnnSupport ? cudaSupport,
}:
let
inherit (cudaPackages)
backendStdenv
cudatoolkit
cudaFlags
cudnn
;
in
assert cudnnSupport -> cudaSupport;
# mxnet is not maintained, and other projects are migrating away from it.
# https://github.com/apache/mxnet/issues/21206
stdenv.mkDerivation rec {
pname = "mxnet";
@@ -67,27 +60,16 @@ stdenv.mkDerivation rec {
]
++ lib.optional stdenv.cc.isGNU gomp
++ lib.optional stdenv.cc.isClang llvmPackages.openmp
# FIXME: when cuda build is fixed, remove nvidia_x11, and use /run/opengl-driver/lib
++ lib.optionals cudaSupport [
cudatoolkit
nvidia_x11
]
++ lib.optional cudnnSupport cudnn;
# needed for OpenCV cmake module
cudaPackages.cudatoolkit
];
cmakeFlags =
[ "-DUSE_MKL_IF_AVAILABLE=OFF" ]
++ (
if cudaSupport then
[
"-DUSE_OLDCMAKECUDA=ON" # see https://github.com/apache/incubator-mxnet/issues/10743
"-DCUDA_ARCH_NAME=All"
"-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc"
"-DMXNET_CUDA_ARCH=${builtins.concatStringsSep ";" cudaFlags.realArches}"
]
else
[ "-DUSE_CUDA=OFF" ]
)
++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
cmakeFlags = [
"-DUSE_MKL_IF_AVAILABLE=OFF"
"-DUSE_CUDA=OFF"
"-DUSE_CUDNN=OFF"
];
env.NIX_CFLAGS_COMPILE = toString [
# Needed with GCC 12
@@ -107,24 +89,11 @@ stdenv.mkDerivation rec {
rm "$out"/lib/*.a
'';
# used to mark cudaSupport in python310Packages.mxnet as broken;
# other attributes exposed for consistency
passthru = {
inherit
cudaSupport
cudnnSupport
cudatoolkit
cudnn
;
};
meta = with lib; {
description = "Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler";
homepage = "https://mxnet.incubator.apache.org/";
maintainers = with maintainers; [ abbradar ];
license = licenses.asl20;
platforms = platforms.unix;
# Build failures when linking mxnet_unit_tests: https://gist.github.com/6d17447ee3557967ec52c50d93b17a1d
broken = cudaSupport;
platforms = platforms.linux;
};
}
@@ -9,7 +9,6 @@
graphviz,
python,
isPy3k,
isPy310,
}:
buildPythonPackage {
@@ -51,7 +50,5 @@ buildPythonPackage {
ln -s ${pkgs.mxnet}/lib/libmxnet.so $out/${python.sitePackages}/mxnet
'';
meta = pkgs.mxnet.meta // {
broken = (pkgs.mxnet.broken or false) || (isPy310 && pkgs.mxnet.cudaSupport);
};
meta = pkgs.mxnet.meta;
}
+1 -3
View File
@@ -17228,9 +17228,7 @@ with pkgs;
lisp-compiler = ecl;
};
mxnet = callPackage ../applications/science/math/mxnet {
inherit (linuxPackages) nvidia_x11;
};
mxnet = callPackage ../applications/science/math/mxnet { };
wxmaxima = callPackage ../applications/science/math/wxmaxima {
wxGTK = wxGTK32.override {