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. Forcing the use of a graphics card in Qt.
Forum Update on Monday, May 27th 2025

Forcing the use of a graphics card in Qt.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 6.6k 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.
  • H Offline
    H Offline
    Hasan Al-Baghdadi
    wrote on last edited by
    #1

    I'm currently working with a computer with 2 GPUs where one is integrated and I'm using some OpenGL functionality which the main integrated GPU doesn't like much and so I have to ensure I'm running using the appropriate GPU beforehand.

    I know that libraries such as OpenCL and Vulkan have functionality to check if the GPUs are suitable to perform some tasks.

    Vulkan, for instance, has 'vkEnumeratePhysicalDevices' for finding devices and 'vkEnumerateDeviceExtensionProperties' for finding their properties.

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

      Hi and welcome to devnet,

      AFAIK, Qt doesn't provide that kind of fine grained control.

      What platform are you on ?

      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
      • H Offline
        H Offline
        Hasan Al-Baghdadi
        wrote on last edited by
        #3

        @SGaist said in Forcing the use of a graphics card in Qt.:

        Hi and welcome to devnet,

        Thanks for the welcome

        AFAIK, Qt doesn't provide that kind of fine grained control.

        That's unfortunate.

        What platform are you on?

        Windows, building on 32bit, using Qt Creator

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

          AFAIK vanilla OpenGL does not have this functionality. It's usually something that the driver decides, commonly by examining the monitor the window is shown on and checking which GPU is associated with it.

          There are however vendor specific extensions that let you enumerate and choose device for context creation, e.g. for Windows you have WGL_NV_gpu_affinity or WGL_AMD_gpu_association.

          1 Reply Last reply
          3
          • fcarneyF Offline
            fcarneyF Offline
            fcarney
            wrote on last edited by
            #5

            For NVidia:

            • Go to the driver icon in the tool bar (lower right near clock).
            • Click the "show hidden icons".
            • Open NVidia control panel.
            • Select Manage 3D Settings on the left menu
            • In Global settings select "preferred graphics processor". Choose the appropriate processor.
              or
            • Use the Program Settings tab and choose the "exe" (your executable) and select the preferences there.

            I don't know of any programmatic way to do this. Maybe the vendors have something, but it will probably be specific to the hardware. Just like the above instructions. I hope AMD and other vendors have a similar selection system to choose their GPU.

            I know that NVidia has a list of programs that they put on that list to use the high performance GPUs. You may be able to at some point request your program be on that list. I believe this list is shipped with the drivers.

            C++ is a perfectly valid school of magic.

            M 1 Reply Last reply
            2
            • fcarneyF fcarney

              For NVidia:

              • Go to the driver icon in the tool bar (lower right near clock).
              • Click the "show hidden icons".
              • Open NVidia control panel.
              • Select Manage 3D Settings on the left menu
              • In Global settings select "preferred graphics processor". Choose the appropriate processor.
                or
              • Use the Program Settings tab and choose the "exe" (your executable) and select the preferences there.

              I don't know of any programmatic way to do this. Maybe the vendors have something, but it will probably be specific to the hardware. Just like the above instructions. I hope AMD and other vendors have a similar selection system to choose their GPU.

              I know that NVidia has a list of programs that they put on that list to use the high performance GPUs. You may be able to at some point request your program be on that list. I believe this list is shipped with the drivers.

              M Offline
              M Offline
              Mairtin
              wrote on last edited by
              #6

              @fcarney

              This worked for me (I pointed it at Qt Design Studio Reduced).
              The first time I started my program after applying these settings my PC blue-screened though. Just a heads up! (After rebooting it worked fine)

              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