首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cpupower和libcpupower

cpupower和libcpupower
EN

Unix & Linux用户
提问于 2018-06-26 10:08:33
回答 2查看 1.6K关注 0票数 1

cpupower有时会因此错误而执行失败:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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信息查询工作得很好:

代码语言:javascript
复制
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

然而,下面是当我试图设置一些策略时所发生的事情:

代码语言:javascript
复制
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

关于这个奇怪的问题,我可以问你一些提示吗?

万事如意

西尔万

EN

回答 2

Unix & Linux用户

发布于 2018-06-26 10:38:05

我发现仅仅初始化LD_LIBRARY_PATH是不够的,我不得不将lib路径添加到/etc/ld.so.con.d/x86_64-linux-gnu.conf中:

代码语言:javascript
复制
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/

然后:

代码语言:javascript
复制
syl@WorkStation-T3500:~$ sudo ldconfig

但我不能理解这一点:

代码语言:javascript
复制
 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?

好吧,除了弄明白为什么这个命令不起作用.

干杯!

西尔万

票数 0
EN

Unix & Linux用户

发布于 2018-06-26 11:17:34

intel_pstate驱动程序只接受powersaveperformance策略调控器,而不接受userspace。这个限制是强制的,/drivers/cpufreq/intel_pstate.c按职能分类的档案intel_pstate_verify_policy

代码语言:javascript
复制
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驱动程序。有关更多细节,请参见此问题。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/451982

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档