oxicuda-runtime 0.1.3

OxiCUDA Runtime - CUDA Runtime API wrapper (cudaMalloc/cudaMemcpy/cudaLaunchKernel) built on the driver API
Documentation

oxicuda-runtime

Part of the OxiCUDA ecosystem — Pure Rust CUDA replacement for the COOLJAPAN ecosystem.

Overview

oxicuda-runtime is a Pure Rust implementation of the CUDA Runtime API (libcudart) surface, built on top of oxicuda-driver's dynamic driver loader. It exposes ergonomic Rust types for streams, events, device pointers, and kernel dimensions, covering the full breadth of commonly used cudaXxx functions — without any CUDA SDK build-time dependency.

Features

  • Device managementcudaGetDeviceCount, cudaSetDevice, cudaGetDeviceProperties, cudaDeviceSynchronize, cudaDeviceReset
  • MemorycudaMalloc, cudaFree, cudaMallocHost, cudaMallocManaged, cudaMallocPitch, cudaMemcpy, cudaMemcpyAsync, cudaMemset, cudaMemGetInfo
  • Streams — Create/destroy/synchronize CUDA streams with priority and flag support
  • EventscudaEventCreate, cudaEventRecord, cudaEventSynchronize, cudaEventElapsedTime
  • Kernel launchcudaLaunchKernel, cudaFuncGetAttributes, PTX module loading/unloading
  • Peer access — Multi-GPU peer memory copies and access enable/disable
  • ProfilercudaProfilerStart/cudaProfilerStop with a ProfilerGuard RAII wrapper
  • Texture & surface objects — Full CudaTextureObject, CudaSurfaceObject, array descriptors

Usage

Add to your Cargo.toml:

[dependencies]
oxicuda-runtime = "0.1.3"
use oxicuda_runtime::{device, memory, stream, event};

// Select device 0
device::set_device(0)?;

// Allocate 1 MiB of device memory and zero it
let d_buf = memory::malloc(1 << 20)?;
memory::memset(d_buf, 0, 1 << 20)?;

// Create a stream and record an event
let s = stream::stream_create()?;
let e = event::event_create()?;
event::event_record(e, s)?;
event::event_synchronize(e)?;

// Cleanup
event::event_destroy(e)?;
stream::stream_destroy(s)?;
memory::free(d_buf)?;

Status

Item Value
Version 0.1.3 (2026-04-17)
Tests 46 passing
Warnings 0
unwrap() 0

License

Apache-2.0 — © 2026 COOLJAPAN OU (Team KitaSan)