Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bottleneck in Taichi GGUI #8466

Open
devpack opened this issue Jan 24, 2024 · 2 comments
Open

Bottleneck in Taichi GGUI #8466

devpack opened this issue Jan 24, 2024 · 2 comments

Comments

@devpack
Copy link

devpack commented Jan 24, 2024

Dear Taichi team,

I was not able to use Taichi GGUI without a significant performance loss, is there any known bottleneck in GGUI ? Or things to disable, or not do, to get full performance ?

I made a simple N-Body experiment, test 1 is using Taichi GGUI and test 2 is using a custom ModernGL GUI replicating the same functionalities used in test 1. On both tests the same Taichi kernels are used for the computational part, so that the difference is only the rendering pipeline.
Unfortunately Taichi GGUI performed 3 or 4 times slower and I don't get why. I first though that the Dear ImGUI integration was the main cause but it is not, something else is at play. For an order of magnitude here is what I do see on my system:

Test 1: Taichi GGUI +- 350 FPS
Test 2: ModernGL GUI +- 2200 FPS
Test 2: ModernGL (+ ImGUI) GUI +- 1250 FPS

One can found those tests here: https://github.com/devpack/taichi-opengl-nbody

Any insight would be greatly appreciate.

Thanks

@alexspurling
Copy link

alexspurling commented Jan 29, 2024

I'd be interested to know how you are able to uncap GGUI to run faster than 60fps. On my machine, it always runs at 60FPS even with vsync set to False and fps_limit set to -1.

# Renders at a maximum of 60 fps
self.window = ti.ui.Window("LeapFrog N-body", res=(self.screen_width, self.screen_height), fps_limit=-1, vsync=False)

Edit: Apparently the answer is to set the "Vertical sync" setting in the Nvidia control panel to "Use the 3D application setting". That applies to both the taichi GGUI and ModernGL examples that you provided.

For what it's worth, I get the following performance figures on my AMD 5600X Windows system with an RTX 3060:

Test 1: Taichi GGUI +- 650 FPS
Test 2: ModernGL GUI +- 2200 FPS
Test 2: ModernGL (+ ImGUI) GUI +- 1250 FPS

@devpack
Copy link
Author

devpack commented Mar 11, 2024

Thanks for your tests, so you are seeing the same problem. In the command line, if you change --arch=cpu to --arch=gpu, do you see the same ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants