Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. High CPU usage in Wayland Arch Linux.
Forum Updated to NodeBB v4.3 + New Features

High CPU usage in Wayland Arch Linux.

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 433 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mokhM Offline
    mokhM Offline
    mokh
    wrote on last edited by
    #1

    Hello everyone, I have a small issue that I need help with. When I set a fixed size for my Qt5 Python app, I notice higher CPU usage than usual, between 10% and 12%. However, if I don't fix the window size, the CPU usage is normal.

    I tracked down the problem to the Qt platform on Wayland. If I switch to using xcb by setting the environment variable QT_QPA_PLATFORM=xcb, I don't face this issue.

    Here's a minimal example that causes the problem:

    import sys
    from PyQt5.QtWidgets import QApplication, QWidget
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
    
        window = QWidget()
        window.setWindowTitle("High CPU usage in Wayland on Arch Linux")
        
        # Set the fixed size of the window
        window.setFixedSize(800, 600)  # Width: 800, Height: 600
    
        window.show()
    
        sys.exit(app.exec_())
    

    If anyone has encountered this issue or knows a potential workaround, I would greatly appreciate your help.

    Thank you!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you experience the same issue with PySide6 ?

      Which desktop environment are you using ?
      Which version of Wayland ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • mokhM Offline
        mokhM Offline
        mokh
        wrote on last edited by mokh
        #3

        Hey and thank you,

        Yes i tried the same program with PySide6 and had the same issue and it gets fixed when I change the Qt platform from Wayland to XCB.

        For the desktop environment I am on Hyperland and I am using the 1.22.0-1 version of Wayland.

        Hope that helps.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved