Files
nvcurve/frontend/src/types.ts
T
ARIA 6cb33187d3 feat: full fan control — all fans or individual fans
The fan curve previously only controlled fan index 0; secondary fans
stayed on driver control. The curve can now target all fans (new
default) or any individual fan(s).

Backend:
- hal/fans.py: get_num_fans() via nvmlDeviceGetNumFans; get_fan_info()
  returns per-fan speeds; set_fan_speed() accepts a fan index list
  (None = all fans; all-fans mode is lenient toward driver-locked
  fans, explicit lists are strict); reset_fan() restores all fans.
- server.py: per-GPU fan_targets state; the poller applies the curve to
  all target fans and logs write failures (once per distinct error);
  activation validates targets against the hardware (stale indices fall
  back to all fans); POST /api/fans accepts fans, POST /api/fans/speed
  accepts a fan index, GET /api/fans returns num_fans/fans/fan_targets.
- Persistence format is now {"curve": ..., "fans": ...}; legacy
  bare-curve entries migrate to "all fans" at startup.
- Profiles save/apply fan_targets alongside fan_curve.
- MonitoringSample carries per-fan speeds for live gauges.

Frontend:
- Fans tab: All / Fan 1 / Fan 2 / ... selector with live per-fan %;
  the selection is applied together with the curve.
- Live monitor: per-fan gauges with sparklines for multi-fan GPUs.
2026-09-10 15:48:28 +02:00

142 lines
3.5 KiB
TypeScript

export interface VFPoint {
index: number;
freq_khz: number;
freq_mhz: number;
volt_uv: number;
volt_mv: number;
delta_khz: number;
delta_mhz: number;
effective_freq_khz: number;
effective_freq_mhz: number;
domain: "gpu" | "memory";
}
export interface CurveState {
gpu_name: string;
timestamp: number;
points: VFPoint[];
}
export interface MonitoringSample {
timestamp: number;
voltage_uv: number | null;
voltage_mv: number | null;
clock_mhz: number | null;
temp_c: number | null;
power_w: number | null;
fan_pct: number | null;
fans: (number | null)[] | null;
pstate: number | null;
pstate_label: string | null;
mem_used_bytes: number | null;
mem_total_bytes: number | null;
mem_used_mib: number | null;
mem_total_mib: number | null;
gpu_util_pct: number | null;
mem_util_pct: number | null;
mem_clock_mhz: number | null;
throttle_reasons: number | null;
throttle_reasons_label: string | null;
pcie_link_width: number | null;
pcie_link_generation: number | null;
mem_temp_c: number | null;
}
export interface DashboardInfo {
name: string | null;
index: number;
driver_version: string | null;
vbios_version: string | null;
serial: string | null;
board_part_number: string | null;
uuid: string | null;
cuda_cores: number | null;
cuda_compute_capability: string | null;
rop_count: number | null;
vram_total_bytes: number | null;
vram_type: string | null;
memory_bus_width: number | null;
bar1_total_bytes: number | null;
bar1_used_bytes: number | null;
resizable_bar: boolean | null;
pcie_link_width: number | null;
pcie_link_generation: number | null;
pcie_max_link_width: number | null;
pcie_max_link_generation: number | null;
max_graphics_clock_mhz: number | null;
max_memory_clock_mhz: number | null;
max_video_clock_mhz: number | null;
power_limit_w: number | null;
power_min_limit_w: number | null;
power_max_limit_w: number | null;
persistence_mode: boolean | null;
num_fans: number | null;
supported_throttle_reasons: number | null;
temp_slowdown_c: number | null;
temp_shutdown_c: number | null;
temp_gpu_max_c: number | null;
}
export interface GpuInfo {
name: string;
index: number;
driver_version: string | null;
vram_bytes: number | null;
vram_gib: number | null;
}
export interface SnapshotInfo {
filepath: string;
timestamp: string;
gpu: string;
nonzero_offsets: number;
size: number;
}
export interface LimitsState {
// Power
power_limit_w: number | null;
default_power_limit_w: number | null;
min_power_limit_w: number | null;
max_power_limit_w: number | null;
// Clock offsets — current values
gpc_offset_mhz: number | null;
mem_offset_mhz: number | null;
// Memory offset — hardware-reported range
min_mem_offset_mhz: number | null;
max_mem_offset_mhz: number | null;
}
export interface FanPoint {
temp_c: number;
fan_pct: number;
}
export interface FanInfo {
index: number;
fan_pct: number | null;
}
export interface FanState {
fan_pct: number | null;
fans: FanInfo[] | null;
num_fans: number | null;
fan_mode: "auto" | "curve" | null;
min_fan_pct: number | null;
max_fan_pct: number | null;
curve: FanPoint[] | null;
curve_active: boolean;
// Fan indices controlled by the active curve; null = all fans.
fan_targets: number[] | null;
}
export interface ProfileData {
name: string;
gpu_name: string;
curve_deltas: Record<string, number>;
mem_offset_mhz: number | null;
power_limit_w: number | null;
fan_curve: FanPoint[] | null;
fan_targets: number[] | null;
}