Skip to content

Commit a22a7b2

Browse files
fix: correct RPATH depth in _patch_image_so_rpath_in_wheel
$ORIGIN/../../_rocm_sdk_core/lib resolves to python3.x/_rocm_sdk_core/lib which does not exist. The correct path is $ORIGIN/../_rocm_sdk_core/lib: libtorchcodec_image.so lives in site-packages/torchcodec/, so one ../ brings us to site-packages/ where _rocm_sdk_core/ lives. This matches auditwheel's own convention: it sets $ORIGIN/../torchcodec.libs for the same reason. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5bd86d3 commit a22a7b2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

packaging/repair_wheel.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,9 @@ def _patch_image_so_rpath_in_wheel(wheel_path: Path) -> None:
246246
Two layouts are covered:
247247
- ROCm >= 7.14 (TheRock / rocm-sdk-* Python wheels):
248248
librocjpeg lives in <site-packages>/_rocm_sdk_core/lib/.
249-
$ORIGIN/../../_rocm_sdk_core/lib reaches that dir from
250-
<site-packages>/torchcodec/libtorchcodec_image.so.
251-
AMD already set the correct RPATH inside _rocm_sdk_core's librocjpeg
252-
to find librocm_sysdeps_* transitive deps, so we do not need to touch
253-
those at all.
249+
$ORIGIN/../_rocm_sdk_core/lib reaches that dir from
250+
<site-packages>/torchcodec/libtorchcodec_image.so
251+
(one ../ goes from torchcodec/ up to site-packages/).
254252
- ROCm <= 7.2 (system install):
255253
/opt/rocm/lib is the standard path; the AMD installer always
256254
creates the /opt/rocm symlink even for versioned installs.
@@ -288,7 +286,10 @@ def _patch_image_so_rpath_in_wheel(wheel_path: Path) -> None:
288286
extra = ":".join([
289287
# ROCm >= 7.14: librocjpeg lives in _rocm_sdk_core/lib alongside
290288
# the other ROCm libraries shipped as a pip wheel.
291-
"$ORIGIN/../../_rocm_sdk_core/lib",
289+
# libtorchcodec_image.so is in site-packages/torchcodec/, so
290+
# $ORIGIN/.. reaches site-packages/ (same as auditwheel uses for
291+
# $ORIGIN/../torchcodec.libs).
292+
"$ORIGIN/../_rocm_sdk_core/lib",
292293
# ROCm <= 7.2: standard system install (always symlinked to /opt/rocm).
293294
"/opt/rocm/lib",
294295
])

0 commit comments

Comments
 (0)