[RESOLVED] Changing CPU frequencies by GUI on Ryzen

RESOLVED

DO NOT disable “Cool n Quiet”


I have a Ryzen 5900X, and I was able to change the frequency by using cpufreqd/cpufrequtils & the CPU Frequency indicator (indicator-cpufreq on Ubuntu)

Now, for some reason, it’s not working. The indicator is not launching

$ indicator-cpufreq
\/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py:20: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py:21: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3 as appindicator
Traceback (most recent call last):
  File "/usr/bin/indicator-cpufreq", line 79, in <module>
    ind = MyIndicator(options.show_frequency)
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 99, in __init__
    self.update_ui()
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 110, in update_ui
    fmin, fmax, governor = cpufreq.get_policy(self.cpus[0])
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/cpufreq.py", line 143, in get_policy
    policy = (p.contents.min, p.contents.max, p.contents.governor.decode())
ValueError: NULL pointer access

$ indicator-cpufreq-selector 
Traceback (most recent call last):
  File "/usr/bin/indicator-cpufreq-selector", line 118, in <module>
    name = dbus.service.BusName("com.ubuntu.IndicatorCpufreqSelector", bus)
  File "/usr/lib/python3/dist-packages/dbus/service.py", line 133, in __new__
    retval = bus.request_name(name, name_flags)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 303, in request_name
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.173" is not allowed to own the service "com.ubuntu.IndicatorCpufreqSelector" due to security policies in the configuration file

$ indicator-cpufreq-selector 
Traceback (most recent call last):
  File "/usr/bin/indicator-cpufreq-selector", line 118, in <module>
    name = dbus.service.BusName("com.ubuntu.IndicatorCpufreqSelector", bus)
  File "/usr/lib/python3/dist-packages/dbus/service.py", line 133, in __new__
    retval = bus.request_name(name, name_flags)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 303, in request_name
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.173" is not allowed to own the service "com.ubuntu.IndicatorCpufreqSelector" due to security policies in the configuration file

$ sudo cpufreq-set -g ondemand
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

$ sudo cpufreq-set -g performance
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

$ sudo cpufreqd-get
No cpufreqd socket found
$ cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 2:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.

I also tried CoreCtrl, but nothing shows

Is there an alternative?

By chance did you update the kernel or application but not both?

What happens when you try to start cpufreqd? From the looks of it, it seems that is not running. Finding the reason for that may make the other thing fall in place.

It’s fixed now. I ran update-initramfs, and that seemed to have solved it next boot.

1 Like

That is not running automagically after installing or upgrading the kernel? I am surprise your kernel can even boot.

Actually, I spoke too soon. I don’t know how it worked before, but it stopped working again.

EDIT: solved (see top of the post)

1 Like

Interesting. I would imagine with UEFI you would be able to poke that register no matter what was set at uEFI BIOS. Good find.

Corectrl has no support for 5k series atm.

Guess that’s why it doesn’t say the name of my GPU at all.

Thank-you! I noticed on some of my Ubuntu 18.04.6 systems with Ryzen 7-series 2700 and 2700x CPUs after upgrading past kernel 5.4.0-80 that cpufreq stopped working. Sure enough all of these had Cool n Quiet disabled.

2 Likes

Glad it helped