Fix wiring between overclock profiles, UI controls, and hardware fan actuation

This commit is contained in:
drjones
2026-08-23 09:05:20 -07:00
parent 02c85d778f
commit a0075d23a7
3 changed files with 26 additions and 5 deletions

View File

@@ -40,6 +40,8 @@ DEFAULT_PROFILES: Dict[str, Dict[str, Any]] = {
"lock_core_min": 0, "lock_core_min": 0,
"lock_core_max": 0, "lock_core_max": 0,
"lock_mem_mhz": 11501, "lock_mem_mhz": 11501,
"fan_mode": "manual",
"fan_speed_pct": 60,
}, },
"comfy": { "comfy": {
"label": "ComfyUI — diffusion (core-compute bound)", "label": "ComfyUI — diffusion (core-compute bound)",
@@ -49,6 +51,8 @@ DEFAULT_PROFILES: Dict[str, Dict[str, Any]] = {
"lock_core_min": 2900, "lock_core_min": 2900,
"lock_core_max": 3105, "lock_core_max": 3105,
"lock_mem_mhz": 0, "lock_mem_mhz": 0,
"fan_mode": "manual",
"fan_speed_pct": 75,
}, },
"balanced": { "balanced": {
"label": "Balanced — stock boost, power unlocked", "label": "Balanced — stock boost, power unlocked",
@@ -58,6 +62,8 @@ DEFAULT_PROFILES: Dict[str, Dict[str, Any]] = {
"lock_core_min": 0, "lock_core_min": 0,
"lock_core_max": 0, "lock_core_max": 0,
"lock_mem_mhz": 0, "lock_mem_mhz": 0,
"fan_mode": "auto",
"fan_speed_pct": 0,
}, },
} }

View File

@@ -3,12 +3,12 @@
"label": "Ollama \u2014 LLM decode (memory-bandwidth bound)", "label": "Ollama \u2014 LLM decode (memory-bandwidth bound)",
"power_limit_w": 370, "power_limit_w": 370,
"core_offset_mhz": 100, "core_offset_mhz": 100,
"mem_offset_mhz": 500, "mem_offset_mhz": 700,
"lock_core_min": 0, "lock_core_min": 0,
"lock_core_max": 0, "lock_core_max": 0,
"lock_mem_mhz": 0, "lock_mem_mhz": 0,
"fan_mode": "auto", "fan_mode": "manual",
"fan_speed_pct": 0 "fan_speed_pct": 60
}, },
"comfy": { "comfy": {
"label": "ComfyUI \u2014 diffusion (core-compute bound)", "label": "ComfyUI \u2014 diffusion (core-compute bound)",
@@ -18,8 +18,8 @@
"lock_core_min": 2900, "lock_core_min": 2900,
"lock_core_max": 3105, "lock_core_max": 3105,
"lock_mem_mhz": 0, "lock_mem_mhz": 0,
"fan_mode": "auto", "fan_mode": "manual",
"fan_speed_pct": 0 "fan_speed_pct": 75
}, },
"balanced": { "balanced": {
"label": "Balanced \u2014 stock boost, power unlocked", "label": "Balanced \u2014 stock boost, power unlocked",

View File

@@ -408,6 +408,8 @@ function pushOverclockSample(gpu, ram) {
ocChart.update('none'); ocChart.update('none');
} }
let initialOcLoaded = false;
async function fetchOverclockStatus() { async function fetchOverclockStatus() {
try { try {
const resp = await fetch('/api/overclock'); const resp = await fetch('/api/overclock');
@@ -415,6 +417,14 @@ async function fetchOverclockStatus() {
const data = await resp.json(); const data = await resp.json();
ocProfiles = data.profiles || {}; ocProfiles = data.profiles || {};
renderOverclockStatus(data); renderOverclockStatus(data);
if (!initialOcLoaded && data.active_profile) {
initialOcLoaded = true;
const editSel = document.getElementById('oc-edit-profile');
if (editSel) {
editSel.value = data.active_profile;
loadOverclockForProfile(data.active_profile);
}
}
} catch (err) { } catch (err) {
console.warn('Overclock fetch error:', err); console.warn('Overclock fetch error:', err);
} }
@@ -588,6 +598,11 @@ async function applyOverclock(profile) {
if (!resp.ok) { if (!resp.ok) {
alert(`Apply failed: ${result.detail || 'error'}`); alert(`Apply failed: ${result.detail || 'error'}`);
} }
const editSel = document.getElementById('oc-edit-profile');
if (editSel) {
editSel.value = profile;
loadOverclockForProfile(profile);
}
await fetchOverclockStatus(); await fetchOverclockStatus();
} catch (err) { } catch (err) {
alert(`Error: ${err}`); alert(`Error: ${err}`);