1

cpupower fails sometime to execute with this error :

cpupower: error while loading shared libraries: libcpupower.so.0: cannot open shared object file: No such file or directory

I've compiled and installed the last cpupower tool from sources on my workstation.

The Makefile install command installs the libs in /usr/local/lib and my LD_LIBRARY_PATH is set accordingly :

syl@WorkStation-T3500:~$ echo $LD_LIBRARY_PATH 
:/usr/local/lib/

lrwxrwxrwx  1 root root     20 juin  26 11:46 libcpupower.so -> libcpupower.so.0.0.1
lrwxrwxrwx  1 root root     20 juin  26 11:46 libcpupower.so.0 -> libcpupower.so.0.0.1

-rwxr-xr-x 1 root root 77048 juin 26 11:46 libcpupower.so.0.0.1 l

A simple cpupower info query works nice :

syl@WorkStation-T3500:~$ cpupower frequency-info
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency:  Cannot determine or is not supported.
hardware limits: 1.20 GHz - 3.20 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 1.20 GHz and 3.20 GHz.
              The governor "powersave" may decide which speed to use
              within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 1.20 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes

Nervetheless, here is what happens when I try to set some policy :

syl@WorkStation-T3500:~$ sudo cpupower frequency-set --governor userspace
cpupower: error while loading shared libraries: libcpupower.so.0: cannot open shared object file: No such file or directory

May I ask you some hints about this strange issue ?

All the best

Sylvain

  • Is your LD_LIBRARY_PATH set correctly for the root user? – Time4Tea Jun 26 '18 at 10:34
0

I found out that LD_LIBRARY_PATH proper initialization is not enough, I had to add the lib path into /etc/ld.so.conf.d/x86_64-linux-gnu.conf :

syl@WorkStation-T3500:~$ sudo vim /etc/ld.so.conf.d/x86_64-linux-gnu.conf

# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/loca/lib/

Then :

syl@WorkStation-T3500:~$ sudo ldconfig

Which makes the thing work, but I cannot understand this :

 syl@WorkStation-T3500:~$ sudo cpupower frequency-set --governor userspace Setting cpu: 0
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?

Ok, nothing remains except to understand why this command is not operational...

Cheers !

Sylvain

0

The intel_pstate driver accepts only powersave or performance policy governors, not userspace. This restriction is enforced in the <kernel source>/drivers/cpufreq/intel_pstate.c file, by function intel_pstate_verify_policy:

static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
{
        struct cpudata *cpu = all_cpu_data[policy->cpu];

        update_turbo_state();
        cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
                                     intel_pstate_get_max_freq(cpu));

        if (policy->policy != CPUFREQ_POLICY_POWERSAVE &&
            policy->policy != CPUFREQ_POLICY_PERFORMANCE)
                return -EINVAL;

        intel_pstate_adjust_policy_max(policy, cpu);

        return 0;
}

If you really need to use the userspace governor, you'll need to switch to another CPUFreq driver. See this question for more details.

  • Many thanks for this hint, yes I came accross this point googling. – Sylvain Rousseau Jun 26 '18 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.