Skip to content

Commit

Permalink
Apply fix for cupy issue 8654 from PR 8655 (#287)
Browse files Browse the repository at this point in the history
automerged PR by conda-forge/automerge-action
  • Loading branch information
github-actions[bot] authored Oct 11, 2024
2 parents 2f278d6 + 3fd7758 commit 4c946dd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
30 changes: 30 additions & 0 deletions recipe/fixes_8654.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From d31c7fbd3dab8f34f4e0f2d8df88e60ba93d4827 Mon Sep 17 00:00:00 2001
From: Kenichi Maehashi <[email protected]>
Date: Thu, 10 Oct 2024 11:22:05 +0200
Subject: [PATCH] Merge pull request #8655 from
dagardner-nv/platform-processor-empty-fallback

Switch to using platform.machine() instead of platform.processor()
---
cupy/_environment.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cupy/_environment.py b/cupy/_environment.py
index f0df50e0d..039f66e22 100644
--- a/cupy/_environment.py
+++ b/cupy/_environment.py
@@ -461,9 +461,10 @@ def _get_include_dir_from_conda_or_wheel(major: int, minor: int) -> List[str]:
config = get_preload_config()
if config is not None and config['packaging'] == 'conda':
if sys.platform.startswith('linux'):
- arch = platform.processor()
+ arch = platform.machine()
if arch == "aarch64":
arch = "sbsa"
+ assert arch, "platform.machine() returned an empty string"
target_dir = f"{arch}-linux"
return [
os.path.join(sys.prefix, "targets", target_dir, "include"),
--
2.39.2

6 changes: 5 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set name = "cupy" %}
{% set version = "13.3.0" %}
{% set sha256 = "9a2a17af2b99cce91dd1366939c3805e3f51f9de5046df64f29ccbad3bdf78ed" %}
{% set number = 0 %}
{% set number = 1 %}

{% set target_name = "x86_64-linux" %} # [linux64]
{% set target_name = "ppc64le-linux" %} # [ppc64le]
Expand All @@ -27,6 +27,10 @@ package:
source:
- url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
# Apply fix for platform.processor() returning unexpected results on some platforms
# https://github.com/cupy/cupy/issues/8654
- fixes_8654.diff

build:
number: {{ number }}
Expand Down

0 comments on commit 4c946dd

Please sign in to comment.