Theano: fix broken compiler; Add nvidia_x11 as dependency when cudaSupport
This commit is contained in:
parent
6d8bf113bd
commit
e0cf582493
@ -15,17 +15,24 @@
|
|||||||
, libgpuarray
|
, libgpuarray
|
||||||
, cudaSupport ? false, cudatoolkit
|
, cudaSupport ? false, cudatoolkit
|
||||||
, cudnnSupport ? false, cudnn
|
, cudnnSupport ? false, cudnn
|
||||||
|
, nvidia_x11
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert cudnnSupport -> cudaSupport;
|
assert cudnnSupport -> cudaSupport;
|
||||||
|
|
||||||
|
assert cudaSupport -> nvidia_x11 != null
|
||||||
|
&& cudatoolkit != null
|
||||||
|
&& cudnn != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
extraFlags =
|
extraFlags =
|
||||||
lib.optionals cudaSupport [ "-I ${cudatoolkit}/include" "-L ${cudatoolkit}/lib" ]
|
lib.optionals cudaSupport [ "-I ${cudatoolkit}/include" "-L ${cudatoolkit}/lib" ]
|
||||||
++ lib.optionals cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ];
|
++ lib.optionals cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ]
|
||||||
|
++ lib.optionals cudaSupport [ "-I ${libgpuarray}/include" "-L ${libgpuarray}/lib" ];
|
||||||
|
|
||||||
gcc_ = writeScriptBin "g++" ''
|
gcc_ = writeScriptBin "g++" ''
|
||||||
#!${stdenv.shell}
|
#!${stdenv.shell}
|
||||||
|
export NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST=1
|
||||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${toString extraFlags}"
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${toString extraFlags}"
|
||||||
exec ${gcc}/bin/g++ "$@"
|
exec ${gcc}/bin/g++ "$@"
|
||||||
'';
|
'';
|
||||||
|
@ -12986,6 +12986,7 @@ in {
|
|||||||
Theano = callPackage ../development/python-modules/Theano rec {
|
Theano = callPackage ../development/python-modules/Theano rec {
|
||||||
cudaSupport = pkgs.config.cudaSupport or false;
|
cudaSupport = pkgs.config.cudaSupport or false;
|
||||||
cudnnSupport = cudaSupport;
|
cudnnSupport = cudaSupport;
|
||||||
|
inherit (pkgs.linuxPackages) nvidia_x11;
|
||||||
};
|
};
|
||||||
|
|
||||||
TheanoWithoutCuda = self.Theano.override {
|
TheanoWithoutCuda = self.Theano.override {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user