API/SDK
What it is. A local interface to HYDRA for your own scripts and programs. Shared Memory publishes the live sensor readings of HYDRA as JSON, and the control pipe accepts commands. The Tools folder of the HYDRA package holds a PowerShell module for both, a reference for every command and ready-made examples.
Why use it. Show HYDRA sensors in your own monitor or logger, record exactly the sensors you need, change CPU, NVIDIA and Radeon tuning from a script, or start GPU diagnostics and the Electric Dreams benchmark without clicking through HYDRA.
What is in the Tools folder
- 1Examples. Ready-made scripts and JSON files: one request for every command, a full Shared Memory reader with CSV export, self-tests, and scripts that run GPU diagnostics and Electric Dreams.
- 2HYDRA_CPU_CONTROL.md. CPU commands: Curve Optimizer, PBO limits, Manual OC, Curve Shaper, BCLK and eCLK.
- 3HYDRA_NVIDIA_CONTROL.md. NVIDIA commands: clock and memory offsets, power and temperature limits, the V/F curve, voltage lock, fans, XBAR, OCP and XOC.
- 4HYDRA_RADEON_CONTROL.md. Radeon commands: clocks, voltage, memory clock and timings, power limit, fan curve and Zero RPM.
- 5HYDRA_TELEMETRY_SM.md. The Shared Memory reference: the JSON layout, every sensor ID with its unit, and the binary header for your own reader.
- 6HydraTelemetry.psm1. The PowerShell module: reads Shared Memory and sends commands to the control pipe.
- 7README.md. A short guide to the module and its main commands.
HYDRA does not need these files to run: they are only for scripts and integrations. The references and examples are in English.
Live data: Shared Memory
HYDRA writes every sensor snapshot to the shared memory object Local\HYDRA_TELEMETRY_JSON_V1 as JSON. Readers get data that HYDRA has already collected; reading it does not poll the hardware again.
- In the SETTINGS tab, in the Shared Memory & Logging panel, switch Shared Memory on, as on the LOGGING page.
- Choose the data groups: CPU, GPU, DRAM and PMU. Groups that are off are left out of the snapshot.
- To export every graphics card instead of only the active one, switch on NvPerf One/All GPUs. The sensors of each card then get their own prefix:
gpu.0.,gpu.1.and so on.
The same switches can be set from a script with Set-HydraTelemetrySettings; add -Persist to keep them after a restart of HYDRA. The snapshot refreshes with the HYDRA polling period, from 100 to 2000 ms.
| Field | Meaning |
|---|---|
id | Stable sensor ID, for example cpu.ppt or gpu.board_power. Use it in scripts. |
name, unit | The name shown in HYDRA and the unit of the value. |
value | The reading. Numbers use a dot as the decimal separator on any Windows locale. |
valid | false: the sensor exists, but there is no reading right now. |
stale, ageMs | The reading is a held hardware sample, not a fresh one, and its age in milliseconds. |
First script
Open PowerShell as the same Windows user that runs HYDRA, go to the HYDRA folder and run:
Import-Module ".\Tools\HydraTelemetry.psm1" -Force
Set-HydraTelemetrySettings -SharedMemory $true -Cpu $true -Gpu $true -Dram $true
Get-HydraStatus
Get-HydraSensor -Id "cpu.ppt","gpu.board_power" -IncludeInvalid
Watch-HydraSensor -Id "cpu.ppt","gpu.board_power" -IntervalMs 1000 -Count 10 |
Export-Csv ".\hydra_sample.csv" -NoTypeInformation -Encoding UTF8
Get-HydraStatusshows the running HYDRA version and the state of telemetry and the pipe.Get-HydraSensorreads sensors by ID or by a pattern such asgpu.*;Get-HydraSensor -Id "*"lists everything that is exported right now.Watch-HydraSensorreads the chosen sensors at your interval; pipe it toExport-Csvfor a log file.Examples\HydraTelemetry.FullExample.ps1is a complete reader with checks and CSV export.
Commands: control pipe
The control pipe \\.\pipe\HYDRA_CONTROL_V1 takes one JSON request per connection and sends back one JSON response. It opens together with the HYDRA window and works even when Shared Memory is off. Only the current Windows user and local administrators can connect; network access is denied.
| Area | What it does | In PowerShell |
|---|---|---|
| Status and telemetry | HYDRA status, Shared Memory switches, CSV logging, polling period, PMU mode. | Get-HydraStatus, Set-HydraTelemetrySettings, Set-HydraTelemetryLogging, Set-HydraPollingPeriod |
cpu.* | Curve Optimizer, PBO limits, Manual OC, Curve Shaper, BCLK and eCLK. | Invoke-HydraCpuControl |
nvidia.* | Offsets, limits, the V/F curve, fans, XBAR, OCP, XOC; hands control back to RTX-TUNER. | Invoke-HydraNvidiaControl |
radeon.* | Clocks, voltage, memory, timings, power limit, fans; hands control back to RX-TUNER. | Invoke-HydraRadeonControl |
gpu.diagnostic.* | Lists the cards, starts the GPU diagnostic with its saved settings, reads progress, stops it. | Start-HydraGpuDiagnostic |
benchmark.electricDreams.* | Lists the cards, starts the benchmark, reads the result, publishes it to the scoreboard. | Start-HydraElectricDreams |
A request is one line of JSON; the method name says the area and the action. Reading the Curve Optimizer values:
{"version":1,"id":"read-co","method":"cpu.co.get","params":{}}
Invoke-HydraCpuControl -Method cpu.co.get
The *.Examples.json files in Examples hold one request for every command; the write requests there show the syntax and are not recommended settings.
What a command changes
- Reading changes nothing: HYBRID OC, AMD PBO2 and the GPU tuners keep running.
- A write first switches off HYBRID OC and AMD PBO2, and for a graphics card also RTX-TUNER or RX-TUNER, then applies the value at once.
- Values written through the pipe are not saved to HYDRA profiles and are not undone when your script ends. A driver restart can reset GPU values. To return to your profiles, switch the tuner back on, for example with
nvidia.tuner.setEnabled, or switch the profile on in HYDRA. - Writes are refused while a diagnostic or a recovery is running.
- If a command runs out of time, its result is unknown: read the state before you send it again.
- Tuning writes, diagnostics and tests need the same access as the matching buttons in HYDRA.
- HYDRA writes to its log only failed reads and refused or failed writes; successful commands are not logged.
Tests from a script
The GPU diagnostic and the Electric Dreams benchmark start the same way as their buttons in HYDRA, with the settings saved there:
$card = (Get-HydraGpuDiagnosticTargets).result.targets[0]
Start-HydraGpuDiagnostic -AdapterKey $card.adapterKey
Get-HydraGpuDiagnosticStatus
.\Tools\Examples\HydraElectricDreams.RunExample.ps1 -Start -All
- The start command returns as soon as the run is booked; follow the run with the status command. The status also gives the outcome and, for Electric Dreams, the score.
- The GPU diagnostic stops with
Stop-HydraGpuDiagnostic. Electric Dreams has no stop command: press Esc in its window. - A benchmark started from a script is not published by itself; send it to the scoreboard with
Publish-HydraElectricDreams. - Both need the APP PACK already set up.
Good to know
- Shared Memory and HYDRA's own CSV logging use the same snapshot; CSV logging does not need Shared Memory.
- For a reader in another language,
HYDRA_TELEMETRY_SM.mddescribes the 64-byte header in front of the JSON and how to read it without catching a half-written snapshot. - Closing your script leaves the telemetry switches, a running log and any written values as they are.
Something wrong or missing on this page? Tell us in Discord.