Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

Post Reply
spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by spookywatcher » Fri, 8. Apr 22, 22:56

All of the testing was done on 5950x and 6900xt on an Asus Crosshair Viii hero wifi. This will undoubtedly give you the very best out of your amd gpu in Linux.

First: Obvious - but maybe not to some. Enable xmp or docp in bios to get the most out of you RAM.
Second: Enable smart access memory if you can in your bios - This gave me a 3-4 fps increase you can check to see if it is actually enabled by the command line:

Code: Select all

AMD_DEBUG=info glxinfo | grep vram
the output will look something like this:

Code: Select all

vram_size = 16384 MB
    vram_vis_size = 16368 MB
    vram_type = 9
    vram_bit_width = 256
    has_dedicated_vram = 1
    all_vram_visible = 1
The key part is vram_vis_size. If it matches your vram amount (vram_size) then Smart access memory (resizable bar) is working. If it says "256 mb" then it's not enabled.
Third: There are tools you can use to increase your gpu's power limit, pstate, clock state, fans etc. These are corectl or radeon-profile, etc. However I don't like using non repository code that needs elevated priveledges when I haven't reviewed the code. So I have my own commands in terminal to do all this.

First set cpu govornor to performance this really helps in busy sectors etc:

Code: Select all

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
Next set the gpu's performance level to high (it defaults to auto). High gives much better consistant and higher fps. Be careful though because your location of the /power_dpm_force_performance_level might be in a different place. Just have look around to find it:

Code: Select all

echo high | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level  <----- this might be in a different place just find yours
Next enable manual mode for the pwm fans on the gpu...once again the location of the file might/will be different for YOUR hardware:

Code: Select all

echo 1 | sudo tee /sys/class/drm/card0/device/hwmon/hwmon2/pwm1_enable 
  <--- again these might be in a different place so just adjust the command to fit YOUR system file locations
next set your gpu fan speed to desired % that will keep your amped up gpu cool enough. The value needs to be between 0 - 255 in 8 bit binary. I chose 192 which gives 75% locked fan speed:

Code: Select all

echo 192 | sudo tee /sys/class/drm/card0/device/hwmon/hwmon2/pwm1
Next increase your power limit. The 6900xt can do 300 watts but in Linux it is defaulted to 255 watts. I like to set mine to 283 watts:

Code: Select all

echo 283000000 | sudo tee /sys/class/drm/card0/device/hwmon/hwmon2/power1_cap
Next you can monitor your gpu with handy built in command. It'll give you everything except memory temp and junction temp:

Code: Select all

sudo watch -n 0.5  cat /sys/kernel/debug/dri/0/amdgpu_pm_info
You can also monitor gpu temps and fan speed etc in psensor. It's in the repo's.

Launch X4. This will give you the absolute best performance (You can even go up to your gpu's power limit if you want as long as you have good cooling). Now again...I know there is radeon-profile and corectl but again...I have not reviewed their code and it needs elevated priveledges so take your chances if you do. Corectl was amazingly great when I tested it. Very rock solid and does everything I mentioned here with a gui and even does fan curves for the gpu. You can do fan curves on your own but that is way too much for me to get into so setting a fixed % high enough to keep gpu cool is good enough if you don't want to do the same with corectl.

None of my commands are persistent. They will all go back to stock on reboot. Or you could echo the stock values in the above commands to go back to stock manually if you don't want to reboot. Without making these changes in Linux you are leaving performance on the table. Enough so that the game could appear stuttery etc. If you trust corectl / radeon-profile they do a phenomenal job but with ease and gui.

Hope it helps someone - enjoy

spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by spookywatcher » Fri, 8. Apr 22, 23:00

Forgot to mention freesync in Linux. To enable it you need to create a 20-radeon.conf file in /etc/X11/xorg.conf.d/
The contents should look like this:

Code: Select all

Section "Device"
  Identifier "AMD"
  Driver "amdgpu"
  Option "VariableRefresh" "true"
EndSection
Then make sure your monitor's freesync is enabled. Next and this is very important...You can ONLY have one monitor working in order to get freesync working. Disable any other montor(s).
Then enable vsync in the game menu. Yes...vsync does work better with freesync.

Imperial Good
Moderator (English)
Moderator (English)
Posts: 4760
Joined: Fri, 21. Dec 18, 18:23
x4

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Imperial Good » Sat, 9. Apr 22, 10:58

spookywatcher wrote:
Fri, 8. Apr 22, 22:56
First: Obvious - but maybe not to some. Enable xmp or docp in bios to get the most out of you RAM.
If the frequency of the memory kit is outside the range supported by the CPU then look out for system instability such as spontaneous reboots, crashes, e.t.c. If the kit is very expensive and supports a high transfer rate then on AMD CPUs you may wish to lower it to 3600 MHz odd to avoid the latency hit from not running 1:1 with the infinity fabric.
spookywatcher wrote:
Fri, 8. Apr 22, 22:56
next set your gpu fan speed to desired % that will keep your amped up gpu cool enough. The value needs to be between 0 - 255 in 8 bit binary. I chose 192 which gives 75% locked fan speed:
Locking fan speed is not optimal as high fan speed is only needed when the GPU is busy. Hence why they usually come with a fan curve.

If you want to increase fan speed under high workloads to encourage higher boost clocks then it is recommended to alter the fan curve so it goes higher at a lower temperature.
spookywatcher wrote:
Fri, 8. Apr 22, 22:56
Next increase your power limit. The 6900xt can do 300 watts but in Linux it is defaulted to 255 watts. I like to set mine to 283 watts:
This is overclocking. It will void your warrantee on the GPU. It also might lead to instability if your GPU is not sufficiently cooled such as in a poorly ventilated case, or if your PSU does not have sufficient headroom to handle the extra power draw.
spookywatcher wrote:
Fri, 8. Apr 22, 23:00
Then enable vsync in the game menu. Yes...vsync does work better with freesync.
Vertical sync defeats the purpose of dynamic refresh rates.

spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by spookywatcher » Sat, 9. Apr 22, 16:04

Imperial Good wrote:
Sat, 9. Apr 22, 10:58
spookywatcher wrote:
Fri, 8. Apr 22, 22:56
First: Obvious - but maybe not to some. Enable xmp or docp in bios to get the most out of you RAM.
If the frequency of the memory kit is outside the range supported by the CPU then look out for system instability such as spontaneous reboots, crashes, e.t.c. If the kit is very expensive and supports a high transfer rate then on AMD CPUs you may wish to lower it to 3600 MHz odd to avoid the latency hit from not running 1:1 with the infinity fabric.
spookywatcher wrote:
Fri, 8. Apr 22, 22:56
next set your gpu fan speed to desired % that will keep your amped up gpu cool enough. The value needs to be between 0 - 255 in 8 bit binary. I chose 192 which gives 75% locked fan speed:
Locking fan speed is not optimal as high fan speed is only needed when the GPU is busy. Hence why they usually come with a fan curve.

If you want to increase fan speed under high workloads to encourage higher boost clocks then it is recommended to alter the fan curve so it goes higher at a lower temperature.
spookywatcher wrote:
Fri, 8. Apr 22, 22:56
Next increase your power limit. The 6900xt can do 300 watts but in Linux it is defaulted to 255 watts. I like to set mine to 283 watts:
This is overclocking. It will void your warrantee on the GPU. It also might lead to instability if your GPU is not sufficiently cooled such as in a poorly ventilated case, or if your PSU does not have sufficient headroom to handle the extra power draw.
spookywatcher wrote:
Fri, 8. Apr 22, 23:00
Then enable vsync in the game menu. Yes...vsync does work better with freesync.
Vertical sync defeats the purpose of dynamic refresh rates.
Some good stuff in there to help people except vsync. There are many articles that disprove the whole notion that you have to have vsync off when using freesync/gsync. And in my own testing...Vsync coupled with freesync and or gsync yields MUCH smoother gameplay. It does add the slightest amount of input lag...but that's not relevant in this game. In fact AMD themselves recommend vsync ON when using freesync.

https://www.amd.com/en/technologies/free-sync-settings
Recommended Settings for Ultimate Fluid Gameplay

FreeSync ON
Radeon™ Anti-lag2 ON
VSync ON

For gamers looking for the most fluid gaming experience, turning on VSync will ensure full frames are displayed when above the refresh rate range. In non-ultra-competitive scenarios, the input lag introduced is negligible and the benefit gained is an optimized fluid gaming experience.
And again in my testing...without question vsync ON.

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Skeeter » Sat, 9. Apr 22, 16:26

Imperial Good wrote:
Sat, 9. Apr 22, 10:58
spookywatcher wrote:
Fri, 8. Apr 22, 22:56

Then enable vsync in the game menu. Yes...vsync does work better with freesync.
Vertical sync defeats the purpose of dynamic refresh rates.
A amd rep on ocuk forums said vsync on and freesync are a good thing and actually the right way to do it. Not gona explain it here but its what amd suggests. Freesync basically negates the latency of vsync but vsync helps make sure the monitor is in the right freq or something like that.

Think it was this post but coulda been another.

https://forums.overclockers.co.uk/posts/28767845
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

Imperial Good
Moderator (English)
Moderator (English)
Posts: 4760
Joined: Fri, 21. Dec 18, 18:23
x4

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Imperial Good » Sat, 9. Apr 22, 17:13

spookywatcher wrote:
Sat, 9. Apr 22, 16:04
Some good stuff in there to help people except vsync. There are many articles that disprove the whole notion that you have to have vsync off when using freesync/gsync. And in my own testing...Vsync coupled with freesync and or gsync yields MUCH smoother gameplay. It does add the slightest amount of input lag...but that's not relevant in this game. In fact AMD themselves recommend vsync ON when using freesync.
Reading up about the subject it seems that they recommend the driver level vertical sync be enabled and in game vertical sync be disabled. This is because the driver level vertical sync setting might have additional features and be better optimised for operating with variable refresh rates than implementations used by games. At least on Nvidia GPUs, according to a blur buster article.

spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by spookywatcher » Sat, 9. Apr 22, 17:57

Imperial Good wrote:
Sat, 9. Apr 22, 17:13
spookywatcher wrote:
Sat, 9. Apr 22, 16:04
Some good stuff in there to help people except vsync. There are many articles that disprove the whole notion that you have to have vsync off when using freesync/gsync. And in my own testing...Vsync coupled with freesync and or gsync yields MUCH smoother gameplay. It does add the slightest amount of input lag...but that's not relevant in this game. In fact AMD themselves recommend vsync ON when using freesync.
Reading up about the subject it seems that they recommend the driver level vertical sync be enabled and in game vertical sync be disabled. This is because the driver level vertical sync setting might have additional features and be better optimised for operating with variable refresh rates than implementations used by games. At least on Nvidia GPUs, according to a blur buster article.
Thanks Good to know. Not sure how to implement that in Linux for amdgpu driver. I'll have to research. And not sure about nvidia driver level on linux. I think I remember it's an option in nvidia-settings. But if I remember correctly it never overridden the application settings with regard to aliasing. At least I was never successful in getting to work driver level.

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Skeeter » Sat, 9. Apr 22, 20:49

Imperial Good wrote:
Sat, 9. Apr 22, 17:13
spookywatcher wrote:
Sat, 9. Apr 22, 16:04
Some good stuff in there to help people except vsync. There are many articles that disprove the whole notion that you have to have vsync off when using freesync/gsync. And in my own testing...Vsync coupled with freesync and or gsync yields MUCH smoother gameplay. It does add the slightest amount of input lag...but that's not relevant in this game. In fact AMD themselves recommend vsync ON when using freesync.
Reading up about the subject it seems that they recommend the driver level vertical sync be enabled and in game vertical sync be disabled. This is because the driver level vertical sync setting might have additional features and be better optimised for operating with variable refresh rates than implementations used by games. At least on Nvidia GPUs, according to a blur buster article.
driver vsync is dx9 or lower not vulkan or dx12 titles, says as much in the tooltip. Enhanced vsync is iffy for most so most dont use it.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

twistedpaper
Posts: 1
Joined: Fri, 16. Sep 22, 07:51

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by twistedpaper » Fri, 16. Sep 22, 07:55

spookywatcher wrote:
Fri, 8. Apr 22, 22:56

Next increase your power limit. The 6900xt can do 300 watts but in Linux it is defaulted to 255 watts. I like to set mine to 283 watts:

Code: Select all

echo 283000000 | sudo tee /sys/class/drm/card0/device/hwmon/hwmon2/power1_cap
Hi, I was wondering what kernel and mesa version you are using? I am able to set everything, but the only thing that does not seem to take is the power limit. With a reference 6900XT I cannot move it past 255W. I can set it up to 295, but mangohud and corectrl, etc all report 255W and as a result my clock speeds are way down from what they can be.

Code: Select all

┬─[tpaper@tpaper:~]─[11:55:13 PM]
╰─>$ cat /sys/class/drm/card1/device/hwmon/hwmon3/power1_cap

283000000

Imperial Good
Moderator (English)
Moderator (English)
Posts: 4760
Joined: Fri, 21. Dec 18, 18:23
x4

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Imperial Good » Sat, 17. Sep 22, 05:00

twistedpaper wrote:
Fri, 16. Sep 22, 07:55
Hi, I was wondering what kernel and mesa version you are using? I am able to set everything, but the only thing that does not seem to take is the power limit. With a reference 6900XT I cannot move it past 255W. I can set it up to 295, but mangohud and corectrl, etc all report 255W and as a result my clock speeds are way down from what they can be.
I would suggest looking up how to overclock your GPU on the Linux distro you are using. Raising GPU power limits is part of GPU overclocking. If power limits can be raised can be down to driver and even the individual GPU firmware. Raising power limits might not even result in the GPU drawing more power as it could be limited by other factors. For example, the GPU cannot draw more power than the connectors plugged into it are ratted for.

Unless pushing very high resolutions with very high settings or running an extremely fast processor (i9 12900k, or R7 5800X3D) it is unlikely that the GPU should be running anywhere close to power limits when playing X4 due to it usually being CPU bottlenecked on any reasonably modern GPU. As such there might not be much, if any, performance to be gained by raising the GPU power limits.

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Skeeter » Sat, 17. Sep 22, 11:12

For amd cards/users most do undervolting as saves power and somehow u get same or better performance most report.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by spookywatcher » Tue, 20. Sep 22, 20:42

twistedpaper wrote:
Fri, 16. Sep 22, 07:55
spookywatcher wrote:
Fri, 8. Apr 22, 22:56

Next increase your power limit. The 6900xt can do 300 watts but in Linux it is defaulted to 255 watts. I like to set mine to 283 watts:

Code: Select all

echo 283000000 | sudo tee /sys/class/drm/card0/device/hwmon/hwmon2/power1_cap
Hi, I was wondering what kernel and mesa version you are using? I am able to set everything, but the only thing that does not seem to take is the power limit. With a reference 6900XT I cannot move it past 255W. I can set it up to 295, but mangohud and corectrl, etc all report 255W and as a result my clock speeds are way down from what they can be.

Code: Select all

┬─[tpaper@tpaper:~]─[11:55:13 PM]
╰─>$ cat /sys/class/drm/card1/device/hwmon/hwmon3/power1_cap

283000000
Have you enabled amd featuremask in GRUB to allow "overclocking"?

in grub next to "quiet splash" you need to add " amdgpu.ppfeaturemask=0xffffffff " without the quotes to your kernel parameters in GRUB. then do sudo update-grub then reboot.

spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by spookywatcher » Tue, 20. Sep 22, 20:43

spookywatcher wrote:
Tue, 20. Sep 22, 20:42
twistedpaper wrote:
Fri, 16. Sep 22, 07:55
spookywatcher wrote:
Fri, 8. Apr 22, 22:56

Next increase your power limit. The 6900xt can do 300 watts but in Linux it is defaulted to 255 watts. I like to set mine to 283 watts:

Code: Select all

echo 283000000 | sudo tee /sys/class/drm/card0/device/hwmon/hwmon2/power1_cap
Hi, I was wondering what kernel and mesa version you are using? I am able to set everything, but the only thing that does not seem to take is the power limit. With a reference 6900XT I cannot move it past 255W. I can set it up to 295, but mangohud and corectrl, etc all report 255W and as a result my clock speeds are way down from what they can be.

Code: Select all

┬─[tpaper@tpaper:~]─[11:55:13 PM]
╰─>$ cat /sys/class/drm/card1/device/hwmon/hwmon3/power1_cap

283000000
Have you enabled amd featuremask in GRUB to allow "overclocking"?

Code: Select all

sudo nano /etc/default/grub
in grub next to "quiet splash" you need to add " amdgpu.ppfeaturemask=0xffffffff " without the quotes to your kernel parameters in GRUB. then do sudo update-grub then reboot.

CulunTse
Posts: 130
Joined: Mon, 15. Jun 15, 08:10
x4

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by CulunTse » Fri, 23. Sep 22, 19:20

Alternative topic title:
"Tips and tricks to overclock and physically damage your GPU".

The technical tips are correct and valuable, but hardware damage is only a typo away.
(for example: are you really sure you're not setting a 3 kilowatt powerlimit with that 283000000 ? Did you type the zeros correctly?)

Imperial Good
Moderator (English)
Moderator (English)
Posts: 4760
Joined: Fri, 21. Dec 18, 18:23
x4

Re: Tips & Tricks to get the most out of RDNA 2 gpu's in Linux playing X4

Post by Imperial Good » Fri, 23. Sep 22, 19:44

CulunTse wrote:
Fri, 23. Sep 22, 19:20
(for example: are you really sure you're not setting a 3 kilowatt powerlimit with that 283000000 ? Did you type the zeros correctly?)
This is not a concern since modern GPU firmware will physically prevent the card from drawing that much power. This is why professional overclockers have to buy special overclocking GPUs, or perform "power shunt" mods to trick GPUs into thinking they are using less power than they are.

GPU firmware limits power usage to the maximum amount of power that can be drawn from all power sources. For example, the PCIe slot can at most supply 75W of power, and a single 8 pin PCIe connector 150W, so a card with 2x 8 pin connectors can draw at most 375W of power no matter what power limit you set at a driver level. Setting GPU power limits to insane values is pretty common and basically says "you can use as much power as you can". GPUs will usually not use anywhere near that much power (it is a limit, not a minimum), and when they do they will still be limited by power delivery and can still thermal throttle.

As a real example I have a RTX 3060 ti. This has 1x 8-pin PCIe power connector and is a 16x slot card. This means the total power it can draw is 150W + 75W = 225W. The stock GPU power limit is 200W. As such at most power the GPU can use is 225W which is effectively increasing power usage over stock by 12.5% or a 112.5% power limit, even if I were to try and force it to use 3 kW or 200% power limit.

Post Reply

Return to “X4: Foundations”