caffe: depend on opencv3
openblas is used since it's propagated from OpenCV and ATLAS compiled without architecture-specific optimizations is generally slower than OpenBLAS as I heard.
This commit is contained in:
parent
1bfca90bf7
commit
25079ad238
|
@ -7,11 +7,11 @@
|
||||||
, hdf5-cpp
|
, hdf5-cpp
|
||||||
, leveldb
|
, leveldb
|
||||||
, lmdb
|
, lmdb
|
||||||
, opencv
|
, opencv3
|
||||||
, protobuf
|
, protobuf
|
||||||
, snappy
|
, snappy
|
||||||
, atlas
|
|
||||||
, doxygen
|
, doxygen
|
||||||
|
, openblas
|
||||||
, cudaSupport ? true, cudatoolkit
|
, cudaSupport ? true, cudatoolkit
|
||||||
, cudnnSupport ? false, cudnn ? null
|
, cudnnSupport ? false, cudnn ? null
|
||||||
, pythonSupport ? false, python ? null, numpy ? null
|
, pythonSupport ? false, python ? null, numpy ? null
|
||||||
|
@ -35,12 +35,15 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake doxygen ];
|
nativeBuildInputs = [ cmake doxygen ];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags =
|
||||||
"-DCUDA_ARCH_NAME=All"
|
[ (if pythonSupport then "-Dpython_version=${python.version}" else "-DBUILD_python=OFF")
|
||||||
(if pythonSupport then "-Dpython_version=${python.version}" else "-DBUILD_python=OFF")
|
"-DBLAS=open"
|
||||||
] ++ lib.optional (!cudaSupport) "-DCPU_ONLY=ON";
|
] ++ (if cudaSupport then [
|
||||||
|
"-DCUDA_ARCH_NAME=All"
|
||||||
|
"-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
|
||||||
|
] else [ "-DCPU_ONLY=ON" ]);
|
||||||
|
|
||||||
buildInputs = [ boost google-gflags glog protobuf hdf5-cpp lmdb leveldb snappy opencv atlas ]
|
buildInputs = [ boost google-gflags glog protobuf hdf5-cpp lmdb leveldb snappy opencv3 openblas ]
|
||||||
++ lib.optional cudaSupport cudatoolkit
|
++ lib.optional cudaSupport cudatoolkit
|
||||||
++ lib.optional cudnnSupport cudnn
|
++ lib.optional cudnnSupport cudnn
|
||||||
++ lib.optionals pythonSupport [ python numpy ];
|
++ lib.optionals pythonSupport [ python numpy ];
|
||||||
|
|
|
@ -19737,6 +19737,10 @@ with pkgs;
|
||||||
caffe = callPackage ../applications/science/math/caffe rec {
|
caffe = callPackage ../applications/science/math/caffe rec {
|
||||||
cudaSupport = config.caffe.cudaSupport or config.cudaSupport or false;
|
cudaSupport = config.caffe.cudaSupport or config.cudaSupport or false;
|
||||||
cudnnSupport = cudaSupport;
|
cudnnSupport = cudaSupport;
|
||||||
|
# Used only for image loading.
|
||||||
|
opencv3 = self.opencv3.override {
|
||||||
|
enableCuda = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
caffe2 = callPackage ../development/libraries/science/math/caffe2 {
|
caffe2 = callPackage ../development/libraries/science/math/caffe2 {
|
||||||
|
|
Loading…
Reference in New Issue