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

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.0
File Interpreter ABI Platform
hip_python_interop-10.0.0.0.1.0-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.0-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.0-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.5 MB

Release files / hip_python_interop-10.0.0.0.1.0-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.0-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
d436759ec971f73c851d0b867c447f5e2a8027edba24bf4994c41e9ba2a73d8f
BLAKE2b-256 checksum
How to use checksums
679ce47bd2ae35335cc17de11d9ac8b2a14cdc5c7e22fb351251af6b297045c5
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.0-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.0-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
045bfbd309a39b9af1fc3aa595926e522809b4b59056e49ec701eb9e284fcf5e
BLAKE2b-256 checksum
How to use checksums
5b92e1dbefa52d1f6f37c96326a82f011730828ebbfbe329ca904433665bda7b
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.0-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.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e240aad250442ce8fbdd27c219199be56e18bef7a68e631584f42d5ae6881f13
BLAKE2b-256 checksum
How to use checksums
6835fbbaead04a8f782355d41b4a1304f80787171e59d19338944fcb983e555d
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