Pardon my ignorance if this is a known issue, but does anybody know if (and why) WebGL in a HTMLViewer under Windows 7 runs 12x smoother than under Windows 10?
I left a WebGL simulation run for a minute in a 800x600 window on 4 computers (1 with W7 and 3 with W10) and it’s super stable in all 4 computers, regardless of the OS, but surprisingly, all W10 computers show ATROCIOUS performances when running the WebGL simulation in Xojo and no issue at all when directly run in Firefox or Edge. The 10 years old W7 computer steadily shows excellent performance both in Xojo (HTMLViewer) and in the native browser (Firefox). We’re talking magnitudes slower under Windows 10 compared to Windows 7. Approximately 12 TIMES slower:
On a 10 years old Windows 7 PC, the Xojo web simulation steadily runs at full frame rate (60fps) and steadily only uses 10% of the (decade old) CPU.
On a 4 years old Windows 10 PC, the same Xojo web simulation steadily runs at 5fps (yes, five) and uses 66% of the CPU (steadily). Just to be sure, I tried on 3 different Windows 10 PC and the results are astonishingly the same.
All computers have a dedicated graphics card that is magnitudes faster than what the simple WebGL simulation requires and they can all run the same simulation in the native browser (Firefox or Edge) outside of Xojo at full frame rate. But only the Windows 10 PC’s almost max out their CPU and offer only a handful of frames per second when using the HTMLViewer control for no apparent reason. This seems like a compatibility bug to me. The app is the same, only the OS makes a 12 TIMES performance difference.
Any idea what causes this and/or how to solve this on W10 PC’s?
Then Microsoft crated a new engine based on what’s in (Chromium based) Edge. This new control was first deployed on Windows 10 and later on Windows 7.
You wrote that all 4 computers have dedicated graphics cards. Is it possible that some use dedicated memory and others use shared memory ? That may do a difference. Still on the graphics cards subject, it’s not because there is dedicated graphics card that it is used. For example I have a Dell Laptop whose i5 processor has a build in Intel graphics card and an Nvidia card. The Nvidia card is only used for graphics intensive applications.
One other question. Do all the 4 computers have the same amount of Ram ?
Hi Gilles! All 4 computers are ATX towers with quite high end GPU’s (at least for the time they were sold). No laptop or APU in the equation.
One of the W10 PC has 16GB of RAM and an AMD Ryzen 5 CPU (6-core, 3.6ghz). The other two W10 PC’s are identical, 8GB of RAM and a Core-i7 CPU (4-core, 3.2ghz).
The old W7 PC that renders the WebGL simulation 12 TIMES faster than any of the aforementioned W10 PC’s is an old AMD FX-8350 CPU (8-core, 4.0ghz) with 32GB of RAM.
The WebGL simulation uses 71MB of RAM in cefsubproc.exe, so I doubt having 8GB, 16GB or even 32GB of RAM changes anything whatsoever. It really looks like a compatibility bug and a nasty regression one if I may add.
Just to make sure that I answer your question correctly, how would I check on all PC’s if they use shared memory or not? (I don’t see why they would but just to make sure)
He wrote that for years, Xojo used IE. This is not the case anymore and no, WebGL doesn’t work under native HTMLViewer under Windows 7. Anyway, back to the topic, as stated in the title, we’re talking about WebKit HTMLViewer, the one that is based on Chrome (not IE) and that replaces the native browser. Yes I am using CEF.
OK but why would it render 12 TIMES faster on a 10 years old Windows 7 PC compared to 3 more modern Windows 10 PC’s? This makes no sense whatsoever. An AMD Ryzen 5 is faster than a decade old AMD FX-8350, yet the decade old FX-8350 renders 12 TIMES faster (60fps, compared to 5fps on the Ryzen). Anyway, I highly doubt it’s software rendered, why would it only software render under W10 and work flawlessly under W7, this makes no sense? But I’ll follow both your link and finish gathering DATA for Rick and we’ll see.
I’ve dealt with situations like this a lot. My first guess would be GPU Drivers - drivers on Windows are a mess, and although Windows 10 now manages GPU drivers by default, it often installs fairly old drivers, so it could be that your Windows 7 PC has a better driver than the Windows 10 PC?
For a quick test, to isolate whether it’s Xojo, CEF, or your WebGL code, I would recommend trying some of the demos at three.js examples : this might help narrow down whether the problem is “All WebGL on this Windows 10PC is slow” vs. some other issue.
That is basically what I’ve been doing today already and that’s how I came to the conclusion that all W10 PC’s we have here render at 5fps while the decade old W7 PC renders at full frame rate (60fps). There’s definitely a compatibility problem with graphics acceleration under Xojo on W10. As per stated in the first post above, the same demo runs at full frame rate in Firefox and Edge on the same W10 PC’s.
OK, I have gathered the DATA on all 4 PC’s. All the W10 PC’s report “Canvas: Software only, hardware acceleration unavailable” while the W7 PC reports “Canvas: Hardware accelerated”.
All W10 PC’s run AAA games no problem and the same WebGL demo runs at full frame rate in Firefox and Edge on those W10 PC’s. It’s only from the HTMLViewer in Xojo that it falls back to software rendering. That is the issue, now how can this be solved?
Good detective work - most of my experience is getting high performance out of WebGL via the IE11 renderer in Xojo 2019 using HTMLViewer, and I have basically zero experience with the Chromium / CEF HTMLViewer option. That being said, here are the things I would try:
What version of Xojo? Each Xojo usually updates the CEF library version.
are the window sizes and canvas sizes the same? Under WebGL the canvas has a size which can be different than the window size; mismatches can cause bad performance. For example, if you are rendering a large window, and the pixel scale is at 2x, you may be rendering 4x as many pixels.
searching my Xojo code for “WebGL” i found this note:
me.DoubleBuffer = False // WARNING: doubleBuffer = true will break WebGL GPU rendering on Win32
What version of Xojo?
I purchased Xojo 2021r3.1 just 2 months ago and I’m completely new to Xojo. That’s what I’m using today. (Been using RealBasic for at least 20 years prior to that, all the way back to RealBasic 1.0 under Mac OS 8 in the late 90’s WAY before WebGL was even a thing!)
Are the window sizes and canvas sizes the same?
Yes and I’ve tried with a tiny 400x400 window but it makes almost no difference (8fps instead of 5fps).
Searching my Xojo code for “WebGL” i found this note: me.DoubleBuffer …
What is “me” referring to? The HTMLViewer?
In my case, it was ContainerControl.DoubleBuffer = true causing the issue. Is your HTMLViewer on a window directly, or does it have a parent (such as a Canvas or ContainerControl) which might have DoubleBuffer true?
No, it’s just on a window, nothing behind or in front of it, not in a group of control or anything weird. It’s directly added to a window with nothing else on it (at the moment). Remember that the issue here is that all W10 PC’s have the hardware acceleration disabled under my Xojo app for some reason. The same app, same exact built .exe is launched under W7 and it DOES have hardware acceleration enabled.
Loading the chrome://gpu URL from my built Xojo app reports on all W10 PC’s: “Canvas: Software only, hardware acceleration unavailable” while the W7 PC reports “Canvas: Hardware accelerated”.