antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
11.14k stars 1.33k forks source link

Incorrect complex fruchterman layout rendering when GPU accelerated #3424

Closed AgustinBanchio closed 4 months ago

AgustinBanchio commented 2 years ago

Describe the bug

When a Fruchterman layout graph has complex data and is GPU accelerated, the layout is incorrectly rendered.

Sometimes it doesn't show at all and you need to pan and scroll around to see it, and it's all squashed in a diagonal line. See attached screenshot.

This can be replicated with the GPU layout example for complex data.

It doesn't happen on every machine. It runs correctly on other Windows PCs or on a MacBook.

My guess is that it has to do with the actual Graphics Adapter or driver? Nvidia Drivers on Windows?

Tried on different browsers, with no extensions or add-ons, tried replacing direct x with open GL and the issue still persisted.

Your Example Website or App

https://g6.antv.vision/en/examples/net/gpuLayout#fruchtermanComplexData

Steps to Reproduce the Bug or Issue

Go to https://g6.antv.vision/en/examples/net/gpuLayout#fruchtermanComplexData. See the rendered layout.

Expected behavior

The layout should be rendered correctly and not squashed

Screenshots or Videos

image

Platform

Additional context

Maybe someone with a similar graphics card and setup can try to reproduce and find the issue.

We are having the same issues with M1 and M1Pro MacBooks

xiaoiver commented 2 years ago

I rewrote it with WebGPU which has native support for compute shader, can you reproduce this bug? https://antv-g-next.gitee.io/zh/examples/gpgpu#fruchterman

I guess this bug caused by WebGL textures(our current implementation based on WebGL texture mapping) on your device.

machine: MacBook Pro (13-inch, M1, 2020) browser: Chrome 97.0.4692.99 (arm64)

截屏2022-02-10 上午10 17 29
BinX-Suse commented 2 years ago

We have same issue while using it on Linux, M1 Mac, and some Windows.

AgustinBanchio commented 2 years ago

Hi, in the link you sent I'm seeing the following (with the same machine that had the issues): image

Is that what I'm supposed to be seeing? The graph looks like just blue lines.

xiaoiver commented 2 years ago

Is that what I'm supposed to be seeing? The graph looks like just blue lines.

It seems that all the nodes are not rendered correctly.

AgustinBanchio commented 2 years ago

Apparently, M1 and M1 Pro MacBooks are having the same issue. When they try the GPU Fruchterman example they look fine but when it's more complex with custom nodes and edges it goes crazy.

It's there anything I can do to help you with debugging this?

AgustinBanchio commented 2 years ago

It looks like the only problem is the layout calculation, not the actual rendering.

Is this being looked at?

To avoid the issue we are forced to use gpuEnabled: false when creating the graph. But for fruchterman it's really slow.

I rewrote it with WebGPU which has native support for compute shader, can you reproduce this bug? antv-g-next.gitee.io/zh/examples/gpgpu#fruchterman

I guess this bug caused by WebGL textures(our current implementation based on WebGL texture mapping) on your device.

Will this WebGPU change be released soon or was it just an experiment to see if it worked?

McKenzieJDan commented 2 years ago

Had a similar issue over the weekend - disabling gpuEnabled: false is a work around for now but it's also a lot slower so not ideal. Also interested in the progress of this thanks!

rookie-luochao commented 2 years ago

How long is the problem expected to be solved?

jinfei-lab commented 1 year ago

Hello, friends, I also encountered this problem, do you have any good alternatives at that time, thank you

github-actions[bot] commented 4 months ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。