[Support] lnxd - XMRig


Recommended Posts

Overview: Support thread for lnxd/XMRig in CA.

Application: XMRig - https://github.com/xmrig/xmrig

Docker Hub: https://hub.docker.com/r/lnxd/xmrig

GitHub: https://github.com/lnxd/docker-xmrig

 

Please ensure that you know what you're doing before setting this up, as excessively high temperatures are BAD for computers and could damage your hardware / eventuate in data loss.

 

Instructions:

  1. Install lnxd's XMRig via CA.
  2. Add in your XMR receive address to the wallet field.
  3. Update the pool address to your closest node or preferred pool. Don't forget to pay attention to the port if you change pools, as they tend to use arbitrary ports.
  4. Set the --donate-level you would like to enable. Eg. entering a 1 causes XMRig to mine for 99 minutes for you, and then 1 minute for the fee option chosen in the next step. Setting the --donate-level flag to 0 will not work unless you follow the steps below.
  5. There are 3 fee options enabled by a custom build from my fork of the latest release source. This allows for some options that aren't available in the base version:
    no-fee: Makes it possible to set the --donate-level flag to 0%. Unless you set it to 0%, the fee goes to the developer of XMRig.
    dev-fee: The fee goes to the developer of XMRig.
    lnxd-fee: The fee goes to me 🙃 Thank you in advance if you choose this option.

  6. Turn on advanced mode for the template and select CPU core / thread pairs that you would like to use in CPU pinning. I recommend leaving core 1 and its thread pair unselected, as it could possibly cause Unraid to unexpectedly slow down / the Docker engine to quit if things get too intense while mining.
    670055416_ScreenShot2021-04-02at8_45_23am.png.87bc01e297840fadd32bdf36489369eb.png
  7. Run the container and check the temperature of your CPU and other hardware regularly for at least 20-30 minutes to ensure everything is safe and stable. If you get any errors that you can't decipher, feel free reach out and I'll take a look for you.
  8. (Optional) To increase your hash rate, you can add and run the following User Script. At the moment, in order to reset your MSR values to default you need to restart your Unraid host. For this reason, it needs to be re-run after every boot as the updated values do not survive reboots. The script installs msr-tools and then updates the registry values to optimise your CPU for XMRig. This may have performance implications for other functions on your server. The logs will also show that XMRig is being run with MSR MOD disabled, but if you run this script it serves the same purpose and you should get a higher hash rate.
    #!/bin/bash
    
    # Write XMRig Optimised MSR values
    # https://github.com/xmrig/xmrig/blob/master/scripts/randomx_boost.sh
    
    VERSION=1.3
    
    echo "Installing msr-tools v${VERSION}"
    echo ""
    echo "(don't!) blame lnxd if something goes wrong"
    echo ""
    curl -fsSL https://packages.slackonly.com/pub/packages/14.2-x86_64/system/msr-tools/msr-tools-${VERSION}-x86_64-1_slonly.txz -o /tmp/msr-tools-${VERSION}-x86_64-1_slonly.txz
    upgradepkg --install-new /tmp/msr-tools-${VERSION}-x86_64-1_slonly.txz
    rm /tmp/msr-tools-${VERSION}-x86_64-1_slonly.txz
    
    echo ""
    echo "Optimising register values for XMRig"
    echo ""
    modprobe msr
    
    if cat /proc/cpuinfo | grep "AMD Ryzen" >/dev/null; then
    	if cat /proc/cpuinfo | grep "cpu family[[:space:]]:[[:space:]]25" >/dev/null; then
    		echo "Detected Ryzen (Zen3)"
    		wrmsr -a 0xc0011020 0x4480000000000
    		wrmsr -a 0xc0011021 0x1c000200000040
    		wrmsr -a 0xc0011022 0xc000000401500000
    		wrmsr -a 0xc001102b 0x2000cc14
    		echo "MSR register values for Ryzen (Zen3) applied"
    	else
    		echo "Detected Ryzen (Zen1/Zen2)"
    		wrmsr -a 0xc0011020 0
    		wrmsr -a 0xc0011021 0x40
    		wrmsr -a 0xc0011022 0x1510000
    		wrmsr -a 0xc001102b 0x2000cc16
    		echo "MSR register values for Ryzen (Zen1/Zen2) applied"
    	fi
    elif cat /proc/cpuinfo | grep "Intel" >/dev/null; then
    	echo "Detected Intel"
    	wrmsr -a 0x1a4 0xf
    	echo "MSR register values for Intel applied"
    else
    	echo "No supported CPU detected"
    fi
    echo ""
    echo "Done!"
    echo "To reset values, please reboot your server."

     


