0
\$\begingroup\$

My app in its current state renders only 2 triangles to the screen using OpenGL. I am using std::chrono::steady_clock for frame counting.

With Intel graphics, I hit 1000fps and with my GTX 1060(6GB) I am getting an absurd frame rate of 480fps.

I have used the Nvidia Optimus Enablement method to force renders on my GPU(reference: http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf)

Why could this be happening? My shaders are under 60 lines of code, there seems to be nothing that is lagging my GPU from my CPU performance.

\$\endgroup\$
  • \$\begingroup\$ Could be lots of things... I'd guess that the GPU has a high start-up cost. Think of your GPU vs CPU as a backpack vs a truck. The truck (GPU) can definitely carry more items than the backpack (CPU) but if you only have a pen and some paper it's easier to put it in a backpack than to start the trucks engine, open the doors, hire a driver etc... So basically your CPU might outperform your GPU on these simple calculations but if you were to say draw 6 mil quads your GPU would outperform your CPU. \$\endgroup\$ – Charanor Jul 2 '18 at 0:05
  • \$\begingroup\$ "My shaders are under 60 lines of code" - add that to the question please. 60 lines of shader code could contain something weird \$\endgroup\$ – Kromster Jul 2 '18 at 5:59
  • \$\begingroup\$ I am doing 2 float multiplications and 1 vec2 subtraction in my shaders as a whole. But as the answers are suggesting, this seems to be normal to get lower frame rates with less workload. \$\endgroup\$ – Twarit Waikar Jul 2 '18 at 8:42
0
\$\begingroup\$

This is perfectly normal with light workloads,

The way Optimus works is that, when using the NVIDIA, it does all of the heavy work on that, then transfers the final framebuffer to the Intel for display. On the other hand, if using the Intel only, this transfer does not happen.

All that you are seeing is that the amount of work you are doing is so small that the transfer is the dominant factor in your performance. As you do more work, you will see things even out and eventually the NVIDIA will pull ahead.

\$\endgroup\$
  • \$\begingroup\$ What's particularly interesting about this is that over the last few generations (since roughly the HD 4000) Intel GPUs have stopped being crap. What this means is that it's even more likely to find a scenario where the Intel outperforms; I've personally seen a number of laptops where a decent Intel was paired with an ultra low-end NV, and where the Intel outperformed it in most if not all workloads; the fault for that is entirely on the system builder. \$\endgroup\$ – Maximus Minimus Jul 2 '18 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.