Forcing MAChine to Use Dedicated Graphics Card

Forcing Machine to Use Dedicated Graphics Card?

Does it use NVidia dedicated graphics? AFAIK, the process of automatically switching from integrated to dedicated is based on application profiles. Your application is not in the driver's list of known 3D applications, and therefore the user has to manually switch to the dedicated GPU.

Try changing the executable name of your application to something the driver looks for. For example "Doom3.exe". If that works, then you've found your problem.

If that didn't help, try following the instructions on how to make the driver insert your application in its list of 3D apps:

https://nvidia.custhelp.com/app/answers/detail/a_id/2615/~/how-do-i-customize-optimus-profiles-and-settings

But the above is only for verifying if this is indeed your problem. For an actual solution to this, you should check with the graphics drivers vendors (AMD and NVidia) on the best way to insert a profile for your application into their lists. NVidia provides NVAPI and AMD has ADL and AGS. They're definitely worth a study.

How to force Visual Studio to NOT use the dedicated GPU but only the integrated graphics?

In Tools - Options - Environment - General uncheck Use hardware graphics acceleration if available:

Sample Image

Forcing NVIDIA GPU programmatically in Optimus laptops

The Optimus whitepaper at http://www.nvidia.com/object/LO_optimus_whitepapers.html is unclear on exactly what it takes before a switch to GPU is made. The whitepaper says that DX, DXVA, and CUDA calls are detected and will cause the GPU to be turned on. But in addition the decision is based on profiles maintained by NVIDIA and, of course, one does not yet exist for your game.

One thing to try would be make a CUDA call, for instance to cuInit(0);. As opposed to DX and DXVA, there is not way for the Intel integrated graphics to handle that, so it should force a switch to the GPU.

How to force exe file to run on Nvidia GPU on windows

As far as I know, there is no easy and/or automatic way to compile general C++ code to be executed in a GPU. You have to use some specific API for GPU computing or implement the code in a way that some tool is able to automatically generate the code for a GPU.

The C++ APIs that I know for GPU programming are:

  • CUDA: intended for NVIDIA GPUs only, relatively easy to use. Here you have a good introduction: https://developer.nvidia.com/blog/even-easier-introduction-cuda/

  • OpenCL: can be used for most of the GPUs in the market, but is not as easy to use as CUDA. An interesting feature of OpenCL is that the generated code can also run in CPU. An example here: https://www.eriksmistad.no/getting-started-with-opencl-and-gpu-computing/

  • SYCL: a relatively recent API for heterogeneous programming built on top of OpenCL. SYCL highly simplifies the GPU programming, I found this interesting tutorial which shows how easy to use SYCL is: https://tech.io/playgrounds/48226/introduction-to-sycl/introduction-to-sycl-2

Unfortunately, you will need to rewrite some parts of your code if you want to use one of these options. I believe that SYCL will be the easier choice and the one that will require less modifications in the C++ code (I really encourage you to take a look at the tutorial, SYCL is pretty easy to use). Also, it seems that Visual Studio already supports SYCL: https://developer.codeplay.com/products/computecpp/ce/guides/platform-support/targeting-windows

Lower framerate while using dedicated graphics card for OpenGL rendering

I solved the issues by Disabling NVIDIA Physx GPU acceleration. For some reason it slows down graphic rendering. Now I'm getting about ~280 FPS on my GPU even when rendering ~100k instances.

How to make Flutter run on GPU-1

As per @cbraken:

I can imagine energy conscious users (e.g. laptop users) may want the opposite behavior. I imagine what you might want is something like new functionality in the API we expose to the C++ bits of the Flutter template that developers could use to specify whether their app would like to request to take advantage of the more performant GPU?

For one-off scenarios, you should be able to set this manually for your own use:
https://www.howtogeek.com/351522/how-to-choose-which-gpu-a-game-uses-on-windows-10/

It doesn't appear that there's any such Windows API for doing this, but you could have the C++ runner portion of your Flutter app do this with a registry setting, though it's not picked up until the next run:
Programmatically set Graphics Performance for an app

I'm not a Direct3D wizard, but a bit of quick searching didn't turn up any obvious API for this that wasn't driver-specific. If people have pointers, it's something we might consider. In the meantime, a few pointers to pages I ran into in a quick search:

Is there a way to programmatically select the rendering GPU in a multi-GPU environment? (Windows)
Forcing Machine to Use Dedicated Graphics Card?



Related Topics



Leave a reply



Submit