fix: torch for mac - no cuda on mac

This commit is contained in:
Jonathan Boyle 2024-08-15 15:31:19 +01:00
parent 3fd4c14d36
commit 217de5cf91

View File

@ -9,12 +9,14 @@
# use the autoAddOpenGLRunpathHook to add /run/opengl-driver/lib to the RPATH # use the autoAddOpenGLRunpathHook to add /run/opengl-driver/lib to the RPATH
# of all ELF files # of all ELF files
deps = {nixpkgs, ...}: { 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 config.deps.autoAddOpenGLRunpathHook
]; ];
# this file is patched manually, so ignore it in autoPatchelf # 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"];
} }