mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Merge pull request #286 from tfmoraes/torchvision
Add override to torchvision and a change to torch override
This commit is contained in:
commit
f0dde911f6
1 changed files with 23 additions and 0 deletions
|
@ -1454,11 +1454,34 @@ self: super:
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
self.numpy
|
self.numpy
|
||||||
self.future
|
self.future
|
||||||
|
self.typing-extensions
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
|
torchvision = lib.makeOverridable
|
||||||
|
({ enableCuda ? false
|
||||||
|
, cudatoolkit ? pkgs.cudatoolkit_10_1
|
||||||
|
, pkg ? super.torchvision
|
||||||
|
}: pkg.overrideAttrs (old: {
|
||||||
|
|
||||||
|
# without that autoPatchelfHook will fail because cudatoolkit is not in LD_LIBRARY_PATH
|
||||||
|
autoPatchelfIgnoreMissingDeps = true;
|
||||||
|
buildInputs = (old.buildInputs or [ ])
|
||||||
|
++ [ self.torch ]
|
||||||
|
++ lib.optionals enableCuda [
|
||||||
|
cudatoolkit
|
||||||
|
];
|
||||||
|
preConfigure =
|
||||||
|
if (enableCuda) then ''
|
||||||
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib:${lib.makeLibraryPath [ cudatoolkit "${cudatoolkit}" ]}"
|
||||||
|
'' else ''
|
||||||
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib"
|
||||||
|
'';
|
||||||
|
}))
|
||||||
|
{ };
|
||||||
|
|
||||||
typeguard = super.typeguard.overridePythonAttrs (old: {
|
typeguard = super.typeguard.overridePythonAttrs (old: {
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace setup.py \
|
substituteInPlace setup.py \
|
||||||
|
|
Loading…
Add table
Reference in a new issue