Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: python torch override for mac - no cuda on mac #1036

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions overrides/python/torch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think lib.optionalAttribute is a thing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how I messed that up! I will look into and fix.

};
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"];
}