Announcement

Collapse
No announcement yet.

How to select high performance GPU

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to select high performance GPU

    Dear Mike,
    Dear Forum Users,

    Please, 'd like to know if there is a way to select the high performance GPU using c++ API or other one?

    For example, if i have two GPU, one having Intel chipset and another having nVidia/AMD chipset, can i select the nVidia/AMD chipset into my application so my 3D scene can benefit of hig performance GPU, without use an explicit GPU driver profile?

    I remember that a long time ago writing

    Code:
    extern "C" { __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; }
    extern "C" { __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; }
    into application code, this automatically select nVidia/AMD GPU; is this still true or i must write a more complex c++ code?

    Thank You in advance for You help.

    Best Regards,
    Vincenzo

  • #2
    Originally posted by [email protected] View Post
    Please, I'd like to know if there is a way to select the high performance GPU using c++ API or other one?
    For example, if i have two GPU, one having Intel chipset and another having nVidia/AMD chipset, can i select the nVidia/AMD chipset into my application so my 3D scene can benefit of hig performance GPU, without use an explicit GPU driver profile?
    Hi Vincenzo,
    Sorry, but I did not find a definitive answer for this.
    I can confirm that the old coding "hack" you mentioned:
    Code:
    extern "C" { __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; }
    extern "C" { __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; }
    still works on multiple machines that we tested.

    For others reading this - This is a real and annoying issue. Your users may report poor performance because their laptop selects the "integrated" GPU instead of the high-performance NVIDIA or AMD GPU.
    Users can work around this, but may not be aware of the issue or the solution. On Windows, when you have Intel and NVIDIA GPUs, you have the "NVIDIA Control Panel". There you should see a pulldown entitled "Preferred graphics processor". If "Auto-select" is selected, then depending on system power management settings, the system should normally select the NVIDIA GPU when the machine is plugged in and the Intel GPU when running on battery power. But this is not reliable and you may get the Intel GPU at any time. To avoid this, the user can change this "Preferred ..." setting to "High-performance NVIDIA processor" and click Apply. But it is safer for the application to use the hack above to "encourage" the system to use the high-performance GPU.

    More details:
    Currently, Open Inventor allows you to detect which GPUs are available and query which GPU will be used for rendering, but does not provide a way to force using the high-performance GPU. For example:
    Code:
    int gpuCount = (int)SoGLDevice::getDevicesCount();
    for (int i = 0; i < gpuCount; ++i) {
        auto device = SoGLDevice::getDevice(i);
        auto name = device->getDeviceName();
    }
    auto actualDevice = SoGLDevice::findFirstAvailableDevice();
    Despite the name, findFirstAvailableDevice() returns the GPU that Open Inventor will actually use for rendering. So an application can detect the case when there are multiple GPUs including NVIDIA or AMD, but the actual GPU used is not one of these, then warn the user.
    Last edited by mikeheck; April 16, 2021, 05:12 PM.

    Comment


    • #3
      Dear Mike,
      thank You very much for Your complete and exhaustive answer.

      Thanks to your explanation, I have the clearest ideas on this very complicated subject.

      Have a nice day and a good start of the week!!

      Best Regards,

      Vincenzo

      Comment

      Working...
      X