kylä lähtee!

This commit is contained in:
2026-04-02 16:19:57 +03:00
parent 92c952c07a
commit 6cdd695a3b
5 changed files with 33 additions and 31 deletions

View File

@@ -1020,7 +1020,14 @@
try {
const adapter = await navigator.gpu.requestAdapter();
if (adapter) {
hasWebGPU = true;
try {
const testDevice = await adapter.requestDevice({ requiredLimits: { maxInterStageShaderComponents: 60 } });
hasWebGPU = true;
testDevice.destroy();
} catch(e) {
console.log("[WebGPU] Legacy-tuki rajoittaa WebGPU:n: " + e.message);
hasWebGPU = false; // Fallback to CPU NdArray avoiding WASM panic
}
const info = adapter.info || {};
const maxBuf = Number(adapter.limits.maxBufferSize || 0);
// maxBufferSize antaa arvion VRAM:sta — tyypillisesti ~25% todellisesta
@@ -1297,7 +1304,15 @@
if (navigator.gpu) {
try {
const adapter = await navigator.gpu.requestAdapter();
coderHasWebGPU = !!adapter;
if (adapter) {
try {
const testDevice = await adapter.requestDevice({ requiredLimits: { maxInterStageShaderComponents: 60 } });
coderHasWebGPU = true;
testDevice.destroy();
} catch(e) {
coderHasWebGPU = false;
}
}
} catch(e) {}
}
await start_agent_node(wsUrl, coderHasWebGPU, JSON.stringify(deviceInfo), taskId);