This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 1fcb62023f [WebGPU] Fix unexpected device lost error when intentional
dispose (#17250)
1fcb62023f is described below
commit 1fcb62023f0a5f878abd5b43ec9e547933fb5fab
Author: Charlie Ruan <[email protected]>
AuthorDate: Thu Aug 8 08:39:43 2024 -0400
[WebGPU] Fix unexpected device lost error when intentional dispose (#17250)
---
web/src/runtime.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web/src/runtime.ts b/web/src/runtime.ts
index d71c98e7d1..e446c4dc4d 100644
--- a/web/src/runtime.ts
+++ b/web/src/runtime.ts
@@ -1122,7 +1122,7 @@ export class Instance implements Disposable {
// ctx release goes back into lib.
this.ctx.dispose();
this.lib.dispose();
- this.deviceLostIsError = true;
+ // Cannot set deviceLostIsError back to true here because
GPUDevice.destroy() is asynchronous.
}
/**
@@ -2122,6 +2122,7 @@ export class Instance implements Disposable {
this.dispose();
}
});
+ this.deviceLostIsError = true;
const webGPUContext = new WebGPUContext(
this.memory, device