PHP Desktop with WebGL/Three.js causes 100% CPU usage

149 views
Skip to first unread message

Madi Turkmenbay

unread,
Jan 16, 2025, 12:50:31 PMJan 16
to PHP Desktop

I’m using PHP Desktop (Chrome 130.1 for Windows, Latest) to run a Laravel-based application that includes a 3D viewer implemented with Three.js. The 3D viewer loads .gltf files and renders them using WebGL. While the viewer works perfectly fine in a regular browser (like Chrome), running the same code in PHP Desktop causes the CPU usage to spike to 100%.

Here’s the setup I’m using in my Three.js component:

  • Scene: Contains a GLTFLoader to load the model.
  • Camera: A PerspectiveCamera with OrbitControls for interaction.
  • Renderer: A WebGLRenderer rendering the scene continuously using requestAnimationFrame.
  • Lighting: Includes a directional light, ambient light, and background.

I suspect the issue might be related to WebGL rendering in PHP Desktop, as it seems like the rendering is happening on the CPU instead of utilizing the GPU.

Madi Turkmenbay

unread,
Jan 16, 2025, 12:52:00 PMJan 16
to PHP Desktop
Questions:
  1. Does PHP Desktop fully support WebGL with GPU acceleration on Windows?
  2. Are there additional flags or configurations needed to ensure hardware acceleration works properly in PHP Desktop?
  3. Could this be a compatibility issue with Three.js or how WebGL is initialized in PHP Desktop?

If anyone has encountered similar issues or knows a solution, I’d greatly appreciate your help!

четверг, 16 января 2025 г. в 22:50:31 UTC+5, Madi Turkmenbay:

Czarek Tomczak.

unread,
Jan 16, 2025, 2:22:05 PMJan 16
to PHP Desktop
On the release page [1] there are listed known issues.

  • Chromium has issues with latest nvidia drivers, so GPU is disabled in settings.json file. To re-enable GPU remove the "disable-gpu" switch.
I had this issue with my GTX 1070 gpu, so I disabled gpu by default. Edit settings.json to re-enable and see how it works for you. We need to test newer Chromium/CEF version to see if it still has issues with nvidia drivers.

[1] https://github.com/cztomczak/phpdesktop/releases/tag/chrome-v130.1

Madi Turkmenbay

unread,
Jan 16, 2025, 3:04:57 PMJan 16
to PHP Desktop
I tried this method.

        "command_line_switches": {
    "enable-gpu": "",      
    "ignore-gpu-blacklist": "",                    
    "disable-software-webgl": "",            
    "use-gl": "desktop",      
    "disable-web-security": true
},
But it didn't help.

пятница, 17 января 2025 г. в 00:22:05 UTC+5, Czarek Tomczak.:

Czarek Tomczak

unread,
Jan 16, 2025, 3:29:26 PMJan 16
to PHP Desktop
Just removing "disable-gpu" switch should be fine.

Hmm. Not sure if it will work, but can you open Developer Tools and then navigate to "chrome://gpu/" page and see what it shows about your GPU?

Czarek Tomczak

unread,
Jan 16, 2025, 3:30:41 PMJan 16
to PHP Desktop
Open Developer Tools in PHP Desktop and navigate to GPU page.

You could also open that page in Google Chrome and compare results.

Czarek Tomczak

unread,
Jan 16, 2025, 3:33:43 PMJan 16
to PHP Desktop
Also try changing runtime_style to "chrome" in settings. See if it makes any difference to GPU utilization. Also with this setting you can open a new popup window with Chromium style window and navigate to chrome GPU page for sure.

Madi Turkmenbay

unread,
Jan 16, 2025, 3:42:10 PMJan 16
to PHP Desktop


Снимок.PNG
пятница, 17 января 2025 г. в 01:33:43 UTC+5, Czarek Tomczak:

Czarek Tomczak

unread,
Jan 16, 2025, 3:51:29 PMJan 16
to PHP Desktop
That is strange. Even after removing "disable-gpu" switch GPU still doesn't work hmmm.

Can you test with upstream CEF sample application? Download from: https://cef-builds.spotifycdn.com/cef_binary_130.1.16%2Bg5a7e5ed%2Bchromium-130.0.6723.117_windows64_client.tar.bz2

Test chrome gpu page in that cefclient/cefsimple app.

Madi Turkmenbay

unread,
Jan 16, 2025, 4:58:09 PMJan 16
to PHP Desktop
Снимок.PNG
Yes your config is working.

пятница, 17 января 2025 г. в 01:51:29 UTC+5, Czarek Tomczak:

Czarek Tomczak

unread,
Jan 16, 2025, 6:25:20 PMJan 16
to PHP Desktop
So it works fine now in PHP Desktop?

Madi Turkmenbay

unread,
Jan 17, 2025, 12:39:09 AMJan 17
to PHP Desktop
Yes, but how can I connect your settings to myself?
пятница, 17 января 2025 г. в 04:25:20 UTC+5, Czarek Tomczak:

Madi Turkmenbay

unread,
Jan 17, 2025, 1:03:25 AMJan 17
to PHP Desktop
It's solved, I downloaded the previous version of Php Desktop and everything worked. Thanks a lot
пятница, 17 января 2025 г. в 10:39:09 UTC+5, Madi Turkmenbay:

Czarek Tomczak

unread,
Jan 17, 2025, 7:47:48 AMJan 17
to PHP Desktop
I'm not sure I understand. Does it work with latest version 130.1?

Madi Turkmenbay

unread,
Jan 18, 2025, 3:39:44 AMJan 18
to PHP Desktop
It worked in the previous version.

пятница, 17 января 2025 г. в 17:47:48 UTC+5, Czarek Tomczak:

Czarek Tomczak

unread,
Jan 18, 2025, 11:35:55 AMJan 18
to PHP Desktop
You mean version 57.0?

Madi Turkmenbay

unread,
Jan 18, 2025, 2:07:37 PMJan 18
to PHP Desktop
PHP Desktop Chrome 130.0 for Windows
суббота, 18 января 2025 г. в 21:35:55 UTC+5, Czarek Tomczak:

Czarek Tomczak

unread,
Jan 18, 2025, 3:50:21 PMJan 18
to PHP Desktop

Czarek Tomczak

unread,
Feb 7, 2025, 5:13:40 PMFeb 7
to PHP Desktop
Madi, Can you check if creating manifest file as explained in this comment resolves issue in version 130.1?
Reply all
Reply to author
Forward
0 new messages