Repository navigation
Goal: Eliminate CUDA Toolkit dependency for end users #49
Copy link
Copy link
Closed
Description
Overview
PyGPUkit's long-term goal is to allow end users to run GPU workloads without installing the CUDA Toolkit. Users should only need:
- NVIDIA GPU driver (provides
nvcuda.dll/libcuda.so) - PyGPUkit wheel (ships NVRTC DLL)
This issue tracks progress toward that goal.
CUDA Component Dependency Analysis
| Component | Build Time | User Runtime | Toolkit Required? | Status |
|---|---|---|---|---|
| nvcc (CUDA Compiler) | ✅ Required | ❌ Not needed | Build only | |
CUDA Headers (cuda.h, etc.) |
✅ Required | ❌ Not needed | Build only | |
| ptxas (PTX Assembler) | ✅ Required | ❌ Not needed | Build only | |
| cudart (Runtime Library) | ⚙️ Optional | ⚙️ Optional | Eliminable | ✅ ELIMINATED (driver-only mode) |
cuda_driver (nvcuda.dll) |
✅ Required | ✅ Required | ❌ No | ✅ OK - provided by GPU driver |
NVRTC (nvrtc64_*.dll) |
✅ Required | ✅ Required | 🔄 Goal: Ship in wheel |
Current State
✅ Achieved (User does NOT need Toolkit for these)
| Item | How |
|---|---|
| CUDA Driver API | nvcuda.dll / libcuda.so comes with NVIDIA GPU driver |
| cudart elimination | PYGPUKIT_DRIVER_ONLY=ON build mode |
| Driver-only build | PR #48 fixed kernel.hpp compatibility |
❌ Not Yet Achieved (User still needs Toolkit)
| Item | Blocker | Solution |
|---|---|---|
| NVRTC at runtime | nvrtc64_*.dll loaded from CUDA_PATH/bin |
Ship NVRTC DLL inside wheel |
| Windows DLL loading | Needs os.add_dll_directory() for shipped DLLs |
Implement in __init__.py |
⚠️ Build-Time Only (Acceptable)
| Item | Notes |
|---|---|
| nvcc | Required for compiling .cu files - CI/wheel builders have it |
| CUDA headers | Required for compilation - CI/wheel builders have it |
| ptxas | Part of nvcc pipeline - CI/wheel builders have it |
Implementation Plan
Phase 1: Ship NVRTC in Wheel
- Bundle
nvrtc64_120_0.dll(or appropriate version) in wheel - Add
nvrtc64_builtins_*.dll(required companion) - Update
pyproject.tomlto include DLLs in package data - Implement
os.add_dll_directory()in__init__.pyfor Windows
Phase 2: Verify Driver-Only Runtime
- Test on clean Windows install (no CUDA Toolkit, only GPU driver)
- Test on clean Linux install (no CUDA Toolkit, only GPU driver)
- Document minimum GPU driver version requirements
Phase 3: Fallback Handling
- Graceful error when NVRTC missing
- Graceful error when GPU driver too old
- Clear error messages guiding users to install GPU driver (NOT toolkit)
Target State
User installs: pip install pygpukit
User needs: NVIDIA GPU driver only (no CUDA Toolkit)
Wheel ships: _pygpukit_native.pyd + nvrtc64_*.dll + nvrtc64_builtins_*.dll
Related Issues
- Issue PyGPUkit v0.2.3 — Reliability Phase + TF32 TensorCore #42 (v0.2.4 Reliability) - Driver-only mode stabilization
- PR fix(jit): add driver-only mode support for LaunchConfig #48 - Driver-only build fix
Labels
enhancement infrastructure v0.2.4
Metadata
Metadata
Assignees
Labels
No labels
Activity
m96-chan commentedon Dec 14, 2025
For v0.2.4, the target is to eliminate dependency on the CUDA Toolkit from the user runtime.
m96-chan commentedon Dec 14, 2025
v0.2.4 Sub-Issues Created
Dependency Order
Phase 1 must be completed before Phase 2 testing can begin. Phase 3 can be developed in parallel.
m96-chan commentedon Dec 14, 2025
PR #57 Progress Update
✅ Completed
PYGPUKIT_DRIVER_ONLYflag removed - now the only modenvcuda.dll(GPU driver) requiredArchitecture Change
Original plan was to ship NVRTC in wheel. New approach:
Runtime Dependencies (Final)
nvcuda.dllcudart64_*.dllnvrtc64_*.dllVerified with dumpbin
Updated Status
Phase 1:
Ship NVRTC in Wheel→ Changed to Dynamic NVRTC Loadingnvrtc_loader.cpp)is_nvrtc_available()/get_nvrtc_version()/get_nvrtc_path()APIPhase 2: Driver-Only Runtime ✅
Phase 3: Fallback Handling ✅ (Issue #52)
Result
Goal achieved! 🎉
m96-chan commentedon Dec 14, 2025
Goal Achieved! 🎉
PR #57 completes the goal of eliminating CUDA Toolkit dependency for end users.
Final State
Summary
nvcuda.dlldependencyThank you for tracking this goal!