{"id":47665670,"url":"https://github.com/morristai/kvik-rs","last_synced_at":"2026-04-02T11:56:39.200Z","repository":{"id":341143449,"uuid":"1169062664","full_name":"morristai/kvik-rs","owner":"morristai","description":"KvikIO Rust implementation","archived":false,"fork":false,"pushed_at":"2026-02-28T08:48:48.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T12:33:53.284Z","etag":null,"topics":["cuda","cufile","gds","kvikio","nvidia","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morristai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-28T05:52:59.000Z","updated_at":"2026-02-28T08:48:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/morristai/kvik-rs","commit_stats":null,"previous_names":["morristai/kvik-rs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/morristai/kvik-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morristai%2Fkvik-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morristai%2Fkvik-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morristai%2Fkvik-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morristai%2Fkvik-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morristai","download_url":"https://codeload.github.com/morristai/kvik-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morristai%2Fkvik-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","cufile","gds","kvikio","nvidia","rust"],"created_at":"2026-04-02T11:56:37.427Z","updated_at":"2026-04-02T11:56:39.193Z","avatar_url":"https://github.com/morristai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kvik-rs\n\nGPUDirect Storage (GDS) accelerated file I/O for NVIDIA GPUs in Rust.\n\nA Rust equivalent of NVIDIA's [kvikio](https://github.com/rapidsai/kvikio) C++ library, built on top of [cudarc](https://github.com/coreylowman/cudarc).\n\n## Why kvik-rs?\n\ncudarc provides low-level CUDA and cuFile bindings. kvik-rs builds on top of them to provide:\n\n- **Automatic GDS/POSIX fallback** -- detects GDS availability at runtime and falls back to POSIX I/O transparently, so your code works on any system.\n- **Opportunistic Direct I/O** -- splits unaligned transfers into aligned Direct I/O segments with buffered I/O for the remainder, maximizing throughput without requiring the caller to manage alignment.\n- **Bounce buffer pooling** -- manages page-aligned, CUDA-pinned host buffers for device-to-file staging in POSIX mode, with automatic pool recycling.\n- **Parallel I/O** -- splits large transfers into chunks across scoped threads with a single `pread_host`/`pwrite_host` call.\n- **Batch I/O** -- submits multiple file operations to the GPU in a single kernel launch via cuFile's batch API.\n\n## Usage\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nkvik-rs = { version = \"0.1\", features = [\"cuda-version-from-build-system\"] }\n```\n\n### Device memory I/O (GDS)\n\n```rust\nuse kvik_rs::{CompatMode, FileHandle};\n\n// Open file with automatic GDS detection\nlet handle = FileHandle::open(path, \"w+\", 0o644, CompatMode::Auto)?;\n\n// Write directly from GPU memory to file\nlet written = handle.write(\u0026dev_buf, size, 0, 0)?;\n\n// Read directly from file to GPU memory\nlet read = handle.read(\u0026mut dev_buf, size, 0, 0)?;\n```\n\n### Host memory I/O (POSIX with opportunistic Direct I/O)\n\n```rust\nuse kvik_rs::{CompatMode, FileHandle};\n\nlet handle = FileHandle::open(path, \"w+\", 0o644, CompatMode::On)?;\n\nhandle.write_host(\u0026data, 0)?;\nhandle.read_host(\u0026mut buf, 0)?;\n\n// Parallel I/O -- splits across threads automatically\nhandle.pwrite_host(\u0026data, 0, task_size)?;\nhandle.pread_host(\u0026mut buf, 0, task_size)?;\n```\n\n## Features\n\n- **Three operating modes**: GDS-enforced (`Off`), POSIX-enforced (`On`), auto-detect (`Auto`)\n- **Device memory read/write** via cuFile with direct GPU-storage DMA\n- **Host memory read/write** with opportunistic `O_DIRECT` and alignment handling\n- **Parallel chunked I/O** via scoped threads (`pread_host`, `pwrite_host`)\n- **Batch I/O** for submitting multiple operations to cuFile in one call\n- **Buffer registration** (`buffer_register`/`buffer_deregister`) for repeated GDS I/O\n- **Bounce buffer pool** with page-aligned allocation and automatic recycling\n- **Runtime configuration** via environment variables (`KVIKIO_COMPAT_MODE`, `KVIKIO_NTHREADS`, etc.) compatible with C++ kvikio\n- **Zero async runtime dependency** -- synchronous by design; callers wrap in `spawn_blocking` as needed\n- **CUDA version feature flags** forwarded from cudarc (`cuda-11060` through `cuda-13010`)\n\n## Limitations\n\n- **Linux only.** GDS and `/proc`-based memory monitoring are Linux-specific.\n- **No stream-ordered async I/O yet.** The `read_async`/`write_async` API (requiring CUDA \u003e= 12.2) is not yet implemented.\n- **No POSIX device memory fallback.** When GDS is unavailable, device memory writes return `Unsupported`; only host memory I/O falls back to POSIX.\n- **No per-device thread pools.** C++ kvikio supports separate thread pools per storage device; kvik-rs uses a single pool.\n- **`is_gds_available()` does not detect cuFile compat mode.** The cuFile driver may silently fall back to host-staged I/O on non-GDS filesystems even when `cuFileHandleRegister` succeeds.\n- **No page cache utilities.** `mincore`/`posix_fadvise` wrappers from C++ kvikio are not ported.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nLicensed under [Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorristai%2Fkvik-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorristai%2Fkvik-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorristai%2Fkvik-rs/lists"}