AM5728: High Cpu usage

Part Number: AM5728

Tool/software:

Hi,
I have made a QT GUI application, I have two systems one with a display and another without a display but when I run the same application on both the systems ,the one without display shows a high CPU usage with Weston -idle-time=0 occupying more than 60% of the CPU and total CPU usage going to more than 100 with the application. The one with the display shows the same as 0 CPU usage and my total usage in that system is around 10%.
I have a few doubts due to this , they are-

  1. How is it different for both the systems with same Weston configuration and weston.ini script.
  2. Since there is no feedback from the Panel and due to the DTS panel timing my processor thinks there is a display always connected right? this is confirmed by checking /dev/fb0 and with no drm errors in dmesg which is getting enumerated in both the devices.
  3. Is there a way to solve this issue and also why does this happen?

Please help us solve this issue at the earliest .

Regards 
Roshan Rajagopal

  • Roshan, 

    Please remind me what SDK version you are using?

    Will be checking in with or GPU engineers... which one is out of office so there will be delays in response.

    -Josue

  • Hi,
    The SDK we are using is ti-processor-sdk-linux-am57xx-evm-05.03.00.07.

    Regards
    Roshan Rajagopal

  • Hello Roshan,

    Due to engineers being out of office and low bandwidth, there will be additional delay on this thread.

    -Best,

    Josue

  • Hi Roshan,

    I am not the GPU engineer, but I do have some theories for why weston is taking up a lot of CPU cycles.

    1. "idle-time" sets the timeout until Weston enters an inactive mode. However, setting it to 0 will disable the timeout, so try setting to non-zero value

    2. If CPU usage is higher with no display, it could be that GPU/CPU is rendering off-screen. This could allow application to run as fast as possible without being bottlenecked by display hardware, resulting in higher load. If your application has a way to log fps, then this would be a good metric to check. And if display is not needed in one of your systems, you could take out the display node from device tree - although you may also need to change your application to not error out if a framebuffer is not obtained if your application has a dependency to display regardless of whether there is an actual display connected.

    Regards,

    Takuma

  • Hi,
    Apologies for the delay, as I was out of the office. I can try the first suggestion. However, I have a couple of questions:

    1. Since the LCD is configured in the Device Tree Source (DTS), does the processor assume that a display is always connected, even when it isn’t given that there is no feedback from the LCD?
    2. If so, how would it handle rendering off-screen in the absence of a real display?

    Regards,
    Roshan Rajagopal

  • Hello Roshan,

    The majority of our team is out for year-end holidays, please expect delays until Jan 3.

    -Josue

  • Hi,
    Okay thank you josue , we would like to get it solved it at the earliest , please keep this on priority basis.


    Regards,
    Roshan Rajagopal

  • Hi Roshan,

    What have you tried?

    Unfortunately our display engineer is out until Jan 7th. I will try to help you as best as I can in the meantime. 

    -Josue

  • Hi Josue,
    like i had mentioned above the issue i faced was that , and when checked using TOP the issue as mentioned above was
    "I run the same application on both the systems ,the one without display shows a high CPU usage with Weston -idle-time=0 occupying more than 60% of the CPU and total CPU usage going to more than 100 with the application. The one with the display shows the same as 0 CPU usage and my total usage in that system is around 10%."


    My doubt is why is this happening as there is no feedback from the LCD screen , shouldn't it be the same because the dts defines the panel timing and LCD related definitions and the processor thinks there is a display even though it might not be connected?

    Regards
    Roshan Rajagopal

  • Out of office today for new years. Have you done any experiments based on the feedback from Takuma?

  • Hi,
    Yes i had tried it and it was still the same but for the second point which was mentioned i did not understand , as i had mentioned display present or not it shouldn't affect it as there is no feedback from the LCD.

    Regards,
    Roshan Rajagopal

  • Roshan,

    Unfortunately this is outside of my expertise so I will have to inquire internally. I appreciate your patience.

    Could you share your QT version being used?

    Is this a TI evm or a custom design?

    Best, 

    Josue

  • Roshan,

    Is display needed in the second system? What happens when you remove the display from the Device tree?

    -Josue

  • Hi,
    when i remove the display from device tree , the application does not run as it is GUI application and there is no display connected.
    yes ,this is a custom design but most of the main schematics follow the same as the EVM.
    yes as per the customer , one system has display and another does not have and since they cant modify the application at this stage they are asking for a solution to make this work.

    Regards,
    Roshan Rajagopal

  • Roshan,

    Could you share your QT version please?

    So your QT application does seem to have a dependency on Display. Perhaps the solution would be to modify the QT application to not have a dependency on display, or provide a fake display? My suspicion is that without display your custom application is spinning cycles somewhere taking up CPU usage.

    Not sure how much help we can be considering your application and HW are both custom. There is no way for us to replicate the issue.

    Have you considered faking a display in the un-connected case?

    https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in

    -Josue

  • Hi,
    The issue was solved but not by using fake display but by changing the version of wayland platform for QT to be executed.
    export QT_WAYLAND_SHELL_INTEGRATION=xdg-shell-v6
    this was the command i ran before executing the application.
    the earlier one which was being used was xdg-shell-v5.

    I am still confused how just changing the shell has solved the issue , it was just a trial and error from my part. If you have any theory please do let me know so that in future i can solve it easily.
    also the fake display had not worked , i tried that too.

    Regards,
    Roshan Rajagopal

  • Roshan,

    Glad to hear you were able to solve this. This the reason that I wanted to double check the QT version being used. I was going to go over the environment tested back when this SDK was released and look at the other SW versions to make sure everything was aligned. No way for us to help you without any of these details. 

    Thank you for updating the thread with your solution.

    Best,

    Josue