gamemode.ini für AMD System

polyphase

Commander
Registriert
Dez. 2010
Beiträge
2.716
Erstmal Danke an @Tanzmusikus für den Tipp mit dem gamemode 👍

Ich habe aktuell ein AMD only System, also Ryzen 3800X und RX6700XT.
Die Beispiel gamemode.ini habe ich nun entsprechend angepasst, bin mir aber nicht sicher ob die ganzen Optionen korrekt gesetzt sind.

Wäre schönn wenn sich das mal jemand anschauen würde:
Code:
[general]
; The reaper thread will check every 5 seconds for exited clients, for config file changes, and for the CPU/iGPU power balance
reaper_freq=5

; The desired governor is used when entering GameMode instead of "performance"
desiredgov=performance
; The default governor is used when leaving GameMode instead of restoring the original value
;defaultgov=powersave

; The iGPU desired governor is used when the integrated GPU is under heavy load
;igpu_desiredgov=powersave
; Threshold to use to decide when the integrated GPU is under heavy load.
; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the
; integraged GPU is under heavy enough load to justify switching to
; igpu_desiredgov.  Set this to -1 to disable all iGPU checking and always
; use desiredgov for games.
;igpu_power_threshold=0.3

; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
softrealtime=off

; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
; will be negated and applied as a nice value (0 means no change). Defaults to 0.
renice=0

; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
; between 0 and 7 here (with 0 being highest priority), or one of the special values
; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
; currently, only the best-effort class is supported thus you cannot set it here
ioprio=0

; Sets whether gamemode will inhibit the screensaver when active
; Defaults to 1
inhibit_screensaver=1

[filter]
; If "whitelist" entry has a value(s)
; gamemode will reject anything not in the whitelist
;whitelist=RiseOfTheTombRaider

; Gamemode will always reject anything in the blacklist
;blacklist=HalfLife3
;    glxgears

[gpu]
; Here Be Dragons!
; Warning: Use these settings at your own risk
; Any damage to hardware incurred due to this feature is your responsibility and yours alone
; It is also highly recommended you try these settings out first manually to find the sweet spots

; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
;apply_gpu_optimisations=0

; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
gpu_device=0

; Nvidia specific settings
; Requires the coolbits extension activated in nvidia-xconfig
; This corresponds to the desired GPUPowerMizerMode
; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
;nv_powermizer_mode=1

; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
;nv_core_clock_mhz_offset=0
;nv_mem_clock_mhz_offset=0

; AMD specific settings
; Requires a relatively up to date AMDGPU kernel module
; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
amd_performance_level=high

[supervisor]
; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
;supervisor_whitelist=
;supervisor_blacklist=

; In case you want to allow a supervisor to take full control of gamemode, this option can be set
; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
;require_supervisor=0

[custom]
; Custom scripts (executed using the shell) when gamemode starts and ends
;start=notify-send "GameMode started"
;    /home/me/bin/stop_ethmining.sh

;end=notify-send "GameMode ended"
;    /home/me/bin/start_ethmining.sh

; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
;script_timeout=10
 
Wieso korrekt gesetzt?
Ich hatte da bisher noch gar nicht rein geschaut. ^^
GameMode installiert und fertig.

Sieht aber nicht absonderlich falsch aus auf den ersten Blick.
 
Damit die Karte in den richtigen Modus wechselt, muss man die Datei editieren.

So hab ich das zumindest verstanden 😅
 
So sieht meine gamemode.ini unter EndeavourOS aus:

Bash:
; The reaper thread will check every 5 seconds for exited clients, for config file changes, and for the CPU/iGPU power balance
reaper_freq=5

; The desired governor is used when entering GameMode instead of "performance"
desiredgov=performance
; The default governor is used when leaving GameMode instead of restoring the original value
;defaultgov=powersave

; The iGPU desired governor is used when the integrated GPU is under heavy load
igpu_desiredgov=powersave
; Threshold to use to decide when the integrated GPU is under heavy load.
; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the
; integraged GPU is under heavy enough load to justify switching to
; igpu_desiredgov.  Set this to -1 to disable all iGPU checking and always
; use desiredgov for games.
igpu_power_threshold=0.3

; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
softrealtime=off

; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
; will be negated and applied as a nice value (0 means no change). Defaults to 0.
renice=10

; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
; between 0 and 7 here (with 0 being highest priority), or one of the special values
; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
; currently, only the best-effort class is supported thus you cannot set it here
ioprio=0

; Sets whether gamemode will inhibit the screensaver when active
; Defaults to 1
inhibit_screensaver=1

[filter]
; If "whitelist" entry has a value(s)
; gamemode will reject anything not in the whitelist
;whitelist=RiseOfTheTombRaider

; Gamemode will always reject anything in the blacklist
;blacklist=HalfLife3
;    glxgears

[gpu]
; Here Be Dragons!
; Warning: Use these settings at your own risk
; Any damage to hardware incurred due to this feature is your responsibility and yours alone
; It is also highly recommended you try these settings out first manually to find the sweet spots

; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
;apply_gpu_optimisations=0

; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
;gpu_device=0

; Nvidia specific settings
; Requires the coolbits extension activated in nvidia-xconfig
; This corresponds to the desired GPUPowerMizerMode
; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
;nv_powermizer_mode=1

; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
;nv_core_clock_mhz_offset=0
;nv_mem_clock_mhz_offset=0

; AMD specific settings
; Requires a relatively up to date AMDGPU kernel module
; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
amd_performance_level=high

[supervisor]
; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
;supervisor_whitelist=
;supervisor_blacklist=

; In case you want to allow a supervisor to take full control of gamemode, this option can be set
; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
;require_supervisor=0

[custom]
; Custom scripts (executed using the shell) when gamemode starts and ends
;start=notify-send "GameMode started"
;    /home/me/bin/stop_ethmining.sh

;end=notify-send "GameMode ended"
;    /home/me/bin/start_ethmining.sh

; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
;script_timeout=10
 
  • Gefällt mir
Reaktionen: polyphase
Ich glaube das hier muss man noch ändern, sonst werden die GPU EInstellungen ignoriert:
Code:
[gpu]
; Here Be Dragons!
; Warning: Use these settings at your own risk
; Any damage to hardware incurred due to this feature is your responsibility and yours alone
; It is also highly recommended you try these settings out first manually to find the sweet spots

; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
;apply_gpu_optimisations=0

Bin mir da aber noch nicht so sicher
Ergänzung ()

Edit:
Gibt auch ne entsprechende Fehlermeldung beim Testlauf:
Code:
gamemoded -t
: Loading config
Loading config file [/usr/share/licenses/gamemode/gamemode.ini]
Config: Value ignored [] reaper_freq=5
Config: Value ignored [] desiredgov=performance
Config: Value ignored [] softrealtime=off
Config: Value ignored [] renice=10
Config: Value ignored [] ioprio=0
Config: Value ignored [] inhibit_screensaver=1
ERROR: The [gpu] config section is not configurable from unsafe config files! Option amd_performance_level will be ignored!
ERROR: Consider moving this option to /etc/gamemode.ini
: Running tests

:: Basic client tests
:: Passed

:: Dual client tests
gamemode request succeeded and is active
Quitting by request...
:: Passed

:: Gamemoderun and reaper thread tests
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Passed

:: Supervisor tests
:: Passed

:: Feature tests
::: Verifying CPU governor setting
::: Passed
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
::: Passed (gpu optimisations not configured to run)
::: Verifying renice
::: Passed (no renice configured)
::: Verifying ioprio
::: Passed
:: Passed

: All Tests Passed!
Ergänzung ()

Edit:
Ein verschieben der Datei nach "/etc/" hat schonmal die erste Fehlermeldung behoben:
Code:
gamemoded -t
: Loading config
Loading config file [/etc/gamemode.ini]
Config: Value ignored [] reaper_freq=5
Config: Value ignored [] desiredgov=performance
Config: Value ignored [] softrealtime=off
Config: Value ignored [] renice=10
Config: Value ignored [] ioprio=0
Config: Value ignored [] inhibit_screensaver=1
: Running tests

:: Basic client tests
:: Passed

:: Dual client tests
gamemode request succeeded and is active
Quitting by request...
:: Passed

:: Gamemoderun and reaper thread tests
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Passed

:: Supervisor tests
:: Passed

:: Feature tests
::: Verifying CPU governor setting
::: Passed
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
::: Passed (gpu optimisations not configured to run)
::: Verifying renice
::: Passed (no renice configured)
::: Verifying ioprio
::: Passed
:: Passed

: All Tests Passed!
 
Zuletzt bearbeitet:
polyphase schrieb:
Bin mir da aber noch nicht so sicher
Nö, das würde ich nicht tun. Ist wohl für automatisches OC'n der GPU.



Mit renice=4 oder renice=10 bekomme ich unter Pop!_OS eine Fehlermeldung.
Mit renice=0 nicht.

Bash:
gamemoded -t
: Loading config
Loading config file [/usr/share/gamemode/gamemode.ini]
: Running tests

:: Basic client tests
:: Passed

:: Dual client tests
gamemode request succeeded and is active
Quitting by request...
:: Passed

:: Gamemoderun and reaper thread tests
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Passed

:: Supervisor tests
:: Passed

:: Feature tests
::: Verifying CPU governor setting
::: Passed
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
::: Passed (gpu optimisations not configured to run)
::: Verifying renice
ERROR: Initial renice value is non-zero: -6
::: Failed!
::: Verifying ioprio
::: Passed
ERROR: :: Failed!
: Tests Failed!

Bash:
gamemoded -t
: Loading config
Loading config file [/usr/share/gamemode/gamemode.ini]
: Running tests

:: Basic client tests
:: Passed

:: Dual client tests
gamemode request succeeded and is active
Quitting by request...
:: Passed

:: Gamemoderun and reaper thread tests
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Passed

:: Supervisor tests
:: Passed

:: Feature tests
::: Verifying CPU governor setting
::: Passed
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
::: Passed (gpu optimisations not configured to run)
::: Verifying renice
::: Passed (no renice configured)
::: Verifying ioprio
::: Passed
:: Passed

: All Tests Passed!
 
Ich habs wieder ausgeschaltet, hat wohl wirklich was mit OC zu tun.

Des Weiteren ignoriert meine Grafikkarte "amd_performance_level=high" einfach.
Es funktioniert nur, wenn ich es manuell setze
 
Ändere mal testweise gpu_device=0 in ;gpu_device=0 in der gamemode.ini.
Bei mir ist Letzteres Standard. Somit werden vermutlich alle GPUs erkannt & genutzt, nicht nur "card0".


Danke @polyphase für den Tipp!!

Hab jetzt die ini-Datei nach /etc/gamemode.ini verschoben (bzw. kopiert & bisherige umbenannt).
Nun kommt keine Fehlermeldung mehr, wenn ich unter EndeavourOS & Pop!_OS renice=4 eintrage.

Bash:
gamemoded -t
: Loading config
Loading config file [/etc/gamemode.ini]
: Running tests

:: Basic client tests
:: Passed

:: Dual client tests
gamemode request succeeded and is active
Quitting by request...
:: Passed

:: Gamemoderun and reaper thread tests
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Passed

:: Supervisor tests
:: Passed

:: Feature tests
::: Verifying CPU governor setting
::: Passed
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
::: Passed (gpu optimisations not configured to run)
::: Verifying renice
::: Passed
::: Verifying ioprio
::: Passed
:: Passed

: All Tests Passed!

Die gamemode.ini soll halt an einem "sicheren" Ort im Dateisystem liegen. :daumen:
 
Zuletzt bearbeitet:
Tanzmusikus schrieb:
Mit renice=4 oder renice=10 bekomme ich unter Pop!_OS eine Fehlermeldung.
Mit renice=0 nicht.
Hhier auch, hab grad die gamemode.ini eingerichtet, alles außer 0 ergibt 'ne Fehlermeldung.
Benutzer ist in der Gruppe gamemode (existierte nicht, selbst angelegt).

EDIT:
Verschieben nach /etc ändert nichts daran
 
Du musst noch die Datei nach /etc/gamemode.ini verschieben, dann geht's!
Es darf keine weitere gamemode.ini im home-Verzeichnis liegen, vor allem nicht in .config.

rarp schrieb:
Verschieben nach /etc ändert nichts daran
Zeig mal bitte den Inhalt deiner gamemode.ini!
 
Ich musste erste den Benutzer zur schon vorhandenen Gruppe "gamemode" hinzufügen, damit renice funktioniert.
EndeavourOS (Arch)


Also folgendes ist mir mit "renice" aufgefallen, beim Testen mit glxgears:
Befehl dazu:
Code:
vblank_mode=0 gamemoderun glxgears

Renice 10:
Code:
120373 frames in 5.0 seconds = 24074.451 FPS
123375 frames in 5.0 seconds = 24674.773 FPS
116921 frames in 5.0 seconds = 23384.158 FPS
120559 frames in 5.0 seconds = 24111.713 FPS

Renice 4:
Code:
124937 frames in 5.0 seconds = 24987.229 FPS
120235 frames in 5.0 seconds = 24046.852 FPS
127885 frames in 5.0 seconds = 25576.939 FPS
130767 frames in 5.0 seconds = 26153.381 FPS

Renice 0:
Code:
135148 frames in 5.0 seconds = 27029.557 FPS
126567 frames in 5.0 seconds = 25313.332 FPS
139310 frames in 5.0 seconds = 27861.957 FPS
141233 frames in 5.0 seconds = 28246.436 FPS

Die Einstellung "amd_performance_level=high" bewirkt überhaupt nichts!
Die Grafikkarte wechselt weiterhin fleißig den Takt zwischen 500 und 2650MHz ingame.

Wenn ich die Karte manuell auf "high" festnagel, hält die den Takt.
(alle renice Messungen waren mit 2650MHz)
Ergänzung ()

Edit:
Ohne Gamemode habe ich sogar noch bessere Werte:
Code:
142569 frames in 5.0 seconds = 28513.729 FPS
143030 frames in 5.0 seconds = 28605.926 FPS
138642 frames in 5.0 seconds = 27728.314 FPS
141033 frames in 5.0 seconds = 28206.508 FPS
 
Zuletzt bearbeitet:
  • Gefällt mir
Reaktionen: Tanzmusikus
Tanzmusikus schrieb:
Du musst noch die Datei nach /etc/gamemode.ini verschieben, dann geht's!
Es darf keine weitere gamemode.ini im home-Verzeichnis liegen, vor allem nicht in .config.

Zeig mal bitte den Inhalt deiner gamemode.ini!
Mom, ich bin grad über die /usr/etc/security/limits.conf gestolpert und teste noch etwas rum:
https://forums.opensuse.org/t/allow-feral-gamemode-to-renice-processes/164004
https://github.com/FeralInteractive/gamemode/issues/291#issuecomment-725656258
 
Pop!_OS hat es automatisch im /usr/share-Bereich abgelegt. Sehr vorbildlich von Ubuntu/Pop!_OS.
 
@rarp
Unter Arch liegt im Verzeichnis: "/etc/security/limits.d" eine "10-gamemode.conf"

mit folgendem Inhalt:
Code:
@gamemode - nice -10

Damit sind Benutzer der Gruppe "gamemode" Werte bis "-10" erlaubt
 
Die kann man natürlich mit Admin-Rechten ändern, wenn man das möchte.

@polyphase
Die FPS sollte man vielleicht besser mit einem Spiel ermitteln als mit dem synthetischen "glxgears", oder?
 
@Tanzmusikus
Läuft jetzt mit renice=10 in /etc/gamemode.ini.
Ich habe jeweils @<benutzergruppe> - nice -10 in /usr/etc/security/limits.conf und /usr/etc/security/limits.d/10-gamemode.conf (selbst angelegt) eingetragen.
Vielleicht hätte Letztere ausgereicht, aber sei's drum.

Tanzmusikus schrieb:
@polyphase
Die FPS sollte man vielleicht besser mit einem Spiel ermitteln als mit dem synthetischen "glxgears", oder?
Möglich, aber prinzipiell 'ne gute Idee, insbesondere die Frametimes würden mich interessieren.
Mit Mangohud ließe sich das theoretisch aufzeichnen und vergleichen, siehe hier.
Ich bin da nur etwas skeptisch bzgl. der dort aufgezeichneten FPS-Spikes (liegen z.T. weit über eingestelltem FPS-Limit), weil diese Ausreißer ja auch bei Frametimes auftreten könnten.
 
  • Gefällt mir
Reaktionen: Tanzmusikus
Die FPS-Spikes habe ich in Spielen bereits öfter wahrgenommen.
Der FPS-Limiter greift häufig gerade beim Laden von Daten erst einige (Milli)Sekunden später.
 
Tanzmusikus schrieb:
Die FPS sollte man vielleicht besser mit einem Spiel ermitteln als mit dem synthetischen "glxgears", oder?
Ich habe jetzt mal mit Planet Coaster getestet, einem großen Park mit ca. 8500 Besuchern.
Maximale Einstellungen bei WQHD. Das Spiel ist bekannt für etwas niedrigere FPS unter Linux.
Hier wäre am meisten rauszuholen:

Folgendes Ergebnis:

Gamemode:
25FPS
GPU Auslastung 64% bei 1406MHz
CPU Auslastung bei 52% bei 4224MHz


ohne Gamemode (manuell Höchtleistung erzwungen)
25FPS
GPU Auslastung 36% bei 2665MHz
CPU Auslastung bei 52% bei 4224MHz

Also auch hier bringt der Gamemode quasi garnichts.
ggf. bringt der nur was bei Systemen mit einem älteren Kernel?

Ich habe aktuell Kernel: 6.4.4-arch1-1
 
  • Gefällt mir
Reaktionen: rarp und Tanzmusikus
Zurück
Oben