This is the code from NVidia in an easy to download and compile exe, all credit goes to them: https://developer.nvidia.com/setstablepowerstateexe-%20disabling%20-gpu-boost-windows-10-getting-more-deterministic-timestamp-queries
For convenience I've included a compiled executable in the root of this directory