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

python3Packages.torchvision-bin: fix aarch64-darwin build #244716

Merged
merged 1 commit into from
Jul 22, 2023
Merged
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
9 changes: 5 additions & 4 deletions pkgs/development/python-modules/torchvision/bin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ in buildPythonPackage {

disabled = (pythonOlder "3.8") || (pythonAtLeast "3.12");

buildInputs = with cudaPackages; [
# Note that we don't rely on config.cudaSupport here, because the Linux wheels all come built with CUDA support.
buildInputs = with cudaPackages; lib.optionals stdenv.isLinux [
# $out/${sitePackages}/torchvision/_C.so wants libcudart.so.11.0 but torchvision.libs only ships
# libcudart.$hash.so.11.0
cuda_cudart
];

nativeBuildInputs = [
nativeBuildInputs = lib.optionals stdenv.isLinux [
autoPatchelfHook
addOpenGLRunpath
];
Expand All @@ -49,7 +50,7 @@ in buildPythonPackage {

pythonImportsCheck = [ "torchvision" ];

preInstall = ''
preInstall = lib.optionalString stdenv.isLinux ''
addAutoPatchelfSearchPath "${torch-bin}/${python.sitePackages}/torch"
'';

Expand All @@ -62,7 +63,7 @@ in buildPythonPackage {
# https://www.intel.com/content/www/us/en/developer/articles/license/onemkl-license-faq.html
license = licenses.bsd3;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
maintainers = with maintainers; [ junjihashimoto ];
};
}