Skip to content

Goal: Eliminate CUDA Toolkit dependency for end users #49

@m96-chan

Description

@m96-chan

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 ⚠️ Required for wheel build
CUDA Headers (cuda.h, etc.) ✅ Required ❌ Not needed Build only ⚠️ Required for wheel build
ptxas (PTX Assembler) ✅ Required ❌ Not needed Build only ⚠️ Required for wheel build
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 ⚠️ Currently yes 🔄 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.toml to include DLLs in package data
  • Implement os.add_dll_directory() in __init__.py for 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

Labels

enhancement infrastructure v0.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions