From 217de5cf91fec4838643f0e0b35ff4289c15eb12 Mon Sep 17 00:00:00 2001 From: Jonathan Boyle Date: Thu, 15 Aug 2024 15:31:19 +0100 Subject: [PATCH] fix: torch for mac - no cuda on mac --- overrides/python/torch/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/overrides/python/torch/default.nix b/overrides/python/torch/default.nix index 97676fd378..de37ad7b20 100644 --- a/overrides/python/torch/default.nix +++ b/overrides/python/torch/default.nix @@ -9,12 +9,14 @@ # use the autoAddOpenGLRunpathHook to add /run/opengl-driver/lib to the RPATH # of all ELF files deps = {nixpkgs, ...}: { - inherit (nixpkgs.cudaPackages) autoAddOpenGLRunpathHook; + inherit (nixpkgs.stdenv) isLinux; + autoAddOpenGLRunpathHook = lib.optionalAttribute nixpkgs.stdenv.isLinux nixpkgs.cudaPackages.autoAddOpenGLRunpathHook; }; - mkDerivation.nativeBuildInputs = [ + + mkDerivation.nativeBuildInputs = lib.mkIf config.deps.isLinux [ config.deps.autoAddOpenGLRunpathHook ]; # this file is patched manually, so ignore it in autoPatchelf - env.autoPatchelfIgnoreMissingDeps = ["libcuda.so.1"]; + env.autoPatchelfIgnoreMissingDeps = lib.mkIf config.deps.isLinux ["libcuda.so.1"]; }