Skip to main content

hip-python-interop

CUDA interop layer for HIP: cuda.bindings.{driver,runtime,nvrtc,cufile} implemented on top of ROCm/HIP, so CUDA Python code can run on AMD GPUs.

The cuda.bindings.cufile module mirrors NVIDIA's GPUDirect Storage (GDS) cuFile Python API on top of AMD's hipFILE. It is built only when the hipfile package is available; the accompanying cuda.bindings.cycufile provides the C-level (cimport-only) declarations.

Part of HIP Python. Full docs: https://rocm.docs.amd.com/projects/hip-python/en/latest/index.html

Install

pip install hip-python-interop

Usage

from cuda.bindings import driver, runtime, nvrtc

driver.cuInit(0)

GPUDirect Storage (cuFile) example:

from cuda.bindings import cufile

cufile.driver_open()
descr = cufile.Descr()
descr.type = cufile.FileHandleType.OPAQUE_FD
descr.handle.fd = fd  # an O_DIRECT-opened file descriptor
fh = cufile.handle_register(descr.ptr)
# ... cufile.buf_register / cufile.write / cufile.read ...
cufile.handle_deregister(fh)
cufile.driver_close()

For native HIP bindings use rocm-bindings-hip instead (or rocm.hipfile for the Pythonic hipFILE wrapper).

Dependencies

  • rocm-bindings-hip
  • rocm-bindings-systems (backs the bundled pynvml shim via rocm.bindings.amdsmi, the nvtx shim via rocm.bindings.roctx, and the cuda.bindings.cufile shim via rocm.bindings.cyhipfile)

Release files for hip-python-interop 10.0.0.0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for hip-python-interop 10.0.0.0.1.2
File Interpreter ABI Platform
hip_python_interop-10.0.0.0.1.2-cp312-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl CPython 3.12 abi3 Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 Details
hip_python_interop-10.0.0.0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
hip_python_interop-10.0.0.0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 9.6 MB

Release files / hip_python_interop-10.0.0.0.1.2-cp312-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL hip_python_interop-10.0.0.0.1.2-cp312-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 3.0 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
32f5bc88cdba6a3a05a5a00fe83356d20c6e1d96b1b60170c3e80cdb588c6846
BLAKE2b-256 checksum
How to use checksums
dd306ff9261c093586a4c85297e1a21d9c57f1530f0647dda36f0b8ff87ae940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / hip_python_interop-10.0.0.0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hip_python_interop-10.0.0.0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5fa54616689588489e44c47e94f31090b7fa208d9b531db1f7a1865ac443ae33
BLAKE2b-256 checksum
How to use checksums
db7a4e95e7b1821b4d0020b3220708499c85f5816f9b40446017de2ca3afeff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / hip_python_interop-10.0.0.0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hip_python_interop-10.0.0.0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9cec9441e310f7ce27effb364b779025265e8fc30d31aec3a5e65853beaab861
BLAKE2b-256 checksum
How to use checksums
a56b73b676635c4101a62d7b30d7404baf8b9702354302f4413bd5bd3577b5a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page