Skip to content

Commit

Permalink
[WEB] Fix WebGPU runtime build
Browse files Browse the repository at this point in the history
This PR fixes webgpu runtime build by removing the lib preset that
can conflict with the webgpu types
  • Loading branch information
tqchen committed Aug 16, 2023
1 parent 08f4be7 commit be21b37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions web/src/webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export async function detectGPUDevice(): Promise<GPUDeviceDetectOutput | undefin
}

// more detailed error message
const requitedMaxBufferSize = 1 << 30;
if (requitedMaxBufferSize > adapter.limits.maxBufferSize) {
const requiredMaxBufferSize = 1 << 30;
if (requiredMaxBufferSize > adapter.limits.maxBufferSize) {
throw Error(
`Cannot initialize runtime because of requested maxBufferSize ` +
`exceeds limit. requested=${computeMB(requitedMaxBufferSize)}, ` +
`exceeds limit. requested=${computeMB(requiredMaxBufferSize)}, ` +
`limit=${computeMB(adapter.limits.maxBufferSize)}. ` +
`This error may be caused by an older version of the browser (e.g. Chrome 112). ` +
`You can try to upgrade your browser to Chrome 113 or later.`
Expand Down Expand Up @@ -82,7 +82,7 @@ export async function detectGPUDevice(): Promise<GPUDeviceDetectOutput | undefin
const adapterInfo = await adapter.requestAdapterInfo();
const device = await adapter.requestDevice({
requiredLimits: {
maxBufferSize: requitedMaxBufferSize,
maxBufferSize: requiredMaxBufferSize,
maxStorageBufferBindingSize: requiredMaxStorageBufferBindingSize,
maxComputeWorkgroupStorageSize: requiredMaxComputeWorkgroupStorageSize,
},
Expand Down
1 change: 0 additions & 1 deletion web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"compilerOptions": {
"target": "es6",
"outDir": "lib",
"lib": ["ESNext", "DOM"],
"types": ["node", "@webgpu/types"],
"rootDir": "src",
"declaration": true,
Expand Down

0 comments on commit be21b37

Please sign in to comment.