public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-torchvision] rawhide: Rework cuda version patch for 0.27.1
@ 2026-06-23 15:18 Tom Rix
  0 siblings, 0 replies; only message in thread
From: Tom Rix @ 2026-06-23 15:18 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-torchvision
            Branch : rawhide
            Commit : 4f9ff63223119f369a9c4188fb15b7c37bac2c09
            Author : Tom Rix <Tom.Rix@amd.com>
            Date   : 2026-06-23T08:17:42-07:00
            Stats  : +16/-18 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-torchvision/c/4f9ff63223119f369a9c4188fb15b7c37bac2c09?branch=rawhide

            Log:
            Rework cuda version patch for 0.27.1

Signed-off-by: Tom Rix <Tom.Rix@amd.com>

---
diff --git a/0001-A-better-cuda-version.patch b/0001-A-better-cuda-version.patch
index ad6eaa1..8058bcf 100644
--- a/0001-A-better-cuda-version.patch
+++ b/0001-A-better-cuda-version.patch
@@ -1,14 +1,14 @@
-From b16eeb9f2bc4fa870fea6644bc3fafc1770b9368 Mon Sep 17 00:00:00 2001
+From 533b86d3964f2a5e0daa1dd9fa49b570ff8b43e8 Mon Sep 17 00:00:00 2001
 From: Tom Rix <Tom.Rix@amd.com>
-Date: Tue, 3 Mar 2026 06:13:05 -0800
+Date: Tue, 23 Jun 2026 06:45:11 -0700
 Subject: [PATCH] A better cuda version
 
 ---
- torchvision/csrc/vision.cpp | 17 ++++++++---------
- 1 file changed, 8 insertions(+), 9 deletions(-)
+ torchvision/csrc/vision.cpp | 13 +++++--------
+ 1 file changed, 5 insertions(+), 8 deletions(-)
 
 diff --git a/torchvision/csrc/vision.cpp b/torchvision/csrc/vision.cpp
-index 806e870a83fd..e937924c2c88 100644
+index 6cd289d3e8c6..133dd406572f 100644
 --- a/torchvision/csrc/vision.cpp
 +++ b/torchvision/csrc/vision.cpp
 @@ -7,6 +7,7 @@
@@ -19,28 +19,26 @@ index 806e870a83fd..e937924c2c88 100644
  #endif
  
  // If we are in a Windows environment, we need to define
-@@ -18,15 +19,13 @@ void* PyInit__C(void) {
+@@ -18,16 +19,12 @@ void* PyInit__C(void) {
  #endif // !defined(MOBILE) && defined(_WIN32)
  
  namespace vision {
 -int64_t cuda_version() {
 -#ifdef WITH_CUDA
+-  // looks like 12060, 12080, etc.
 -  return CUDA_VERSION;
 -#else
 -  return -1;
-+#ifdef WITH_HIP
-+  int64_t cuda_version() {
-+    return (ROCM_VERSION_MAJOR * 100) + ROCM_VERSION_MINOR;
-+  }
-+  TORCH_LIBRARY_FRAGMENT(torchvision, m) {
-+    m.def("_cuda_version", &cuda_version);
-+  }
- #endif
+-#endif
 -}
++#ifdef WITH_HIP
++int64_t cuda_version() {  return (ROCM_VERSION_MAJOR * 100) + ROCM_VERSION_MINOR;  }
  
--TORCH_LIBRARY_FRAGMENT(torchvision, m) {
--  m.def("_cuda_version", &cuda_version);
--}
+ TORCH_LIBRARY_FRAGMENT(torchvision, m) {
+   m.def("_cuda_version", &cuda_version);
+ }
++#endif
++
  } // namespace vision
 -- 
 2.53.0

diff --git a/python-torchvision.spec b/python-torchvision.spec
index 70bb56f..4e56f96 100644
--- a/python-torchvision.spec
+++ b/python-torchvision.spec
@@ -34,7 +34,7 @@ Source0:        %{url}/archive/%{commit0}/vision-%{shortcommit0}.tar.gz
 Source0:        %{url}/archive/refs/tags/v%{version}.tar.gz#/vision-v%{version}.tar.gz
 %endif
 # get the hip version, step on the cuda version
-# Patch1:         0001-A-better-cuda-version.patch
+Patch1:         0001-A-better-cuda-version.patch
 # Fix build with FFmpeg 8
 # Patch2:         %{name}-ffmpeg8.patch
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-23 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-23 15:18 [rpms/python-torchvision] rawhide: Rework cuda version patch for 0.27.1 Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox