feat: cross-platform port — Windows/WSL2/Linux + CUDA (RTX 2060+)#2
Open
feat: cross-platform port — Windows/WSL2/Linux + CUDA (RTX 2060+)#2
Conversation
Add platform abstraction layer (src/io/compat.rs) unifying all direct I/O
primitives across macOS, Linux/WSL2, and Windows. NVMe streaming now works
on Windows via FILE_FLAG_NO_BUFFERING + ReadFile(OVERLAPPED) — equivalent
to F_NOCACHE + pread on macOS.
Key changes:
- src/io/compat.rs: NativeFd type alias + open_direct_fd/read_at_fd/
alloc_pages/free_pages/advise_free_pages for all platforms
- src/io/aligned_buffer.rs: posix_memalign → std::alloc::Layout
- hypura-sys/build.rs: Metal/CUDA/CPU three-way build with CUDA
auto-detection and dunce::canonicalize (fixes \?\ UNC path on Windows)
- hypura-sys/src/hypura_buft.c: #ifdef _WIN32 VirtualAlloc/VirtualFree
- src/profiler/{cpu,gpu,storage,mod}.rs: cross-platform hardware detection
+ NVIDIA GPU spec DB (RTX 20/30/40/50 + A/H series)
- src/compute/{nvme_backend,inference}.rs: compat module + sysinfo
- src/scheduler/placement.rs: per-OS OS_OVERHEAD/GPU_RUNTIME_OVERHEAD
- Cargo.toml: windows-sys conditional dependency
- README.md: bilingual (Japanese/English), Windows/WSL2 install instructions
- _docs/: dated implementation logs
CUDA architectures: sm_75 (RTX 20xx), sm_86 (RTX 30xx), sm_89 (RTX 40xx),
sm_90 (H100). Override with HYPURA_CUDA_ARCHITECTURES env var.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ific configs - hypura-sys/build.rs: check HYPURA_PREGENERATED_BINDINGS env var or hypura-sys/bindings.rs before invoking bindgen, enabling builds on machines without LLVM/libclang installed; improve error message to guide users toward the fix - .gitignore: exclude .cargo/config.toml (LIBCLANG_PATH is machine- specific) and .claude/ (local IDE settings); remove accidentally committed .claude/settings.local.json from tracking - _docs/: add implementation log for the libclang Windows fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Disable llama.cpp tool targets in hypura-sys CMake configuration to avoid building unsupported multimodal CLIs on Windows, and ignore local temporary build artifact directories. Made-with: Cursor
Author
|
Windows update: pushed commit 1fac4fd to head branch (includes LLAMA_BUILD_TOOLS=OFF in hypura-sys/build.rs). Local rebuild progressed through CUDA+CMake/MSBuild on Windows with the tools target disabled; continuing final smoke verification on my side. |
Use isolated target-dir build runs and retain Windows runtime/link fixes while documenting redirected serve logs and successful /, /api/tags, /api/generate smoke results. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 概要
FILE_FLAG_NO_BUFFERING+ReadFile(OVERLAPPED)(equivalent toF_NOCACHE+pread)FILE_FLAG_NO_BUFFERING+ReadFile(OVERLAPPED)≡F_NOCACHE+pread)Key changes / 主な変更
New file / 新規ファイル
src/io/compat.rs— Platform abstraction layer unifyingopen_direct_fd/read_at_fd/alloc_pages/free_pages/advise_free_pagesacross macOS, Linux, and Windowsプラットフォーム抽象化レイヤー。macOS・Linux・Windows の直接I/O・メモリ管理APIを統一
Modified / 変更ファイル
src/io/aligned_buffer.rsposix_memalign→std::alloc::Layout(cross-platform)hypura-sys/build.rsdunce::canonicalizefixes\?\UNC path breaking MSBuild; pre-generated bindings fallback (see below)hypura-sys/src/hypura_buft.c#ifdef _WIN32guards forVirtualAlloc/VirtualFreesrc/profiler/cpu.rssrc/profiler/gpu.rssrc/profiler/storage.rssrc/compute/nvme_backend.rscompatmodulesrc/compute/inference.rssrc/io/async_reader.rscompatmodulesrc/cli/iobench.rscompatmodule + dead code removedsrc/scheduler/placement.rsOS_OVERHEAD/GPU_RUNTIME_OVERHEADconstantsCargo.tomlwindows-sysconditional depREADME.md.gitignore.cargo/config.toml(machine-specific) and.claude/_docs/Pre-generated bindings fallback / 事前生成バインディング対応
bindgenrequireslibclangat build time, which is not always available (e.g., CI without LLVM installed).bindgenはビルド時にlibclangを必要とするが、CI環境など LLVM が入っていない場合がある。This PR adds a two-level fallback in
hypura-sys/build.rs:本PRでは
hypura-sys/build.rsに2段階のフォールバックを追加:HYPURA_PREGENERATED_BINDINGS=/path/to/bindings.rsenv var — point to pre-generated file環境変数で事前生成ファイルを指定
hypura-sys/bindings.rsin source tree — committed pre-generated bindings (zero LLVM dependency)ソースツリーに
bindings.rsをコミットすればLLVM不要でビルド可能To generate and commit bindings once (on a machine with LLVM):
一度だけ生成してコミットする手順:
Platform support / プラットフォームサポート
F_NOCACHE+preadFILE_FLAG_NO_BUFFERING+ReadFileposix_fadvise+preadposix_fadvise+preadCUDA architectures / CUDAアーキテクチャ
Default / デフォルト:
75;86;89;90(RTX 20xx–H100).Override / 変更:
HYPURA_CUDA_ARCHITECTURES=86Test plan / テスト計画
cargo check→ zero warnings / 警告ゼロcargo build --release→ Metal build / Metal ビルド成功cargo build --release→ CUDA build (verified RTX 3060/3080 sm_86) / CUDA ビルド成功hypura profile→ hardware detection / ハードウェア検出hypura iobench ./model.gguf→ NVMe streaming on Windows / Windows NVMe ストリーミング🤖 Generated with Claude Code