FeralInteractive / gamemode

Optimise Linux system performance on demand
BSD 3-Clause "New" or "Revised" License
4.81k stars 186 forks source link

energy_uj errors in log even when iGPU optimization disabled #367

Open kroq-gar78 opened 2 years ago

kroq-gar78 commented 2 years ago

Describe the bug Per #337, gamemoded produces errors when reading /sys/class/powercap/intel-rapl*/*/energy_uj because it is usually run as an unprivileged user. Disabling iGPU optimization with igpu_power_threshold=-1 does not get rid of this error. Even though it is a non-fatal error, this log message can mislead users when debugging possible GameMode issues.

To Reproduce Steps used to reproduce the behavior:

  1. Run gamemoded
  2. Run gamemode-simulate-game in a separate terminal
  3. Output of gamemoded:
    Entering Game Mode...
    governor was initially set to [performance]
    Requesting update of governor policy to performance
    ERROR: Configured iGPU power threshold value '-1.000000' is invalid, ignoring iGPU default governor.
    ERROR: Failed to open file for read /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj

Expected behavior GameMode should not attempt to read energy_uj if iGPU optimization is disabled.

System Info (please complete the following information):

Additional context It looks like these 2 lines contain the only instances of calls to get_*energy_uj:

eternal-sorrow commented 1 year ago
Configured iGPU power threshold value '-1.000000' is invalid, ignoring iGPU default governor.

This doesn't seem right.