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.1

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.1
File Interpreter ABI Platform
hip_python_interop-10.0.0.0.1.1-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.1-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.1-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.28+ x86-64, Linux glibc 2.17+ x86-64 Details

Total release size: 9.6 MB

Release files / hip_python_interop-10.0.0.0.1.1-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.1-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
76bb7156093355ad39721690b71402e29f86db6842a7b61f6bfb38901ee59120
BLAKE2b-256 checksum
How to use checksums
fc2930c3c5dedbfaa32aee3f83070ff371a783b75b317dea6eb06afc525ccc7f
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.1-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.1-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
36a903ac2116c0797cadad59b266a33ba628ac7fd57c4be21fb2c3558f0a3442
BLAKE2b-256 checksum
How to use checksums
ffb3897ae63ed22282240cca937890fb5168547c4e074b669e45d3c85436fab1
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.1-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.1-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
5a90fc9cf07f78e4f7c038b0613d856191ef4a9ac30fcf80fe8301ba597f1aee
BLAKE2b-256 checksum
How to use checksums
c205480ba07e882821ad709c5bbb814772ea6de357d640e872205aeeea9db9ad
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