Failed to apply msr mod hashrate will be low linux

Failed to apply msr mod hashrate will be low linux

Hardware prefetchers is a fundamental performance issue, RandomX accesses memory randomly, so prefetchers just don’t work. All places where prefetching can help already have explicit prefetch instructions in the code. Sometimes prefetchers can be disabled in BIOS, for Intel it usually Hardware Prefetcher and Adjacent Cache Line Prefetch, but some prefetchers not possible disable even in BIOS.

With some hardware/software configurations is also need to disable Secure Boot to make MSR mod works, please check issue #1891 on github.

XMRig revert initial MSR values on exit by default, anyway changes is not persistent, computer reboot always reset any changes.

Reddit discussions

Configuration

For configuration 2 options available in «randomx» object: «rdmsr» and «wrmsr»

rdmsr boolean

Use «rdmsr»: false to disable reverting initial MSR values on exit.

wrmsr boolean

«wrmsr»: true (by default) enable MSR feature or «wrmsr»: false to disable MSR feature.

wrmsr number

«wrmsr»: 15 Only available for Intel. Default value 15 for Intel good in general, but may not best, please check issue #1433 on github for details.

wrmsr array

Very advanced format, for precise configuration with caution. Preset values shipped with the miner:

  • «wrmsr»: [«0x1a4:0xf»] Intel preset.
  • «wrmsr»: [«0xc0011020:0x4480000000000», «0xc0011021:0x1c000200000040:0xffffffffffffffdf», «0xc0011022:0xc000000401500000», «0xc001102b:0x2000cc14»] AMD Ryzen (Zen3).
  • «wrmsr»: [«0xc0011020:0x0», «0xc0011021:0x40:0xffffffffffffffdf», «0xc0011022:0x1510000», «0xc001102b:0x2000cc16»] AMD Ryzen (Zen1/Zen2).
  • «wrmsr»: [«0xc0011020:0x0», «0xc0011021:0x60», «0xc0011022:0x510000», «0xc001102b:0x1808cc16»] Special custom value for first generation Zen CPUs (with known hardware bug) to disable opcache and enable MSR mod.

Manual OS configuration

Manual configuration on Windows is a very complicated process and is not recommended, please check out the original post on Reddit for details.

Источник

xmrig 3.0 дает ощутимый прирост хешрейта при майнинге Monero

Команда разработчиков майнера xmrig не сидит сложа руки. 15.12.2019 они выпустили очередной релиз майнера xmrig 3.0, в котором встроена поддержка оптимизации майнинга с помощью MSR мода CPU под Windows (эта опция уже реализована для Linux в версиях 5.2.0+ для Intel и 5.2.1+ для Ryzen).

Воздействие на регистры процессора непосредственно в операционной системе дает прирост в хешрейте при майнинге на алгоритме RandomX на не менее, чем 5% на процессорах Intel и до 15% на CPU AMD Ryzen.

Что такое MSR мод?

В программе xmrig 3.0+ реализовано воздействие на MSR (моделезависимые регистры процессора) в ОС Windows с помощью драйвера WinRing0 (разработка OpenLibSys.org).

Этот драйвер выполняет функцию отключения в BIOS опций Hardware Prefetcher и Adjacent Cache Line Prefetch, которые негативно влияют на хешрейт при майнинге на алгоритме RandomX.

Эта полезная опция дает возможность более эффективно проводить вычисления на RandomX даже на компьютерах, у которых в BIOS отсутствует опция отключения функций Hardware Prefetcher и Adjacent Cache Line Prefetch.

Запуск программы xmrig от имени админа и включение функции MSR дает выигрыш в производительности на RandomX порядка 5-15%.

Читайте также:  Как быстро уничтожить windows

К сожалению, функция оптимизации MSR работает только на относительно новых процессорах, а именно:

  • Intel (Nehalem, Westmere, Sandy Bridge, Ivy Bridge, Haswell, Broadwell и более новые);
  • Ryzen (все Zen CPU: Ryzen, Threadripper, EPYC и т.д.).

Как использовать xmrig с MSR модом?

Для активации MSR мода нужно запустить один раз майнер xmrig с правами администратора.

Это делается в контекстном меню, возникающем после нажатия правой кнопкой мыши на батнике для запуска xmrig:

Также можно выставить запуск исполняемого файла майнера xmrig в его свойствах.

Для этого правой кнопкой мыши вызывают контекстное меню программы xmrig и нажимают на свойства:

Затем на вкладке совместимости активируют опцию запуска от имени админа и применяют изменения:

При самостоятельной компиляции программы xmrig (или xmrig-notls для версии без шифрования трафика) нужно не забыть скопировать в папку с майнером файл драйвера winring под названием WinRing0x64.sys:

Для компиляции новой версии майнера xmrig (для Windows методика описана здесь) нужно обновить папку dependencies, скачав свежий набор библиотек с Github.

Возможные проблемы с запуском xmrig в режиме MSR

Если в директории с майнером xmrig нет драйвера MSR (файла WinRing0x64.sys), то возникает ошибка с кодом failed to start winring0 driver, error 2:

Если майнер не запущен с правами админа, то возникает ошибка вида failed to stop winring0 driver, error 1062:

При успешном запуске обновленной версии майнера с драйвером режима MSR в консоли манера ошибок не возникает и появляется зеленая строка register values for Intel has been set successfully:

В ubuntu при запуске xmrig может возникнуть ошибка msr kernel module is not available. Она решается установкой пакета msr-tools командами:

После этого нужно снова запустить xmrig в режиме суперпользователя:

Кроме того, может понадобиться (повторная) установка библиотек:

Результаты включения опции MSR очень радуют. Например, прирост хешрейта для процессора Интел I3-8100K в Windows составляет 18% (было 1500, стало 1770 h/s), а в Ubuntu — 1820 h/s.

Компиляция майнера xmrig с поддержкой видеокарт Nvidia описана в статье «Компиляция программы xmrig с плагином для видеокарт Nvidia«.

Источник

«msr kernel module is not available» #2165

Comments

appletechgeek commented Mar 8, 2021

for some reason even when running xmrig in sudo. i stil get the msr fnot working error.

The text was updated successfully, but these errors were encountered:

SChernykh commented Mar 8, 2021

You’re running it inside a VM. MSR mod doesn’t work there because there is no access to a physical CPU.

jabronimus commented Mar 9, 2021 •

You’re running it inside a VM. MSR mod doesn’t work there because there is no access to a physical CPU.

This is incorrect. I am getting the same issue, and I am 100% not running it on a virtual machine — I am running it on a physical machine with Ubuntu 18.0. I did not have this issue in previous versions of xmrig. This only started with this most recent version.

Things I have tried, based on all the internet searches I’ve done and people having this problem in the past, include:

  1. Running the program with sudo
  2. Running the program as root
  3. Installing msr-tools
  4. Applying «randomx_boost.sh»
  5. Rebooting and trying all of the above again

What I’m noticing is that only some of the algorithms have this MSR mod issue, while some don’t.

For example, my benchmark for algorithm panthera has a hashrate of 406.3 H/s.

My benchmark for algo cn-heavy/xhv has a hashrate of 24.8 H/s, and shows «cannot read MSR 0x000001a4 / FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW» during benchmarking.

My benchmark for algo rx/0 also shows the «cannot read MSR . » error as above, but the hashrate is higher at 141.9 H/s.

I also notice that at the top of the output when I run xmrig, I get this line: «hwloc auto configuration for algorithm «cn-heavy/0″ failed.» I’m assuming this is related.

For now, I plan on deactivating the cn-heavy algorithm and possibly the rx/0 algorithm in the config file so xmrig doesn’t try to use them.

Читайте также:  Install common lisp windows

SChernykh commented Mar 9, 2021

@jabronimus We’re not responsible for possible bugs in MoneroOcean’s version. If you have issues with stock XMRig, create a new issue.

jabronimus commented Mar 9, 2021

@jabronimus We’re not responsible for possible bugs in MoneroOcean’s version. If you have issues with stock XMRig, create a new issue.

That’s fair — I could try building the official version and see if I get the same bug. Let me try it and see what happens!

jabronimus commented Mar 9, 2021 •

@jabronimus We’re not responsible for possible bugs in MoneroOcean’s version. If you have issues with stock XMRig, create a new issue.

@SChernykh Ok. I tried building the official version of xmrig — not the MoneroOcean version — using both the «Basic» build instructions and the «Advanced» build instructions. (I even took out the MoneroOcean pools that I was using, just because.)

Am getting the same error in terms of «cannot read MSR 0x000001a4 / FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW».

I’m happy to make this as a new issue if you’d like. (This is my first post on github, so I’m not sure what the proper protocol is.)

Here you go — as I said, happy to make this a new issue.

SChernykh commented Mar 9, 2021

Can you try older versions and find the first one where MSR doesn’t work? You can just download compiled binaries for a quick test.

jabronimus commented Mar 9, 2021

Can you try older versions and find the first one where MSR doesn’t work? You can just download compiled binaries for a quick test.

@SChernykh — Yes! Would be happy to. Let’s see what happens.

Spudz76 commented Mar 11, 2021 •

@jabronimus:
Panthera msr-apply is broken and I can’t find the bug yet, it doesn’t trigger the msr-apply step even though it’s in the right family, which should be plenty to trigger it.

Other than that RandomX family and CN-Heavy are the only ones that get help from cache lookahead msr and thus are the only ones it attempts to apply (as you noticed). Normal for no attempt at msr write on all other algos.

Also those hashrates all look pretty good anyway. The «LOW HASHRATE» warning is not exactly telling the truth, come CPUs don’t have a gain with prefetches turned off, some especially Atom or Celeron don’t even have the cache option MSR (but xmrig will still try it).

Pentium N3710 wow 6W TDP is amazing. You’re a bit short on cache size. Very likely has no cache-control MSRs.

@appletechgeek (OP) Could try blocking all kvm modules to avoid putting host cpu into VM mode. Have seen a few cases where having some virtualization server or client installed will flip the main cpu to VM mode for no real reason.

