question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[webgl] enabling WEBGL_USE_SHAPES_UNIFORMS results in model execution returning null values

See original GitHub issue

user reported issue with my library and after a while it was traced down to WEBGL_USE_SHAPES_UNIFORMS
which i have enabled by default for over half a year now due to massive performance advantages

issue itself is that model execution shows no issues and it returns tensors in expected shape,
but tensor data is an array with all null values instead of expected float32 values

what is strange that on majority of systems there are no issues (plus i cannot reproduce locally)
and there is only single (quite small) affected model out of 10+ used

affected model

very simple code reproduction (again, i cannot reproduce myself)
(it runs a model using predefined image input and checks output validity)

test has tfjs debug enabled and you can see all ops in the browser console

environment:

  • tfjs: 3.20.0 (older versions are also affected)
  • browser: chrome 104 and 105
  • os: windows 10 pro

it’s reported on two different systems using different graphics adapters (AMD Radeon and nVidia RTX)
both affected systems report no issues looking at chrome://gpu and webgl v2 is working fine

only other thing worth noting is that user is using non-latin os locale

link to original issue: https://github.com/vladmandic/human/issues/291

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:34 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
qjia7commented, Sep 29, 2022

@vladmandic @shurshilov I have verified #6828 can fix this issue in my device. You can verify it in the next release or build from the source. If you still meet any problem, please feel free to reopen it or file a new bug. Thanks.

1reaction
qjia7commented, Sep 20, 2022

More information: The current issue is not that enabling WEBGL_USE_SHAPES_UNIFORMS results in model execution returning null values anymore. But the faceres model couldn’t get correct result no matter WEBGL_USE_SHAPES_UNIFORMS is true or false.

In fact, the fix is more like a workaround. I don’t know why isnan_custom doesn’t work for packed binary. But it works for unpacked binary. I did a bunch of experiments for CHECK_NAN_SNIPPET_PACKED. But none of them work. Paste some findings so far in case someone may have more ideas. Tested GPU: Radeon ™ RX 480 Graphics

  1. The incorrect isNaN coming from the input scalar b not a. If only check isnan_custom(a), we can get correct result.
  2. Print b’s value instead of minimum’s result. The result seems no problem. I mean it’s expected b’s value.
  3. Print vec4(isnan_custom(b))'s value. I also can’t see any abnormal. It’s all zero. But the incorrect result of minimum shows it should have a un-zero value to let the code go to result.xxx = isNaN.xxx ? NAN : result.xxx;
  4. The most weird thing is that the incorrect value(0.5) is none of them in a(1.84), b(6.0) and NAN .
Read more comments on GitHub >

github_iconTop Results From Across the Web

shader - WebGLRenderingContext.createShader returning null
I have a webgl canvas on a page that's loaded into an iframe. ... createShader() returns a null value. ... createShader returned null!...
Read more >
How can I enable WebGL in my browser? - Super User
First, enable hardware acceleration: Go to chrome://settings. Click the Advanced ▼ button at the bottom of the page. In the System section, ...
Read more >
How can I enable WebGL? - WeVideo
Navigate to chrome://settings/system and check to ensure that Use hardware acceleration when available is enabled. Screen_Shot_2021-04-15_at_8.
Read more >
How to Turn on WebGL in Your Browser - Lexia Help Center
A benefit of hardware acceleration is that it can save computer resources, and reduce how long it takes web pages to load. A...
Read more >
Enabling WebGL on Chrome - SmartBear Support
One of the options that you can choose to enable is WebGL, or Web Graphics Library. WebGL is a JavaScript API that allows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found