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

[Bug] CPU usage at 100% #117

Open
JonnyTech opened this issue Feb 25, 2025 · 7 comments
Open

[Bug] CPU usage at 100% #117

JonnyTech opened this issue Feb 25, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@JonnyTech
Copy link

JonnyTech commented Feb 25, 2025

What happened?

CPU usage for Coollab always at 100%

Also tell us, what did you expect to happen?

Better CPU management

Steps to reproduce

How can we reproduce the bug? Does it happen all the time or is it random?

Start Coollab - CPU goes to 100% - Fans kick in - Computer goes into meltdown!

Coollab version or commit id

Linux x86_84 Debian 12 using latest AppImage (f335f93)

You can find the Coollab version in the About menu in the top-right of Coollab. If you are a developer working on Coollab, give us the commit id (SHA) and branch instead.

There is no version info in the about menu.

Image

Relevant log output

Copy-paste any relevant log output if any.

Where is the log located?

@JonnyTech JonnyTech added the bug Something isn't working label Feb 25, 2025
@JulesFouchy
Copy link
Member

Hum, interesting, I cannot reproduce this bug. Could you please check the framerate? (By going in the Debug menu in the top right, and selecting "Framerate Window") My guess is that it is not capped

Image

@JonnyTech
Copy link
Author

It is a fresh run so everything should be at defaults - the framerate is indeed capped.

Image

Interestingly my display refresh is set to 60Hz but Coollab shows 144Hz...

Image

@JulesFouchy
Copy link
Member

Okay, then I think either:

  • We are spawning many tasks in the background, but I don't see why I wouldn't have the same bug. To check this, enable Test Tasks from the Debug menu and make sure there is indeed 0 tasks running
    Image
  • The way we wait for the next frame actually makes the CPU busy. I'll have to take a closer look at this while I work on the next big thing which is replacing OpenGL with Vulkan (via WebGPU) because this touches the way we sync with the refresh rate of the screen (which might also fix your refresh rate not beeing properly detected). The work is already started on a branch; if you have the time would you mind building Coollab from source and checking if you have the same problems on the WebGPU branch? If you need help building from source: https://coollibs.github.io/cool/building

@JonnyTech
Copy link
Author

enable Test Tasks from the Debug menu and make sure there is indeed 0 tasks running

Image

There are no tasks

building Coollab from source

$ cd Lab-WebGPU/
$ cmake .
CMake Error at CMakeLists.txt:40 (add_subdirectory):
  The source directory

    /tmp/Lab-WebGPU/Cool

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:42 (cool_setup):
  Unknown CMake command "cool_setup".


-- Configuring incomplete, errors occurred!
See also "/tmp/Lab-WebGPU/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

Do you have a guide showing the correct commands for compilation (without VS Code please)?

@JulesFouchy
Copy link
Member

@JonnyTech I think you need git submodule update --init --recursive to install all the dependencies. You should then be able to build with cmake . and then make (or whatever build files CMake generates on your system)

@JonnyTech
Copy link
Author

Thanks, that got me a lot further. But getting this error now:

-- Including X11 support
[ 11%] Performing download step (git clone) for 'webgpu-backend-dawn-populate'
Cloning into 'webgpu-backend-dawn-src'...
fatal: reference is not a tree: 2496c95d9745277171c219e66f230bea7ce5bb8e
CMake Error at webgpu-backend-dawn-subbuild/webgpu-backend-dawn-populate-prefix/tmp/webgpu-backend-dawn-populate-gitclone.cmake:49 (message):
  Failed to checkout tag: '2496c95d9745277171c219e66f230bea7ce5bb8e'


gmake[2]: *** [CMakeFiles/webgpu-backend-dawn-populate.dir/build.make:102: webgpu-backend-dawn-populate-prefix/src/webgpu-backend-dawn-populate-stamp/webgpu-backend-dawn-populate-download] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/webgpu-backend-dawn-populate.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

CMake Error at /usr/share/cmake-3.25/Modules/FetchContent.cmake:1616 (message):
  Build step for webgpu-backend-dawn failed: 2
