Metadata-Version: 2.4
Name: modal-cuda-runner
Version: 0.1.0
Summary: Run CUDA files on Modal from your local machine
Author-email: Corbin Platti <csplatti@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/csplatti/modal-cuda-runner
Project-URL: Repository, https://github.com/csplatti/modal-cuda-runner
Project-URL: Issues, https://github.com/csplatti/modal-cuda-runner/issues
Keywords: cuda,modal,gpu,nvcc,cli
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: modal>=1.0
Requires-Dist: rich>=13.0
Dynamic: license-file

# mcr — Modal CUDA Runner

Run a CUDA `.cu` file on an NVIDIA GPU from Modal, from anywhere on your machine, in one command. No local GPU required.

## Install

```
pip install git+https://github.com/<your-handle>/modal-cuda-runner
modal setup   # one-time Modal authentication
```

## Usage

```
$ mcr test.cu
→ Running test.cu on T4
  GPU: Tesla T4
  Vector length: 1048576
  Errors: 0
  Sample: c[0]=3.0 c[1048575]=3.0
✓ Finished executing on Modal (3.42s)
```

Pick a different GPU with `--gpu`:

```
mcr test.cu --gpu H100
```

Supported: `T4` (default), `L4`, `A10G`, `A100`, `A100-80GB`, `H100`.

The CUDA program's stdout is forwarded to your stdout and its exit code becomes `mcr`'s exit code, so `mcr` composes cleanly with shell pipes and CI.

## How it works

`mcr` reads your `.cu` file locally and sends the **source as a function argument** to a Modal function running an `nvidia/cuda:12.9.0-devel-ubuntu22.04` image. Because the image never changes across invocations, Modal caches it forever — no per-run image rebuild.

On the remote container: `nvcc` compiles the source, then the resulting binary runs on the requested GPU. stdout streams back as it's produced.

- First run: slower — container cold start on Modal's side.
- Subsequent runs: typically a few seconds for small kernels.

## Not yet supported

Intentionally scoped small for v1:
- Multi-file projects / `.cuh` headers
- Passing CLI args or stdin to the CUDA binary
- Custom `nvcc` flags
