kylä lähtee!
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user