brainvisa / axon

Brainvisa main GUI
Other
0 stars 1 forks source link

Brainvisa's QtWebEngineProcess took all my CPU #69

Open clarafischer opened 1 year ago

clarafischer commented 1 year ago

I've just reinstalled casa_distro/brainvisa with the last image I could find, casa-dev-5.4-8.sif, on my laptop, which has just been reinstalled in Ubuntu 22.04 with the CEA master. I run a bv bash first, then a brainvisa, and after a few seconds, maybe one or 2 minutes, while brainvisa does nothing, all my CPUs gradually increase to reach almost 80 or even 90% occupancy. If htop is to be believed, the QtWebEngine seems to be to blame. So I can do nothing because I aldready have my CPUs saturated.

I build the distrib cati_platform master branch. I am going to try on my working station to see if I have the same problem.

ps -aux | grep Qt cf227350 336373 0.0 0.3 340076 61476 pts/5 SL+ 09:44 0:00 /usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess --type=zygote --no-zygote-sandbox --application-name=brainvisa --webengine-schemes=qrc:sLV --lang=en cf227350 336374 0.0 0.3 340076 61668 pts/5 SL+ 09:44 0:00 /usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess --type=zygote --application-name=brainvisa --webengine-schemes=qrc:sLV --lang=en cf227350 336376 0.0 0.0 340076 13772 pts/5 S+ 09:44 0:00 /usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess --type=zygote --application-name=brainvisa --webengine-schemes=qrc:sLV --lang=en cf227350 336404 13.2 1.4 5451872 229272 pts/5 Rl+ 09:44 17:29 /usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess --type=zygote --application-name=brainvisa --webengine-schemes=qrc:sLV --lang=en cf227350 336556 13.7 0.3 5288328 61364 pts/5 Rl+ 09:46 17:56 /usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess --type=zygote --application-name=brainvisa --webengine-schemes=qrc:sLV --lang=en

Capture d’écran du 2023-10-03 11-56-28

sapetnioc commented 1 year ago

This problem is still unexplained. The QtWebEngine processes are started by Qt to render the HTML content. I suppose it is a kind of server that is based on Chromium. I have no idea how these engine communicate with the application nor if there are possible links with other local software. If they can be shared among applications using some kind of networking protocol, there is a possibility of interaction with software outside the container. But this is just a guess, I really do not know what happened.

We noticed with @clarafischer that after a container restart, the problem was gone. Will it be back ? Is it a random problem ?

denisri commented 1 year ago

Images casa-dev-5.4 are not the "official" ones yet, they should be hidden on the server but I have forgotten to mark them as hidden, my bad, sorry. They are meant to built using Qt6, not Qt5, and have not been fully tested so far. Your problem is "interesting" because we'll probably get into it, but for now you'd better use 5.3 images which are using Qt5, and will probably not have this problem.

denisri commented 1 year ago

I have hidden 5.4 images again, sorry.

clarafischer commented 1 year ago

Ok, I am going to switch for a 5.3-x image then. Thank you !

denisri commented 11 months ago

I have noticed that, in axon GUI, when we select a process which doen't have a doc page (like a Capsul process without doc), the doc page is cleared, but the CPU usage goes to 100%, with a process QtWebEngineProcess (sometimes 2) using the whole CPU. This is using Qt5 in casa-dev-5.3 images. After investigation, I found that calling QWebEngineView::setHtml('') (used to clear the view) seems to cause it. I have replaced it with setPage(None) and it seems to fix the problem.