jabronimus commented Mar 11, 2021

@jabronimus:
Panthera msr-apply is broken and I can’t find the bug yet, it doesn’t trigger the msr-apply step even though it’s in the right family, which should be plenty to trigger it.

Other than that RandomX family and CN-Heavy are the only ones that get help from cache lookahead msr and thus are the only ones it attempts to apply (as you noticed). Normal for no attempt at msr write on all other algos.

Also those hashrates all look pretty good anyway. The «LOW HASHRATE» warning is not exactly telling the truth, come CPUs don’t have a gain with prefetches turned off, some especially Atom or Celeron don’t even have the cache option MSR (but xmrig will still try it).

Pentium N3710 wow 6W TDP is amazing. You’re a bit short on cache size. Very likely has no cache-control MSRs.

Читайте также:  Arch linux драйвера звука

@appletechgeek (OP) Could try blocking all kvm modules to avoid putting host cpu into VM mode. Have seen a few cases where having some virtualization server or client installed will flip the main cpu to VM mode for no real reason.

@SChernykh — Sorry for the late reply. The very day we talked previously, I started downloading each prior version of XMRig that had a bionic release, all the way back to 6.3.3. Weirdly, I couldn’t find a release that didn’t have the error we mentioned before. I didn’t go back to 6.3.2 or further because there were only Xenial releases for those versions. So, I figured maybe the issue was with my hardware (or something else in my Ubuntu 18.04 setup) as opposed to the base xmrig software.

@Spudz76 Thank you for your reply. It’s interesting that Pantera is the one with the bug, and that’s why it doesn’t show the msr error that we were mentioning previously!

Just as an aside — when I try to run the «./randomx_boost» script, I get the following output:

I don’t really know what it means on my machine that » CPU 0 cannot set MSR 0x000001a4 to 0x000000000000000f», and I do already have msr-tools installed as you can see . not really sure what the issue is but thought perhaps it had something to do with my hardware or Ubuntu setup (though, there’s nothing super fancy or modified about my setup).

Источник

FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW #2534

Comments

marqanton commented Aug 12, 2021

I am getting the below message when running xmrig on a dell computer. I am trying to mine ZCH. Please find the output below.

I am running it with root.

[root@master xmrig-6.13.1]# ./xmrig

  • ABOUT XMRig/6.13.1 gcc/5.4.0
  • LIBS libuv/1.41.0 OpenSSL/1.1.1k hwloc/2.4.1
  • HUGE PAGES supported
  • 1GB PAGES disabled
  • CPU Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz (1) 64-bit AES
    L2:1.5 MB L3:9.0 MB 6C/6T NUMA:1
  • MEMORY 4.1/7.5 GB (54%)
    DIMM1: 8 GB DDR4 @ 2666 MHz HMA81GS6JJR8N-VK
    DIMM2:
  • MOTHERBOARD Dell Inc. — 03KWTV
  • DONATE 1%
  • ASSEMBLY auto:intel
  • POOL #1 rx.unmineable.com:3333 algo auto
  • COMMANDS hashrate, pause, resume, results, connection
  • OPENCL disabled
  • CUDA disabled
    [2021-08-12 09:26:47.232] net use pool rx.unmineable.com:3333 139.59.164.251
    [2021-08-12 09:26:47.232] net new job from rx.unmineable.com:3333 diff 100001 algo rx/0 height 2425479
    [2021-08-12 09:26:47.232] cpu use argon2 implementation AVX2
    [2021-08-12 09:26:47.243] msr cannot set MSR 0x000001a4 to 0x000000000000000f
    [2021-08-12 09:26:47.243] msr FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW
    [2021-08-12 09:26:47.243] randomx init dataset algo rx/0 (6 threads) seed 9c34f003984b0df9.
    [2021-08-12 09:26:47.671] randomx allocated 2336 MB (2080+256) huge pages 100% 1168/1168 +JIT (428 ms)
    [2021-08-12 09:26:52.350] net new job from rx.unmineable.com:3333 diff 100001 algo rx/0 height 2425480
    [2021-08-12 09:26:52.436] signal Ctrl+C received, exiting
    [2021-08-12 09:26:52.471] msr cannot set MSR 0x000001a4 to 0x0000000000000000
    [2021-08-12 09:26:52.471] msr failed to restore initial state (34 ms)
    ^C
    [root@master xmrig-6.13.1]#

The text was updated successfully, but these errors were encountered:

Spudz76 commented Aug 12, 2021

May not be available for writes. If booting with UEFI then Secure Boot must be disabled (or MSR writes permanently locked). Might need to override the msr module option allow_writes if it exists.

Smells like RedHat of some sort?

marqanton commented Aug 12, 2021

Thanks, It is CentOS. Let me try turning off secure boot. I will let you know.

marqanton commented Aug 12, 2021

It looks good now. Thanks for your help.

Spudz76 commented Aug 13, 2021

Good, that might be the first time it actually was because of Secure Boot, glad it was that easy.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Оцените статью