mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-11 05:14:40 +00:00
support builtin msr
This commit is contained in:
parent
e53e48b88c
commit
2012ffb231
1 changed files with 6 additions and 1 deletions
|
@ -57,7 +57,12 @@ public:
|
||||||
|
|
||||||
xmrig::Msr::Msr() : d_ptr(new MsrPrivate())
|
xmrig::Msr::Msr() : d_ptr(new MsrPrivate())
|
||||||
{
|
{
|
||||||
if (system("/sbin/modprobe msr allow_writes=on > /dev/null 2>&1") != 0) {
|
if(access("/sys/module/msr/parameters/allow_writes", F_OK) == 0) {
|
||||||
|
if(system("echo on > /sys/module/msr/parameters/allow_writes") != 0) {
|
||||||
|
d_ptr->available = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (system("/sbin/modprobe msr allow_writes=on > /dev/null 2>&1") != 0) {
|
||||||
LOG_WARN("%s " YELLOW_BOLD("msr kernel module is not available"), Msr::tag());
|
LOG_WARN("%s " YELLOW_BOLD("msr kernel module is not available"), Msr::tag());
|
||||||
|
|
||||||
d_ptr->available = false;
|
d_ptr->available = false;
|
||||||
|
|
Loading…
Reference in a new issue