hjlld/LearningWebGPU

another issue to run examples

jack1232 opened this issue · 4 comments

Hi,

Can run examples Lesson0 to Lesson 4 without any problem. However, got the following error when run other examples:

  1. Got an empty white screen at first and then it became a black screen when running Lesson5 example.
  2. Got the following same error message when running examples in Lesson6 and Lesson7:

Uncaught (in promise) TypeError: Cannot read property 'requestDevice' of null
at App.InitWebGPU (app.ts:100)
InitWebGPU @ app.ts:100
Promise.then (async)
main @ main.ts:175

hjlld commented

I can not recurrent this issue. Please provide your Chrome Canary version and your GPU model number.

I use Chrome Canary 89.0.4387.3 and GTX 2070,

But I do fix some texture filtering warning issue as you reference about lesson5.

Just update Chrome Canary to 89.0.4387.3, and can't run any example anymore. All examples generate same error:

Uncaught (in promise) TypeError: Cannot read property 'requestDevice' of null
at App.InitWebGPU (app.ts:58)
at async main (main.ts:47)

seems cannot downgrade Chrome canary to the old version to make any example working....

hjlld commented

@jack1232 what's your GPU model, or name of your display card?

It seems like App.InitWebGPU() can not get your GPU adapter. I guess maybe your machine does not have a high-performance display card or something.

In app.ts, find codes below

        this.adapter = await navigator.gpu.requestAdapter( {

            powerPreference: 'high-performance'

        } );

change it to:

        this.adapter = await navigator.gpu.requestAdapter( {

            powerPreference: 'low-power'

        } );

and try it again.

hjlld commented

I close it if you have further issue you can re-open it. Thanks!