Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I specify which GPU to use?
Forum Update on Monday, May 27th 2025

How can I specify which GPU to use?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 2.4k Views
  • 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.
  • B Offline
    B Offline
    bigred9678
    wrote on last edited by
    #1

    I have a system with multiple graphics cards installed and I need to assign my application to use a specific card so that it does not interfere with the other ones being used by other applications. Is there a way to do this in Qt?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gorbatschow
      wrote on last edited by
      #2

      What is the target operating system ?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bigred9678
        wrote on last edited by
        #3

        For right now, it's Linux. I might add Windows in the future.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          agocs
          wrote on last edited by
          #4

          There is no support for this in Qt since it is highly platform and vendor specific.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bigred9678
            wrote on last edited by
            #5

            Thank you for the replies.

            Would this be possible using OpenGL instead?

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              It's really more of a problem with creating a context on appropriate GPU rather than a specific API.
              As such there is nothing in pure OpenGL that handles this. This stuff is usually handled by extensions like GLX and WGL.

              These are some vendor specific extensions that I know of : "GLX_AMD_gpu_association":http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt
              "WGL_AMD_gpu_association":https://www.opengl.org/registry/specs/AMD/wgl_gpu_association.txt
              "WGL_NV_gpu_affinity":https://www.opengl.org/registry/specs/NV/gpu_affinity.txt

              I don't know of anything similar from NVidia for Linux but there might be. Look around. I haven't used any of these though so I'm not sure how widespread and stable they are.

              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