# cuda4cpu

cuda4cpu lets an agent build, run, and test CUDA and HIP code on a CPU-only machine. Use it to check kernels from your coding environment without a GPU.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8 repo stars
- Author: javier-cabezas
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/javier-cabezas/cuda4cpu
- Updated: 2026-10-27
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/cuda4cpu

## What it does

The MCP server sends CUDA and HIP code through cuda4cpu for compilation and execution on the CPU. It can surface incorrect results, memory errors, and barrier problems, so an agent can test a kernel without access to a graphics card.

For Claude Code, the install command starts the server in Docker with the image `ghcr.io/javier-cabezas/cuda4cpu:0.4.1`. Docker must be available; without it, this launch method will fail. Checks also catch missing `__syncthreads()` calls and cases where threads in one block reach different barriers.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add cuda4cpu -- docker run -i --rm ghcr.io/javier-cabezas/cuda4cpu:0.4.1
```

### Codex

**Platform CLI**
```bash
codex mcp add cuda4cpu -- docker run -i --rm ghcr.io/javier-cabezas/cuda4cpu:0.4.1
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cuda4cpu": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/javier-cabezas/cuda4cpu:0.4.1"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cuda4cpu": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/javier-cabezas/cuda4cpu:0.4.1"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add cuda4cpu docker run -i --rm ghcr.io/javier-cabezas/cuda4cpu:0.4.1
```

## When to use it
- test a CUDA kernel without a GPU
- run HIP code on a CPU
- find incorrect computation results
- catch memory access errors
- detect missing or divergent barriers

## Example prompts
- Build and run this CUDA kernel, then check its results.
- Test this HIP program for memory errors and incorrect output.
- Check whether every thread in the block reaches the same `__syncthreads()` call.

## Similar
- [gpu-memory-model](https://affpapa.org/en/nevibecode/skills/gpu-memory-model.md) — skill · 391 installs
- [moat-cuda-to-rocm](https://affpapa.org/en/nevibecode/skills/moat-cuda-to-rocm.md) — skill · 104 installs
- [hip-rocm](https://affpapa.org/en/nevibecode/skills/hip-rocm.md) — skill · 364 installs
- [mojo-gpu-fundamentals](https://affpapa.org/en/nevibecode/skills/mojo-gpu-fundamentals.md) — skill · 2800 installs
- [pufferlib](https://affpapa.org/en/nevibecode/skills/pufferlib.md) — skill · 2100 installs
- [tilegym-cutile-python](https://affpapa.org/en/nevibecode/skills/tilegym-cutile-python.md) — skill · 1700 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
