Render: render.backend says why it renders on the CPU; mcp --gpu documented (#262)

get_project / render.backend reported "gpuAcceleration": true with
"active": "cpu" and no reason, which read as a broken GPU. The
headless MCP server only attaches the GPU compositor when started with
--gpu, which docs/agents.md didn't mention, and a failed --gpu said
only "no usable GPU adapter" (the adapter's error went to a log no
one sees). The session now keeps the host's reason there is no GPU
compositor (accel_note): the CLI's "headless: renders on the CPU
unless started with --gpu", or the desktop app's compositor setup or
retirement error. The status reports it as `why` whenever it renders
on the CPU (or that the project's renderer is Software Only). --gpu
failures include the adapter's error (Gpu::try_headless).
docs/agents.md documents `mcp --gpu`.

Test: render_backend_says_why_it_renders_on_the_cpu (engine).
Checked with effectcraft-cli mcp and mcp --gpu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-08 18:09:01 +07:00
co-authored by Claude Opus 5.5
parent 0d3b5ed286
commit 4eb69e7577
7 changed files with 46 additions and 5 deletions
+6 -1
View File
@@ -503,6 +503,7 @@ impl EffectcraftApp {
self.gpu_checked = true;
self.frames.retire_gpu();
self.session.accel = None;
self.session.accel_note = Some(format!("GPU preview retired: {}", failure.reason));
self.session.layer_cache.clear();
self.gpu = None;
if let Some(rs) = &self.wgpu {
@@ -559,10 +560,14 @@ impl EffectcraftApp {
self.gpu = Some(g);
self.wgpu = Some(rs.clone());
}
Ok(Err(e)) => log::info!("GPU compositor unavailable: {e}"),
Ok(Err(e)) => {
log::info!("GPU compositor unavailable: {e}");
self.session.accel_note = Some(format!("GPU compositor unavailable: {e}"));
}
Err(e) => {
let reason = e.downcast_ref::<String>().map(String::as_str).or_else(|| e.downcast_ref::<&str>().copied()).unwrap_or("backend panicked");
log::warn!("GPU compositor setup failed; using CPU compositing: {reason}");
self.session.accel_note = Some(format!("GPU compositor setup failed: {reason}"));
}
}
}