CARTAvis / carta

To CARTA users, this repo holds the CARTA release packages. Please use this repo to log bugs and feature requests. These will be triaged by the development team and prioritised as necessary in the development cycles.
19 stars 0 forks source link

Heat issues #153

Closed cflee25 closed 2 years ago

cflee25 commented 2 years ago

I am using CARTA v3b3. I loaded 4 small (4 MB) 2D continuum images, each having a dimension of 1024x1024. Then created a rectangular region to calculate the statistics. After cycling through 4 images to calcalcute the statistics, my fan ran crazy because of the heat generated by the tasks. My laptop is a Macbook Pro 2017, CPU = 3.5 GHz Dual-Core intel Core i7, Memory = 16 GB 2133 MHz LPDR3, OS = macOS Monterey 12.3.1. Any way to improve this situation? Thanks.

kswang1029 commented 2 years ago

@veggiesaurus @cflee25

With a MacBook Pro (low-end CPU) like

Screen Shot 2022-06-16 at 12 33 09

and with the macOS electron v3b2 and v3b3 packages, I did the test by loading four images with sizes as 16384x16384, 8192x8192, 4096x4096, and 2048x2048, and leave CARTA idle for a while. Then I use the Activity Monitor to watch CARTA related processes. With this test, I think the issue came from the electron lib as we see with v3b3, CPU and GPU are constantly busy even while idle. With v3b2, CPU usage is lower and GPU is 0% when idle.

[no CARTA, ~43 degrees! this is what I mentioned about the common "warm" MacBook Pro]

Screen Shot 2022-06-16 at 12 32 11

[CARTA v3b2 idle with 4 images loaded, ~51 degrees]

Screen Shot 2022-06-16 at 12 26 10

[CARTA v3b3 idle with 4 images loaded, ~68 degrees]

Screen Shot 2022-06-16 at 12 28 13

So it is clear to see with v3b3 the temperature is significantly higher. However, with my low-end MacBook Pro, the fan stays clam. With @cflee25's MacBook Pro, the temperature should be much higher as it is a high-end CPU with a base clock speed at 3.5 GHz (hence more heat!). So the fan went loud to cool the system down.

I also monitored carta_backend with psrecord and performed region statistics. I don't see much differences between v3b2 and v3b3. So it appears to me unlikely the issue is due to the backend changes (eg casacore update). I think it may be due to the electron lib versions adopted in v3b2 and v3b3 as IIRC they are different. Need @ajm-asiaa to confirm this.

I suggest @ajm-asiaa to explore the electron lib versions and perform the same experiment to see which version does not have such GPU loads. We would need to re-adopt the version for the v3-final release.

kswang1029 commented 2 years ago

@veggiesaurus @YuHsuan-Hwang can you recall any significant WebGL changes since v3b2 releases? Just wanted to rule out the possibilities due to frontend changes.

kswang1029 commented 2 years ago

I also spotted the mild GPU usage when CARTA is idle using the dev build and Chrome 102. Maybe it is the recent Chrome versions having such GPU usage issue. 🤔

With Safari (15.5) and Firefox (101.0.1), I don't see such issue.

ajm-ska commented 2 years ago

I put together a version using Electron 15.5.7. It uses Chrome 94.0.4606.81. @kswang1029 has tested it and it does not exhibit the heavy GPU usage issue. But we will test with a few more versions first to figure out in which version of Chrome the issue begins, and then stick with the version just before that. We will also test the very latest Chrome 107 to see if the issue may be gone for future Chrome releases.

ajm-ska commented 2 years ago

After testing a few versions with @kswang1029 we found the following:

Something must change between Chrome 96 and 98. But we can simply stick with Electron v16.2.8 (Chrome 96) in the upcoming CARTA Electron releases.

I made a new CARTA-v3.0.0-beta.3.dmg using Electron v16.2.8 and directly replaced the version available for download on Github.

I should note that this is not really fixing the issue because it is not exclusively an Electron issue. It has been confirmed to occur when using the standard Chrome web browser. For example, carta-controller users on a laptop using Chrome 98 and onward may likely encounter it. So I don't if we should still investigate the carta-frontend? What do you think @veggiesaurus? I guess we could occasionally test using the latest Chrome Canary releases to see if the GPU issue may eventually be eliminated.

veggiesaurus commented 2 years ago

thanks for checking this. How odd. It's definitely something that we need to figure out. I will do some digging. I'd like to keep this issue open for now