mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 02:34:58 +00:00
Fixed MSR.
This commit is contained in:
parent
de7ed2b968
commit
96ee721d21
2 changed files with 17 additions and 8 deletions
|
@ -17,7 +17,7 @@
|
||||||
"init": -1,
|
"init": -1,
|
||||||
"mode": "auto",
|
"mode": "auto",
|
||||||
"1gb-pages": false,
|
"1gb-pages": false,
|
||||||
"wrmsr": 6,
|
"wrmsr": true,
|
||||||
"numa": true
|
"numa": true
|
||||||
},
|
},
|
||||||
"cpu": {
|
"cpu": {
|
||||||
|
|
|
@ -95,6 +95,18 @@ static bool wrmsr_on_all_cpus(uint32_t reg, uint64_t value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool wrmsr_modprobe()
|
||||||
|
{
|
||||||
|
if (system("/sbin/modprobe msr > /dev/null 2>&1") != 0) {
|
||||||
|
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "msr kernel module is not available", rx_tag());
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,17 +116,14 @@ void xmrig::Rx::osInit(const RxConfig &config)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (system("/sbin/modprobe msr > /dev/null 2>&1") != 0) {
|
if (Cpu::info()->assembly() == Assembly::RYZEN && wrmsr_modprobe()) {
|
||||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "msr kernel module is not available", rx_tag());
|
wrmsr_on_all_cpus(0xC0011022, 0x510000);
|
||||||
|
wrmsr_on_all_cpus(0xC001102b, 0x1808cc16);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Cpu::info()->vendor() == ICpuInfo::VENDOR_AMD) {
|
if (Cpu::info()->vendor() == ICpuInfo::VENDOR_INTEL && wrmsr_modprobe()) {
|
||||||
wrmsr_on_all_cpus(0xC0011022, 0x510000);
|
|
||||||
wrmsr_on_all_cpus(0xC001102b, 0x1808cc16);
|
|
||||||
}
|
|
||||||
else if (Cpu::info()->vendor() == ICpuInfo::VENDOR_INTEL) {
|
|
||||||
wrmsr_on_all_cpus(0x1a4, config.wrmsr());
|
wrmsr_on_all_cpus(0x1a4, config.wrmsr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue