-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Single character updates not always rendered consistently in Chromium / Chrome #4574
Comments
If I launch chrome with |
Hmm, can you run the demo of the base repo? To get it up, just do Crucial questions:
I cannot repro it myself, but I am still on v112 here (Ubuntu, tested both Intel graphics and nvidia GPU). |
Ok, so maybe it was an educated guess ... ;-) |
Yes, reverting to "canvas" looks good, performance seems fine.
Don't have an older chrome, but Firefox does not exhibit the problem.
Again, don't have easy access to another GPU, but given it's 10s on the xterm.js homepage and I'm using the current stock Ubuntu and Chrome, someone will be able to test this with no effort. I would be inclined to say that this is a chrome Bug as it only appears to happen on one version of Chrome and not firefox and it appears to be just WebGL. The issue I guess is that if it's just in the latest Chrome, it's a regression issue which will affect more users as they upgrade.
Just for the record I'm using an NVIDIA GT710. |
True, we need a bigger test base and its quite easy to check via the xtermjs homepage. @Tyriar Do you happen to have ppl with Linux machines in your team with different distros/GPU-setups, that would be able to check that with a v114 Chrome/Chromium?
Yes it seems so, but it is still not clear, if this is not caused by subpar packaging. Chrome/Chromium is quite a fat piece of software (LOC-wise it accounts as its own OS already), and I think there is quite some customization for Ubuntu/Debian going on. Things like selinux/apparmor might have a saying here too for snap or appimage packages (Can the GPU access be limited by those? no clue). Or X11 with its driver nightmare, and pretty much the same for wayland... To get more insights:
Idk if you want to go even further, the next steps would be to debug webgl settings in chrome itself and compare them with an older still working version. Edit: Edit2: |
Does this help?
Graphics Feature Status
Problems Detected
|
Oh well - all hardware acceleration is disabled for you? How come? Maybe they have raised the needed OpenGL version/flags? Would that change with an older chrome version? Any chance to get it running with HW support? Is Firefox using hardware acc? I wonder how you can even browse fat websites these days with only SW support, isnt that sluggish as hell? Thats a really interesting outcome, and even may point to some faulty software shim. And sorry for so many questions. Btw w'o hw GPU support in the browser the canvas renderer is your best choice - its still reasonable fast compared to the DOM renderer. I am really astonished, that the webgl renderer is working at all for you and not failing during allocation. |
:) Well (!) my machine seems to work fine, and the desktop tools all point to WebGL, Vulkan etc all working / being available. Now on Googling, I came across a site that appeared to be powered by ChatGPT that offered the following code snippet to test for 'actual' availability (my output included); const canvas = document.createElement('canvas');
const context = canvas.getContext('webgpu');
if (!context) {
console.error('WebGPU is not enabled');
} else {
console.log('WebGPU is enabled');
}
VM78:6 WebGPU is enabled Now, maybe I've inadvertently inhaled something I shouldn't, however it kinda looks like it's available (?) So is ChatGPT wrong and this isn't a valid test, or is chrome://gpu also ChatGPT powered and hallucinating? I'm still looking, there seems to be a disconnect somewhere between the driver and Chrome ... My NVidia settings seem to show lots of what look like accelerated features for GLX, OpenGL / EGL.
|
Mm, double checked this with my "chromium" installation just to make sure I'm not going mad. If I run "google-chrome --enable-gpu", then go into "chrome:flags" and set "Override software rendering list", then re-launch, I get full hardware acceleration. So for some reason, my hardware configuration seems to be unsupported and as a result hardware acceleration is blocked by default on chrome and chromium browsers (!) [Everything I have, to me, is pretty standard, if you want a cheap / fanless performant GPU, a GT 710 takes some beating] Now I have hardware acceleration, the problem seems to have evaporated, so it looks like there is a WebGPU emulation layer in Chrome which gets activated when there is no hardware acceleration. And, it rather looks like it has a bug that affects xterm.js. Well, that's my best guess anyway. So webgl now working, however looking at the implications I think you're right, best stick to 'canvas' :-) |
Chrome has a software rasterizer, which imho can emulate WebGL. Not sure how complete that is, and whether it can handle WebGL2 and WebGPU. (WebGPU is a pretty new more direct GPU-API, and not based on OpenGL anymore) I think you have found a bug or a race condition in that software emulation here. Still the webgl renderer in xtermjs is in fact webgl2, so this might explain the partial dysfunctionality, if the emulation does not the full webgl2 deal.
Imho thats a known issue with chromium, it maintains a blacklist for faulty driver/device combinations found in the system and thus may switch off the acceleration. There are some tricks to force it into using hardware acceleration, but that differs a lot between archs / driver versions / GPU model. So while you might be able to resolve the issue once, it just might occur again after the next driver update. Closing the issue, as it seems not related to xtermjs at all. |
With the new WebGL renderer, chrome/chromium has buggy software support for emulating this (see [0]), so we have to detect that manually and prevent loading the add-on. This fixes the issue that on chrome without HW-support, it would not always render every character. Firefox does not have support for a software renderer and the loading/detection throws an exception, falling back to the default renderer. 0: xtermjs/xterm.js#4574 Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Note
Demonstrable on xtermjs.org main page!
Details
Steps to reproduce
Interestingly this seems to work fine in Firefox .. so I'm randomly guessing this is a "webgl" issue (?)
The text was updated successfully, but these errors were encountered: