cpupower有时会因此错误而执行失败:
cpupower: error while loading shared libraries: libcpupower.so.0: cannot open shared object file: No such file or directory我已经在我的工作站上编译并安装了最后一个来源的cpupower工具。
Makefile install命令在/usr/local/lib中安装库,并相应地设置我的LD_LIBRARY_PATH:
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-x1根根77048 juin 26 11:46 libcpupower.so.0.0.1 L
一个简单的cpupower信息查询工作得很好:
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然而,下面是当我试图设置一些策略时所发生的事情:
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关于这个奇怪的问题,我可以问你一些提示吗?
万事如意
西尔万
发布于 2018-06-26 10:38:05
我发现仅仅初始化LD_LIBRARY_PATH是不够的,我不得不将lib路径添加到/etc/ld.so.con.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/然后:
syl@WorkStation-T3500:~$ sudo ldconfig但我不能理解这一点:
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?好吧,除了弄明白为什么这个命令不起作用.
干杯!
西尔万
发布于 2018-06-26 11:17:34
intel_pstate驱动程序只接受powersave或performance策略调控器,而不接受userspace。这个限制是强制的,在/drivers/cpufreq/intel_pstate.c按职能分类的档案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;
}如果确实需要使用userspace调控器,则需要切换到另一个CPUFreq驱动程序。有关更多细节,请参见此问题。
https://unix.stackexchange.com/questions/451982
复制相似问题