Intel Arc performance boost when gaming in Linux
This is a little tip on how to boost gaming performance in Linux when gaming on an Intel Arc graphics device. By default your Intel Arc device will be scaling its GPU clock frequency, my Arc A770 scales its frequency between 300MHz and 2400MHz. This can be a performance issue especially when playing games and if we fix the frequency so it does not scale we can achieve more consistent FPS or in some cases better FPS. It will be the older less GPU intensive games that see the most benefit.
To quickly illustrate this, I am going to run glxgears with vsync disabled in a terminal
vblank_mode=0 glxgears
21805 frames in 5.0 seconds = 4360.969 FPS
21947 frames in 5.0 seconds = 4389.193 FPS
21930 frames in 5.0 seconds = 4385.876 FPS
21966 frames in 5.0 seconds = 4392.969 FPS
21934 frames in 5.0 seconds = 4386.701 FPS
This is with GPU frequency scaling. The next set of results have frequency scaling disabled, GPU frequency is fixed to 2400MHz.
52209 frames in 5.0 seconds = 10441.599 FPS53527 frames in 5.0 seconds = 10705.146 FPS
53733 frames in 5.0 seconds = 10746.551 FPS
52087 frames in 5.0 seconds = 10417.353 FPS
53298 frames in 5.0 seconds = 10659.487 FPS
One thing to note, glxgears showing more than double the FPS isn't going to mean the same will be true for any game you play. I am only using it to verify the changes I made to the GPU frequency are working.
How do we change the GPU frequencies?
In the following location /sys/class/drm/card0/ there are two files called:
gt_min_freq_mhz
gt_max_freq_mhz
By simply writing new values to those files we can change the min and max GPU frequency, setting the min value to the same as the max value will disable scaling. To see what the default min and max values are type:
cat /sys/class/drm/card0/gt_min_freq_mhz
cat /sys/class/drm/card0/gt_max_freq_mhz
For my Intel Arc A770 this came up as 300 and 2400.
In ubuntu we will need to change the permissions of the two files so that we have write access. Any changes we make to these files will be lost on a reboot, so we need to change the permissions and put in our a custom value after every reboot.
To allow write access:
sudo chmod 666 /sys/class/drm/card0/gt_min_freq_mhz
And to now change the min frequency:
echo 2400 > /sys/class/drm/card0/gt_min_freq_mhz
In the above I am setting my min frequency to 2400MHz.
You can make these changes whilst playing your desired game, and if you have an FPS counter you can experiment to see how changing the values affect your performance.
Happy gaming!
Comments
Post a Comment
If you enjoyed this article please let me know!