Skip to content

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

Draft
JonBoyleCoding wants to merge 1 commit into
nix-community:mainfrom
JonBoyleCoding:torch-mac-fix
Draft

fix: python torch override for mac - no cuda on mac#1036
JonBoyleCoding wants to merge 1 commit into
nix-community:mainfrom
JonBoyleCoding:torch-mac-fix

Conversation

@JonBoyleCoding

Copy link
Copy Markdown

Adding torch to a project on mac failed as there are no cudaPackages.

The fix should only enable cuda if Linux is detected.

@phaer phaer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

deps = {nixpkgs, ...}: {
inherit (nixpkgs.cudaPackages) autoAddOpenGLRunpathHook;
inherit (nixpkgs.stdenv) isLinux;
autoAddOpenGLRunpathHook = lib.optionalAttribute nixpkgs.stdenv.isLinux nixpkgs.cudaPackages.autoAddOpenGLRunpathHook;

Copy link
Copy Markdown
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
Copy Markdown
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.

@JonBoyleCoding
JonBoyleCoding marked this pull request as draft August 24, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants