calvintam236 / docker_xmrig

XMRig in Docker. Supports CPU & GPU mining.
2 stars 4 forks source link

msr kernel module is not available #1

Open c0dyhi11 opened 2 years ago

c0dyhi11 commented 2 years ago
[2022-01-11 03:29:19.378]  msr      msr kernel module is not available
[2022-01-11 03:29:19.378]  msr      FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW

Have you run into this and solved it? I'm having this issue and this seems to cut my hash rate dramatically

$ docker --version
Docker version 20.10.9, build c2ea9bc
calvintam236 commented 2 years ago

I believe MSR requires root permission per official notes. You might try to run your container in privileged mode.

c0dyhi11 commented 2 years ago

I am running in privileged mode now. Still the same issue. The other issue this solved though. I'll mention that and close it out.

c0dyhi11 commented 2 years ago

I do see something that someone else is doing here: https://github.com/Jerhaad/xmrig_docker/blob/57caf5dc26a71969c1a652852ff4166bbe9ac111/cpu/randomx_boost.sh#L1 as well as bind mounting /lib/modules/ https://github.com/Jerhaad/xmrig_docker/blob/57caf5dc26a71969c1a652852ff4166bbe9ac111/cpu/docker-compose.yaml#L12

--mount type=bind,source=/lib/modules,target=/lib/modules

This seems to be doing the same thing xmrig is trying to do, but manually. I still get the error. But the hash rate has gone up.

calvintam236 commented 2 years ago

Please check if you have turned on required settings in BIOS. What OS are you running on?

c0dyhi11 commented 2 years ago

This is ubuntu 20.04. If I compile xmrig from source and run it directly within the OS... I don't have any issues. So are there specific Bios settings that are docker related?

calvintam236 commented 2 years ago

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.

from official notes.

c0dyhi11 commented 2 years ago

And this is docker related or xmrig related? Since xmrig runs fine outside of a container.

calvintam236 commented 2 years ago

It could be a docker thing. Can you try the wrmsr command from https://github.com/xmrig/xmrig/issues/1891#issuecomment-725241656?

I never run the image in privileged mode, and always run that command manually before starting the container. It just needs to run once after every hard restart.

c0dyhi11 commented 2 years ago

So that is the command that the script I mentioned above does. This increased my hash rate and all is working great. But it seems that xmrig can't run this command itself.