If you get stuck, please feel free to reply to this thread and I'll do my best to help out 🙂

Edited by lnxd
  • Like 2
Link to comment
Posted (edited)

@frodr I'm just replying to your question over here as the new post is up. I've attached your logs in case it's hard for anyone else to follow.

 

How much free RAM do you have available to your Unraid host? Bear with me, I'll push a build to a custom tag that runs xmrig as the root user instead of the nobody user and see if that works for your Xeon.

 

EDIT: If you change the Repository to lnxd/xmrig:latest-root it'll run xmrig as the root user instead. If that doesn't work, try enabling Privileged mode (temporarily if it doesn't work) for the container as well and see if you get different results. If it works let me know and I'll leave the tag up for you and anyone else who has trouble.

Log.rtf

Edited by lnxd
Link to comment
  • lnxd changed the title to [Support] lnxd - XMRig
13 hours ago, lnxd said:

@frodr I'm just replying to your question over here as the new post is up. I've attached your logs in case it's hard for anyone else to follow.

 

How much free RAM do you have available to your Unraid host? Bear with me, I'll push a build to a custom tag that runs xmrig as the root user instead of the nobody user and see if that works for your Xeon.

 

EDIT: If you change the Repository to lnxd/xmrig:latest-root it'll run xmrig as the root user instead. If that doesn't work, try enabling Privileged mode (temporarily if it doesn't work) for the container as well and see if you get different results. If it works let me know and I'll leave the tag up for you and anyone else who has trouble.

Log.rtf 15.98 kB · 1 download

Thanks Inxd.

 

Memory:

600056204_Screenshot2021-04-02at14_51_02.png.8ad5261af231b0a2d4449a62045fd2b5.png

 

1327416799_Screenshot2021-04-02at14_49_58.png.9cab304aabab04f78dca6e39e39f031c.png

 

 

 

 

After checking Privileged mode no memory error message. What about:

 

[2021-04-02 15:09:55.139] msr FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW
 

Is it running correctly now? I have added Wallet address in the setup, will mined coin go automatic in the wallet?

 

 

 

XMRig log2.rtf

Link to comment
8 hours ago, frodr said:

Thanks Inxd.


After checking Privileged mode no memory error message.

Wow is that a good hash rate 😅


 

8 hours ago, frodr said:

What about:

 

[2021-04-02 15:09:55.139] msr FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW
 

Is it running correctly now?

 


Yup it's running correctly. I addressed the MSR mod error in OP. I might end up disabling it, Unraid requires quite a bit of adjustment to set up MSR support, and it didn't change my hash rate at all. But then your hash rate is 7.5x mine so.. I'm also not sure if it affects Ryzen processors more, but I'm still investigating.

23 hours ago, lnxd said:

Please note that for the time being getting errors that mention msr are expected, such as:


msr kernel module is not available
FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW

I can prevent these errors from showing, but I opted to leave the MSR MOD as part of the build as it's currently under investigation. In my experience (with an Intel i5-10500), I get the same hash rate via Debian on my host with MSR MOD applied as I do via Unraid without it.

 

8 hours ago, frodr said:

Is it running correctly now? I have added Wallet address in the setup, will mined coin go automatic in the wallet?

Yup, it might take a while before your first payout but you can check the stats here. The only two things that stand out are that you set your worker name to "Xeon CPUs" which has a space so you're getting a warning about it, you'll want to change that to "Xeon-CPUs". Also you're using the Australian node, if that's your closest node it's fine, otherwise best to pick a closer one:

xmr-eu1.nanopool.org
xmr-eu2.nanopool.org
xmr-us-east1.nanopool.org
xmr-us-west1.nanopool.org
xmr-asia1.nanopool.org
xmr-jp1.nanopool.org
xmr-au1.nanopool.org

 

Link to comment
29 minutes ago, lnxd said:

Wow is that a good hash rate 😅


 


Yup it's running correctly. I addressed the MSR mod error in OP. I might end up disabling it, Unraid requires quite a bit of adjustment to set up MSR support, and it didn't change my hash rate at all. But then your hash rate is 7.5x mine so.. I'm also not sure if it affects Ryzen processors more, but I'm still investigating.

 

Yup, it might take a while before your first payout but you can check the stats here. The only two things that stand out are that you set your worker name to "Xeon CPUs" which has a space so you're getting a warning about it, you'll want to change that to "Xeon-CPUs". Also you're using the Australian node, if that's your closest node it's fine, otherwise best to pick a closer one:


xmr-eu1.nanopool.org
xmr-eu2.nanopool.org
xmr-us-east1.nanopool.org
xmr-us-west1.nanopool.org
xmr-asia1.nanopool.org
xmr-jp1.nanopool.org
xmr-au1.nanopool.org

 

Thanks a lot. 

 

I changed the worker name.

 

Do you plan to add Unraid Niviida driver support in the docker?

Link to comment
Posted (edited)
6 hours ago, frodr said:

Thanks a lot. 

 

I changed the worker name.

 

Do you plan to add Unraid Niviida driver support in the docker?

No worries! And in this one? Probably not for the foreseeable future, because it’s way more profitable and efficient to mine Eth with a GPU. Check out PhoenixMiner in my signature, that works with Nvidia. 

Edited by lnxd
Link to comment
Posted (edited)
6 hours ago, frodr said:

The dockers is utilising only the first core. Is this as expected? I have more power to put and water cooling to support it.

Yup, it calculates the amount of threads to run efficiently when it launches. It works out something like threads / 2, and my understanding is that it takes things into consideration such as your available cache as well, so that's expected. You can override it but you'll notice you only get a tiny increase in hash rate at a significantly higher power draw.

Edited by lnxd
  • Like 1
Link to comment

Hi there, loving the docker so far and it came right on time ! (I started mining monero like yesterday)

 

One issue I'm having is that I only get around 7 mh/s when I'm supposed to get more like 11-12 mh/s. My CPU is a Ryzen 3900X. I have 11/12 cores mining and I tried switching privileged mode on/off. I'm also seeing the msr FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW like you mentioned, I'm thinking this is what is causing my hashrate loss. I'm guessing the kernel is absent from the base image and you would need to add it ? I have some docker experience if that can be of any help, none regarding kernels tho lol

Link to comment
1 hour ago, Partition Pixel said:

Hi there, loving the docker so far and it came right on time ! (I started mining monero like yesterday)

 

One issue I'm having is that I only get around 7 mh/s when I'm supposed to get more like 11-12 mh/s. My CPU is a Ryzen 3900X. I have 11/12 cores mining and I tried switching privileged mode on/off. I'm also seeing the msr FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW like you mentioned, I'm thinking this is what is causing my hashrate loss. I'm guessing the kernel is absent from the base image and you would need to add it ? I have some docker experience if that can be of any help, none regarding kernels tho lol

Hey @Partition Pixel yup, not being able to use the MSR mod could be holding it back. My container supports it on hosts that have it enabled, but Unraid requires a bit of work to get it going. I’ll pm you when I get home and give you some steps to try, if it works for you I’ll merge it into the readme and OP.

  • Like 1
Link to comment
On 4/1/2021 at 5:50 PM, lnxd said:

Update the pool address to your closest node or preferred pool.

Please add a note about using the correct port, I wasn't very observant when I updated the field and spent a few minutes figuring out why I was getting connection refused messages. Simply adding the default entry to the description of the field would have been enough for me to figure out I needed to use the 14444 port.

Link to comment
9 hours ago, jonathanm said:

Please add a note about using the correct port, I wasn't very observant when I updated the field and spent a few minutes figuring out why I was getting connection refused messages. Simply adding the default entry to the description of the field would have been enough for me to figure out I needed to use the 14444 port.

Can do, I tried to think of everything but that never works 😅 so I appreciate the feedback!

Link to comment
Posted (edited)
1 hour ago, G Speed said:

Just playing around with this now, as per others msr is not working..
 

also 1GB PAGES disabled
It's set as Privileged

 

Thanks for letting me know, but just to reiterate everyone will see that error on an Unraid host unless I disable the MSR MOD 😅

On 4/2/2021 at 8:50 AM, lnxd said:

Please note that for the time being getting errors that mention msr are expected, such as:



msr kernel module is not available
FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW

I can prevent these errors from showing, but I opted to leave the MSR MOD as part of the build as it's currently under investigation. In my experience (with an Intel i5-10500), I get the same hash rate via Debian on my host with MSR MOD applied as I do via Unraid without it.


Also, no need to use Privileged unless you're getting unexpected errors. If you want to use 1gb pages you just need to add --randomx-1gb-pages to the Additional XMRig Arguments section. Just make sure you know what to expect if you do enable it by reading this first.

EDIT: I need another couple of testers for the MSR MOD to see if it impacts hash rate enough, if anyone is interested please PM me. It's not entirely risk free, but the written MSR values are reset by a reboot.

Edited by lnxd
Link to comment

Based on what my CPU should be getting, it looks like MSR is not really holding me back...
Intel if that matters

As per the 1gb pages... seems like it might not be wroth it

 

For RandomX dataset since version 5.2.0 the miner support 1GB huge pages (regular huge pages size is 2MB), this feature available only on Linux. It increases the hashrate by 1-3% (depends of CPU) and increases memory requirements to 3GB (3 pages) per NUMA node

 

Link to comment
8 hours ago, G Speed said:

Based on what my CPU should be getting, it looks like MSR is not really holding me back...
Intel if that matters

Hopefully not 😅

 

If you want to find out for sure, I just added a step 8 to OP that optimises the values if you want to try it. Depending on feedback here, if people get higher hash rates from it, I might turn it into a plug-in.

Link to comment
On 4/1/2021 at 11:50 PM, lnxd said:

8. (Optional) To increase your hash rate, you can add and run the following User Script.

Hi,

 

where should i run this script?

 in the docker or on unraid server?

 

My hashrate is really unstable and absolutly low.

https://xmr.nanopool.org/account/41pk2JrGdjo2xaSzDxmMupAxrCx4QxHE6cA3CjM4Ut7ehHFFZdwtkJuEDDvSyihdVQBrkBf5qPPVngj2tnnXPKdQENgFEqg

 

Maybe my server is not designed for that?

 

4x Intel® Xeon® CPU E7- 8870 @ 2.40GHz

 

BR

 

Edited by horphi
Link to comment
Posted (edited)
8 hours ago, horphi said:

Hi,

 

where should i run this script?

 in the docker or on unraid server?

 

My hashrate is really unstable and absolutly low.

https://xmr.nanopool.org/account/41pk2JrGdjo2xaSzDxmMupAxrCx4QxHE6cA3CjM4Ut7ehHFFZdwtkJuEDDvSyihdVQBrkBf5qPPVngj2tnnXPKdQENgFEqg

 

Maybe my server is not designed for that?

 

4x Intel® Xeon® CPU E7- 8870 @ 2.40GHz

 

BR

 

Hey there,

 

Sorry for the delay, I missed your question. The script should be run on your Unraid server. (random) People (on the internet) are reporting around 1900H/s with your CPU for mining with RandomX. You can also try adding --asm intel to the Additional XMRig Arguments field like so:

307755228_ScreenShot2021-04-07at11_56_52am.thumb.png.e0835820f63d8481b888a1364691d566.png

Edited by lnxd
  • Thanks 1
Link to comment
6 hours ago, lnxd said:

Hey there,

 

Sorry for the delay, I missed your question. The script should be run on your Unraid server. (random) People (on the internet) are reporting around 1900H/s with your CPU for mining with RandomX. You can also try adding --asm intel to the Additional XMRig Arguments field like so:

307755228_ScreenShot2021-04-07at11_56_52am.thumb.png.e0835820f63d8481b888a1364691d566.png

Edited 3 hours ago by lnxd

Thx for your support.

I added this parameter. Should an effect dircectly visible or do i need to restart my server?

 

What does mean the warning? -->  [2021-04-07 01:23:48.114] CPU #23 warning: "can't bind memory"

 

Best regards,

 

Phil

  • Like 1
Link to comment
Posted (edited)
9 minutes ago, horphi said:

Thx for your support.

I added this parameter. Should an effect dircectly visible or do i need to restart my server?

No worries Phil!

You shouldn't need to restart the server to see the affect of the additional argument, just the docker container but that will happen automatically when you Apply it.

If you ran the script, technically you don't even have to restart the container. Normally XMRig would update the MSR directly, but because it's run from a container, even with msr-tools installed in the container, and /dev/CPU passed through and chmod -R 777'ed I can't get it working. But the script updates the value directly from the host, and XMRig can recognise the changes on the fly so there's no need for it.

 

9 minutes ago, horphi said:

[2021-04-07 01:23:48.114] CPU #23 warning: "can't bind memory"

You'll need to jump on the latest-root tag in order to get rid of that error, I'm not sure what causes it specifically. To get on the latest-root build:

On 4/2/2021 at 11:00 AM, lnxd said:

If you change the Repository to lnxd/xmrig:latest-root it'll run xmrig as the root user instead. If that doesn't work, try enabling Privileged mode (temporarily if it doesn't work) for the container as well and see if you get different results.

 

EDIT: Sorry I posted too soon. @horphi if you don't mind posting your diagnostics.zip, that might help me solve the problem for other users without needing to run XMRig as root ☺️

Edited by lnxd
  • Thanks 1
Link to comment

Privileged has solved the binding. 🙂

 

ErrorWarningSystemArrayLogin

Project: xmrig
Author: lnxd
Base: Ubuntu 20.04
Target: Unraid
Donation: no-fee 1%

Running xmrig as uid=0(root) gid=0(root) groups=0(root) with the following flags:
--url=xmr-eu1.nanopool.org:14444 --coin=monero --user=41pk2JrGdjo2xaSzDxmMupAxrCx4QxHE6cA3CjM4Ut7ehHFFZdwtkJuEDDvSyihdVQBrkBf5qPPVngj2tnnXPKdQENgFEqg.Unraid --randomx-wrmsr=-1 --randomx-no-rdmsr --no-color --asm intel --random-1gb-pages
./xmrig: unrecognized option '--random-1gb-pages'
* ABOUT XMRig/6.10.0 gcc/9.3.0
* LIBS libuv/1.34.2 OpenSSL/1.1.1f hwloc/2.1.0
* HUGE PAGES supported
* 1GB PAGES disabled
* CPU Intel(R) Xeon(R) CPU E7- 8870 @ 2.40GHz (4) 64-bit AES
L2:10.0 MB L3:120.0 MB 40C/80T NUMA:4
* MEMORY 2.7/125.9 GB (2%)
DIMM A1: 16 GB DDR3 @ 1066 MHz M393B2K70CM0-YF8
DIMM A2: 16 GB DDR3 @ 1066 MHz HMT42GR7CMR4A-G7
DIMM B1: 16 GB DDR3 @ 1066 MHz HMT42GR7CMR4A-G7
DIMM B2: 16 GB DDR3 @ 1066 MHz HMT42GR7CMR4A-G7
DIMM C1: 16 GB DDR3 @ 1066 MHz M393B2K70CM0-YF8
DIMM C2: 16 GB DDR3 @ 1066 MHz HMT42GR7CMR4A-G7
DIMM D1: 16 GB DDR3 @ 1066 MHz M393B2K70CM0-YF8
DIMM D2: 16 GB DDR3 @ 1066 MHz HMT42GR7CMR4A-G7
* MOTHERBOARD Dell Inc. - 0FJM8V
* DONATE 1%
* ASSEMBLY intel
* POOL #1 xmr-eu1.nanopool.org:14444 coin monero
* COMMANDS 'h' hashrate, 'p' pause, 'r' resume, 's' results, 'c' connection
* OPENCL disabled
* CUDA disabled
[2021-04-07 01:52:38.108] net use pool xmr-eu1.nanopool.org:14444 51.255.34.118
[2021-04-07 01:52:38.109] net new job from xmr-eu1.nanopool.org:14444 diff 480045 algo rx/0 height 2333959
[2021-04-07 01:52:38.109] cpu use argon2 implementation SSSE3
[2021-04-07 01:52:38.109] randomx init datasets algo rx/0 (80 threads) seed ae2b3c3b6e013f9c...
[2021-04-07 01:52:39.645] randomx #0 allocated 2080 MB huge pages 100% (1536 ms)
[2021-04-07 01:52:40.354] randomx #2 allocated 2080 MB huge pages 100% (2245 ms)
[2021-04-07 01:52:41.049] randomx #1 allocated 2080 MB huge pages 100% (2940 ms)
[2021-04-07 01:52:41.049] randomx #3 allocated 2080 MB huge pages 100% (2940 ms)
[2021-04-07 01:52:41.142] randomx #0 allocated 256 MB huge pages 100% +JIT (93 ms)
[2021-04-07 01:52:41.142] randomx -- allocated 8576 MB huge pages 100% 4288/4288 (3033 ms)
[2021-04-07 01:52:46.037] randomx #0 dataset ready (4895 ms)
[2021-04-07 01:52:47.336] randomx #3 dataset ready (1299 ms)
[2021-04-07 01:52:47.504] randomx #2 dataset ready (1467 ms)
[2021-04-07 01:52:47.504] randomx #1 dataset ready (1467 ms)
[2021-04-07 01:52:47.505] cpu use profile rx (40 threads) scratchpad 2048 KB
[2021-04-07 01:52:47.559] cpu READY threads 40/40 (40) huge pages 100% 40/40 memory 81920 KB (54 ms)
[2021-04-07 01:52:54.333] net new job from xmr-eu1.nanopool.org:14444 diff 480045 algo rx/0 height 2333959
[2021-04-07 01:52:56.102] net new job from xmr-eu1.nanopool.org:14444 diff 480045 algo rx/0 height 2333960
[2021-04-07 01:53:47.543] miner speed 10s/60s/15m 9400.9 n/a n/a H/s max 9406.1 H/s
[2021-04-07 01:53:56.627] net new job from xmr-eu1.nanopool.org:14444 diff 480045 algo rx/0 height 2333960
[2021-04-07 01:54:47.585] miner speed 10s/60s/15m 9328.6 9367.5 n/a H/s max 9438.6 H/s

 

Now the H/s increases, but still low...

Maximum with E7-8870 reached?

 

BR

 

Phil

 

 

  • Like 1
Link to comment
Posted (edited)
43 minutes ago, horphi said:

Privileged has solved the binding. 🙂

 

Now the H/s increases, but still low...

Maximum with E7-8870 reached?

 

Perfect!

 

Ah I just noticed you said 4x Intel® Xeon® CPU E7- 8870, I was wondering how you were getting above 9,000!

 

I'd let it mine for a while and see how it averages out, it might get a little higher but it's also responsible for looking after everything else on your server so it's possibly doing quite well. As you pinned the CPU the way I suggested in Step 6 that could explain why you're getting a little lower than you would on all cores and threads. Being a server I'd say reliability over hash rate any day. Looks like you agree with all that ECC RAM ☺️

 

38 minutes ago, horphi said:

One additional question.

Why only 1/2 threads are used?

All good, what you're seeing is expected. It means XMRig is set up correctly. 

On 4/3/2021 at 3:59 PM, lnxd said:

It calculates the amount of threads to run efficiently when it launches. It works out something like threads / 2, and my understanding is that it takes things into consideration such as your available cache as well, so that's expected. You can override it but you'll notice you only get a tiny increase in hash rate at a significantly higher power draw.

 

Edited by lnxd
  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.