7
\$\begingroup\$

I'm going to upgrade my PC soon. I'm worried that I will no longer spot performance losses in my game because of the better specs.

I can check memory usage easily, but how do I check and debug CPU and GPU usage? I used to rely on the framerate, but I guess that it is not accurate.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ The obvious point here is to keep your old machine for testing purposes. Most serious devs keep a machine which has a spec equivalent to their target "minimum system requirements"... more casual devs tend to just test on the lowest power machine they have and then declare that as the minimum \$\endgroup\$
    – Jon Story
    Nov 28, 2014 at 9:44
  • \$\begingroup\$ SOFA is an opensource system-wide unified CPU and GPU profiling tools for Nvidia GPU/CUDA applications. It is easy to install and test. github.com/cyliustack/sofa \$\endgroup\$ May 20, 2019 at 2:34

1 Answer 1

13
\$\begingroup\$

They're called profilers. Visual Studio has both CPU and GPU profilers built in to recent versions. A profiler will give you an idea of how much time your app is taking and where that time is being spent. This won't entirely avert the problems of over-specced hardware, though; the app might peg a lesser CPU but only use 60% of your developer machine. They can help you track trends, e.g. noticing that what used to take 0.5ms now takes 2ms, which is indicative of changes that broke performance.

Frame rate has never been useful for performance measuring. You need to time things. You can build an in-game instrumented profiler, which can be a huge help (and companies like RAD sell some off-the-shelf instrumented profilers geared for games) or you can use a separate sampling profiler which collects stats from a running program without needing to modify it.

Tools like Very Sleep are free profilers that you can run if you're not in Visual Studio or don't want to pay for more competent developer tools (which are often a far better investments than new hardware, I might note). There are similar tools available for OSX, Linux, consoles, and the mobile platforms. Intel's VTune is the most capable sampling profiler I know of, but it is expensive and only works on Intel CPUs naturally (though it does support non-Windows OSes).

For GPU, you can use stand-alone tools like NVIDIA's NSight or AMD's PerfStudio or Intel's GPA. Again, there are some tools for other platforms besides Windows; the ones for consoles tend to be top-notch while the ones for Linux are currently all junk and I'm not personally familiar with the offerings on other platforms.

Ultimately, though, you need to test on target hardware. Figure out what your target low-end hardware is and then buy one of those (or find a tester that has one). Test on that. There's absolutely no other good way to ensure that your game will run well on that hardware other than to just test it with that specific hardware. This is true for PCs, mobile devices, etc. (and this is one of the reasons many developers prefer targetting consoles or closed ecosystems like Apple's products; it vastly reduces the number of hardware configurations that need to be tested)

Game development studios will often have whole labs of varying configurations (different levels of performance, hardware from different manufacturers, different versions of the target OS, etc.) to do their testing. Smaller indie devs might have a couple machines to test on, like a primary desktop, a backup desktop, and a laptop (and then have to rely far more on volunteer testing).

\$\endgroup\$
7
  • 3
    \$\begingroup\$ If you have trouble getting a target PC, or want to try out your game on several computers, given that your new computer will be so powerful, you can also try running VMs first. They aren't extremely accurate, but they give you a good ballpark of how it runs on certain ranges of computer that you can then narrow down. \$\endgroup\$ Nov 27, 2014 at 20:27
  • 1
    \$\begingroup\$ @LyonesGamer - testing with VMs is a really good suggestion. In the past I've personally identified bottlenecks that showed up on a VM but which my own hardware benignly swallowed. If you can't do that, then getting a cheap second PC with Intel graphics can also be a good bet (like VMs, Intel graphics can frequently expose problems that the big guns handle reasonably, and you can be confident that if something runs OK on Intel graphics then it will run well on anything else). \$\endgroup\$ Nov 28, 2014 at 0:25
  • \$\begingroup\$ Simple alternative can be Process Explorer, for some time it have performance graphs for GPU as well. \$\endgroup\$
    – PTwr
    Nov 28, 2014 at 7:25
  • 1
    \$\begingroup\$ There's no reason to use a VM instead of just using a profiler for perf testing. You need to actually measure performance. For hardware testing, either you test on real target hardware or you're wasting your time due to the variable nature of VMs; testing a game in a VM is relevant only if you plan to support real users running your game in that specific VM on that specific hardware (a beefy machine can still run a good VM significantly faster than weaker hardware runs by itself). \$\endgroup\$ Nov 28, 2014 at 20:48
  • 1
    \$\begingroup\$ @ArcaneEngineer: there are indeed. There are profilers for every desktop OS, all the different mobile phones, and every console. We make use of RAD Telemetry (C++ library: instrumented profiler) which supports pretty much every platform ever and then Intel VTune (application: advanced sampling profiler) for our more extensive PC and server profiling. Neither of those are free, though. There are plenty of other options, too. \$\endgroup\$ Jul 28, 2015 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .