为什么我的 Ubuntu 机器没有 /dev/cpu/0/cpuid 目录?
Why does my Ubuntu machine not have the /dev/cpu/0/cpuid directoy?
我尝试 运行 ./TurionPowerControl -spec
从以下 link 获得(请注意,它必须稍作修改才能与较新的 GCC 兼容):
https://github.com/turionpowercontrol/tpc/wiki
我得到以下输出:
Turion Power States Optimization and Control - by blackshard
ERROR: couldn't open /dev/cpu/0/cpuid (No such file or directory). Make sure that cpuid module is loaded.
我的问题很简单:为什么我的系统中没有这样的文件或目录?我在 Dell Inspiron 1501 笔记本电脑上使用 Ubuntu Server 18.04.4 LTS。我查看了代码,在 sysdep-linux.cpp 中找到了以下片段,我认为它包含输出错误消息的代码行:
#include <term.h>
#include <curses.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include "cpuPrimitives.h"
bool initializeCore()
{
int fd;
fd = open("/dev/cpu/0/cpuid", O_RDONLY);
if (fd == -1) {
printf("ERROR: couldn't open /dev/cpu/0/cpuid (%s).", strerror(errno));
if (errno == ENXIO || errno == ENOENT) {
printf(" Make sure that cpuid module is loaded.\n");
return false;
}
if (errno == EACCES) {
printf(" Not root?.\n");
return false;
}
printf("\n");
return false;
.
.
.
可能是因为,如this article所示,它使用默认未安装的CPUID设备驱动程序:
sudo apt-get install -y cpuid
OP Nicholas confirms having to add a modules (modprob)
sudo modprobe cpuid
我尝试 运行 ./TurionPowerControl -spec
从以下 link 获得(请注意,它必须稍作修改才能与较新的 GCC 兼容):
https://github.com/turionpowercontrol/tpc/wiki
我得到以下输出:
Turion Power States Optimization and Control - by blackshard
ERROR: couldn't open /dev/cpu/0/cpuid (No such file or directory). Make sure that cpuid module is loaded.
我的问题很简单:为什么我的系统中没有这样的文件或目录?我在 Dell Inspiron 1501 笔记本电脑上使用 Ubuntu Server 18.04.4 LTS。我查看了代码,在 sysdep-linux.cpp 中找到了以下片段,我认为它包含输出错误消息的代码行:
#include <term.h>
#include <curses.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include "cpuPrimitives.h"
bool initializeCore()
{
int fd;
fd = open("/dev/cpu/0/cpuid", O_RDONLY);
if (fd == -1) {
printf("ERROR: couldn't open /dev/cpu/0/cpuid (%s).", strerror(errno));
if (errno == ENXIO || errno == ENOENT) {
printf(" Make sure that cpuid module is loaded.\n");
return false;
}
if (errno == EACCES) {
printf(" Not root?.\n");
return false;
}
printf("\n");
return false;
.
.
.
可能是因为,如this article所示,它使用默认未安装的CPUID设备驱动程序:
sudo apt-get install -y cpuid
OP Nicholas confirms
sudo modprobe cpuid