# the-codepunker/ubuntu-nvidia-mining architecture

> Architecture diagram of the GitHub repository the-codepunker/ubuntu-nvidia-mining, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/the-codepunker/ubuntu-nvidia-mining
- Repository: https://github.com/the-codepunker/ubuntu-nvidia-mining

## Overview

This repository automates an Ubuntu/Nvidia Ethereum mining rig: an operator configures the GPU environment, applies overclock settings, and starts the miner. A separate cron-driven monitor checks GPU utilization and, on low utilization, captures the miner session output, sends a Mailgun notification, and reboots the host. The README documents setup and scheduling; the monitor source shows its runtime actions. The miner launcher and overclock script were not excerpted, so their internal behavior and calls are represented only where the README documents them.

Main entry points: [`ethdaemon.php`](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/ethdaemon.php) (Miner monitor), [`execute.sh`](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/execute.sh) (Miner launcher), [`occ.sh`](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/occ.sh) (GPU overclock), [`ethminer`](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/ethminer) (Ethereum miner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mining["Mining runtime"]
  node_miner_launcher["Miner launcher<br/>[execute.sh]"]
  node_ethminer["Ethereum miner"]
end

subgraph group_monitoring["Monitoring and recovery"]
  node_monitor["Miner monitor<br/>[ethdaemon.php]"]
  node_daemon_config["Monitor settings"]
end

subgraph group_gpu_setup["GPU setup"]
  node_gpu_config["GPU configuration<br/>[dfp0.edid]"]
  node_overclock["GPU overclock<br/>[occ.sh]"]
end

node_operator(("Rig operator"))
node_gpu_tools["Nvidia GPU tools"]
node_screen["Screen session"]
node_mailgun["Mailgun API"]
node_host_os["Ubuntu host"]

node_operator -->|"configures display"| node_gpu_config
node_operator -->|"runs"| node_overclock
node_operator -->|"starts miner"| node_miner_launcher
node_overclock -.->|"sets GPU clocks"| node_gpu_tools
node_miner_launcher -->|"launches"| node_ethminer
node_monitor -->|"reads settings"| node_daemon_config
node_monitor -->|"queries utilization"| node_gpu_tools
node_monitor -->|"captures session output"| node_screen
node_monitor -->|"sends alert"| node_mailgun
node_monitor -->|"reboots host"| node_host_os

click node_gpu_config "https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/dfp0.edid"
click node_overclock "https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/occ.sh"
click node_miner_launcher "https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/execute.sh"
click node_ethminer "https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/ethminer"
click node_monitor "https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/ethdaemon.php"
click node_daemon_config "https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/daemon.ini.template"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_miner_launcher,node_ethminer,node_screen toneBlue
class node_monitor,node_daemon_config toneAmber
class node_gpu_config,node_overclock,node_mailgun toneMint
class node_operator,node_gpu_tools,node_host_os toneIndigo
```

## Components

### Mining runtime

- [Miner launcher](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/execute.sh): `execute.sh`
- [Ethereum miner](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/ethminer): `ethminer`

### Monitoring and recovery

- [Miner monitor](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/ethdaemon.php): `ethdaemon.php`
- [Monitor settings](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/daemon.ini.template): `daemon.ini.template`

### GPU setup

- [GPU configuration](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/dfp0.edid): `dfp0.edid`
- [GPU overclock](https://github.com/the-codepunker/ubuntu-nvidia-mining/blob/master/occ.sh): `occ.sh`

### Other components

- **Rig operator**
- **Nvidia GPU tools**
- **Screen session**
- **Mailgun API**
- **Ubuntu host**

## Connections

- Rig operator → GPU configuration: configures display (evidence: `README.md`)
- Rig operator → GPU overclock: runs (evidence: `README.md`)
- Rig operator → Miner launcher: starts miner (evidence: `README.md`)
- GPU overclock → Nvidia GPU tools: sets GPU clocks
- Miner launcher → Ethereum miner: launches (evidence: `README.md`)
- Miner monitor → Monitor settings: reads settings (evidence: `README.md`)
- Miner monitor → Nvidia GPU tools: queries utilization (evidence: `ethdaemon.php`)
- Miner monitor → Screen session: captures session output (evidence: `ethdaemon.php`)
- Miner monitor → Mailgun API: sends alert (evidence: `ethdaemon.php`)
- Miner monitor → Ubuntu host: reboots host (evidence: `ethdaemon.php`)