Call Stack (most recent call first):
  /usr/share/cmake-3.25/Modules/FetchContent.cmake:1756:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake-3.25/Modules/FetchContent.cmake:1756 (cmake_language)
  /usr/share/cmake-3.25/Modules/FetchContent.cmake:1970 (FetchContent_Populate)
  Cool/lib/WebGPU-distribution/webgpu.cmake:36 (FetchContent_MakeAvailable)
  Cool/lib/WebGPU-distribution/CMakeLists.txt:4 (include)


-- Configuring incomplete, errors occurred!

The tag (Failed to checkout tag: '2496c95d9745277171c219e66f230bea7ce5bb8e') does not seem to exist:

$ git fetch --all 

$ git fetch --all --tags --verbose
POST git-upload-pack (188 bytes)
From https://github.com/CoolLibs/Lab
 = [up to date]        WebGPU                         -> origin/WebGPU
 = [up to date]        23hBD                          -> origin/23hBD
 = [up to date]        23hBD-2                        -> origin/23hBD-2
 = [up to date]        25hBD-Nodes                    -> origin/25hBD-Nodes
 = [up to date]        MaterialNodes                  -> origin/MaterialNodes
 = [up to date]        MeshingOld                     -> origin/MeshingOld
 = [up to date]        WIP-Rework-Input               -> origin/WIP-Rework-Input
 = [up to date]        WIP-custom-id-type-for-imnodes -> origin/WIP-custom-id-type-for-imnodes
 = [up to date]        debug-installer                -> origin/debug-installer
 = [up to date]        dev/Meshing                    -> origin/dev/Meshing
 = [up to date]        import-video                   -> origin/import-video
 = [up to date]        led                            -> origin/led
 = [up to date]        main                           -> origin/main
 = [up to date]        particle-test-baptiste         -> origin/particle-test-baptiste
 = [up to date]        particles                      -> origin/particles
 = [up to date]        particles-3d                   -> origin/particles-3d
 = [up to date]        perform-mode                   -> origin/perform-mode
 = [up to date]        presets                        -> origin/presets
 = [up to date]        reaction-diffusion             -> origin/reaction-diffusion
 = [up to date]        rotate_camera_with_mouse       -> origin/rotate_camera_with_mouse
 = [up to date]        videomapping-lille             -> origin/videomapping-lille
 = [up to date]        visual-scripting               -> origin/visual-scripting
 = [up to date]        1.0.0-Launcher                 -> 1.0.0-Launcher
 = [up to date]        🌱alpha-1                    -> 🌱alpha-1
 = [up to date]        🌱alpha-1.1                  -> 🌱alpha-1.1
 = [up to date]        🌱alpha-2                    -> 🌱alpha-2
 = [up to date]        🐣beta-0                     -> 🐣beta-0
 = [up to date]        🐣beta-1                     -> 🐣beta-1
 = [up to date]        🐣beta-10                    -> 🐣beta-10
 = [up to date]        🐣beta-11                    -> 🐣beta-11
 = [up to date]        🐣beta-12                    -> 🐣beta-12
 = [up to date]        🐣beta-13                    -> 🐣beta-13
 = [up to date]        🐣beta-14                    -> 🐣beta-14
 = [up to date]        🐣beta-15                    -> 🐣beta-15
 = [up to date]        🐣beta-16                    -> 🐣beta-16
 = [up to date]        🐣beta-17                    -> 🐣beta-17
 = [up to date]        🐣beta-2                     -> 🐣beta-2
 = [up to date]        🐣beta-3                     -> 🐣beta-3
 = [up to date]        🐣beta-4                     -> 🐣beta-4
 = [up to date]        🐣beta-5                     -> 🐣beta-5
 = [up to date]        🐣beta-6                     -> 🐣beta-6
 = [up to date]        🐣beta-7                     -> 🐣beta-7
 = [up to date]        🐣beta-8                     -> 🐣beta-8
 = [up to date]        🐣beta-9                     -> 🐣beta-9

I am not a git expert, any suggestions?

@JulesFouchy
Copy link
Member

Oh I see. The library we use to get the WebGPU dependency downloads it from a Git repo, and since the WebGPU API is still experimental the old branch I was using might have been deleted. I will have to look into this to upgrade to the latest version. I'll let you know when it's done ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🔭 To Do
Development

No branches or pull requests

2 participants