Monero Mining How To using xmr-stak-cpu on Linux Mint 17.3 - XMR

in #monero7 years ago

So I first started with xmr-stak and I believe I also before that tried xmrig but could't get them installed, I then found xmr-stak-cpu which took out the video card compiling issues I was getting and for my current rigs is what I needed, straight up CPU mining utilizing hardware that works sitting around with no one to operate. I have deployed 3 systems following this process, each running Linux Mint 17.3 installed fresh, then I downloaded the wallet tool from ( https://getmonero.org/downloads/ ) And thought it would let me mine, so far I can't get it to mine on any device, I did try setting up a node, on one machine, to see if that made any difference. You only need the wallet app to generate you address, this can be done on any machine, and frankly you don't need the app on the mining rig ( but I have it synced on each machine now, and it took a few days for it to do so, which means you won't be able to make a transaction till it has done so, this is where the nodes come into play.) This is a how to on mining and if I had any success getting this utility to mine I would include more, but frankly it is a wallet & you need one somewhere, preferably not on an android device, listen to John McAfee and not needed on your mining rig unless you are like me and don't want to litter your development machine with that hard drive buster. The ASUS currently has less than 2.3GB free of hard disk space off the old 40GB sata drive I have been using for testing this. which has all been consumed from the wallet synchronization, so be aware.

By the end of this document if executed properly you will have a working mining operation. For licensing reasons we are focused on using Linux, and we utilize Linux Mint as our standard distro, but now that it is working and I am creating a write-up there could be better OS choices for creating a mining rig. We are going to add a couple ARM device to the network and see how much we can get out from them & add to our effective h/s, and we will toy with other distros.

There are some things we need to install in order to get this code to compile and work, here is the order of the steps we followed to get our miners operational.

Get in your terminal, if you don't know about guake ( sudo apt-get install guake ): it is fantastic!!
First off need to get the latest version of 'cmake' and apt-get keeps back this repository, and here is a link to the resource I used to resolve the issue: https://askubuntu.com/questions/610291/how-to-install-cmake-3-2-on-ubuntu

sudo apt-get install software-properties-common sudo add-apt-repository ppa:george-edison55/cmake-3.x sudo apt-get update sudo apt-get install cmake sudo apt-get --assume-yes update

Second we so need to upgrade g++ & gcc
sudo add-apt-repository ppa:jonathonf/gcc-7.1 sudo apt-get update sudo apt-get install gcc-7 g++-7 sudo apt-get --assume-yes update sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7

Then we can continue on with actually installing what we need and xmr-stak-cpu

sudo apt-get --assume-yes install libmicrohttpd-dev libssl-dev build-essential libhwloc-dev screen git cd /usr/local/src/ git clone https://github.com/fireice-uk/xmr-stak-cpu.git cd xmr-stak-cpu mkdir build cd build cmake .. make install

Additionally
chmod +x xmr-stak-cpu ./xmr-stak-cpu
You can then create the a process to auto-start or execute the program as you see fit.

When you start the program it should warn you you need a config file & I just utilized the one from the initial git download, but I did make changes and each machine is using a different config currently but each machine is mining to one address, on the same pool. There a couple other settings that we need to alter on the system to get this application to work properly and it has to do with memory usage & allocation.

Setup Huge Pages

I did this on each machine I set up, it does seem to resolve the issue so I am including it as part of this install process.


If you run into issues related to mmap this means you need to enable hugepages. To do this type the following commands:
sysctl -w vm.nr_hugepages=128 sudo pluma /etc/sysctl.conf *****At the end of the sysctl.conf file add: vm.nr_hugepages=128 Save and close. I also had to update limits.conf per the FAQ, with the lines: soft memlock 262144 hard memlock 262144 ( i have not yet rebooted the machine unsure if I am affect by the issue associated with this, see references. ) I have been toying around with the configs, and adding additional threads.... I seem to have increased the overall rate, but the individual dropped, but due to the additional thread I took 15h/s to 22h/s (highest) but seems to average on 18h/s which is a nominal improvement. I tried first with 6 threads it did not like it, but with this small improvment I did the same on the other two devices adding one more thread to each ( 3,3,2) I did try 3 on the Dell-Optiplex but it crashed and didn't like it, but with the two currently getting 10h/s from that CPU. The other two machines are laptops a Lenovo Yoga (18-22h/s) and a Asus 20(h/s). I want to do some more tweaking and see if I can't get other nominal improvements. I have been monitoring the system monitor as well just to see, and the memory is normally about 40-60% utilized and the CPU's are polling 100% 99.9999% of the time, but the two 4 core machines the last two cores stay flat at 50% utilization with minor spikes to 70-80&100 depending, so there could be room to squeeze another thread in an see if I cant get to 30. Now in combination these are showing occasional #'s in the 35's but average is about 26h/s per 24-hour period on current settings, from the pool results. Also I found this installer( https://github.com/nowheel/xmr-stak-cpu-installer ), after I did the work of course, I have not tested it, but feel free to try it out, and comment back if it was helpful!!! I am going to put together my own installer that should work cross platform and utilize xmr-stak-cpu as the mining tool, and set up some other useful things like pool reports and other details I can squeeze in to make a usable utility tool to not just make the install simpler, but provide features. Thinking about headless operations & straight booting to shell and having the same utility be useful and provide some thing better to look at than the current stak generated output. Keep your ears out in the coming weeks for something coming out as we add more devices to our pool. I hope this post helps get you on your way mining!! I had issues getting something working 'out-of-the-box' and it took a bit of research to get our operations working. If you want to donate some XMR to me for this effort and help us produce more content to help the community here is our address XMR:: 46VVGfmiKjShF3Aj1KJvVJFvFwshDRXCwXaWQz2ZGKZiMuHhyiN8wC5NdzACJbZv5wB4iW2RRgpgsPaavWbkq3ag5kV6ruC We are building a bank based on BTC & XMR. You can invest monetarily if you can afford to do so or If you want to invest by helping us mine, please mine to the above XMR address and label your worker-name so we can track your contributions and we will provide dividends back to your address, please contact us if you do want to join, we are in the process of building the pool and setting up the software. This we put this together to help document the process of getting a XMR-CPU miner up in operation. There are other options, this may not be the only solution, but so far we 4 days into successful mining. The Truth Old hardware a fortune does not make! yes you can earn hour by hour for plugging in any old machine, The issue is Pool payouts and ability to obtain those earnings. I cannot get any of my earnings yet till I reach 0.3 XMR. 4 days in I have earned 0.0001995379 XMR from 3 machines, my math it may take awhile to get any we will see in the wallet :( But not all is lost, math is being done and as we add machines we will increase our h/s and get out of fractions and into digits. We are currently have hardware to build some GPU miners which we will document as well, once we can afford the power supply and sata drive we need to be able to boot the machine and set it up. we will be looking at GPU & CPU mining on the device if we can, and it will be a headless probably no window manager maybe x so I can load chrome, as the app I am building to install & manage xmr mining operations will be a web UI, so that we can manage the device in a headless operation out of listening distance. We are excited and currently have landed two new additions joining our Bank and will be building some GPU rigs in the future to help these customers provide themselves with a better future and should have more insights to share as we grow. Don't want to operate or have the care to manage the miner, but still want to take advantage of this critical opportunity please contact us and let us help you. For those of you that are doing it on your own, keep up the good work, and comment weather or not this write up helped you get your XMR CPU mining operations off the ground. References https://github.com/psychocrypt/xmr-stak-cpu https://www.cryptocurrencyfreak.com/2017/08/22/monero-mining-xmr-stak-cpu-ubuntu-16-04/ ~~~ embed:2a2091f282042ed20cda gist metadata:YmVjaS8yYTIwOTFmMjgyMDQyZWQyMGNkYQ== ~~~ https://askubuntu.com/questions/610291/how-to-install-cmake-3-2-on-ubuntu https://askubuntu.com/questions/623350/how-to-install-g-5-1-on-ubuntu-desktop-15-04-64-bit https://wiki.debian.org/Hugepages https://github.com/nowheel/xmr-stak-cpu-installer https://github.com/fireice-uk/xmr-stak/issues/514 https://github.com/fireice-uk/xmr-stak/issues/655 ~~~ embed:gYEibVHt-nk youtube ~~~ ~~~ embed:YdzJTIaVZx8 youtube ~~~ ~~~ embed:vZuLk5c8Bts youtube ~~~ ~~~ embed:6qellgrb6hY youtube ~~~ ~~~ embed:uKmjo54vrK8 youtube ~~~ ~~~ embed:ojZerk1oOjc youtube ~~~ ~~~ embed:ztNG1dx-qXA youtube ~~~ https://github.com/psychocrypt/xmr-stak https://getmonero.org

Sort:  

I tried this a few days ago with Linux Mint but I had synch problems.

Well post your issues and let me know if you need help. It took me 3 days of getting something to work, I tried other code and that has not yet been successful. Also if you are talking of the wallet syncing, ignore it get your address, MEMORIZE your seed and delete the wallet. focus on mining. The pool will let you know when you are ready to cash out and you can sync up a wallet latter, I also had issue and found Nodes, enable you to point that is already verified, and you shouldn't have to sync, I only tested it on on one machine and could be useful to save HHD space. I had issues rebooting the machine while it was syncing and it started all over again. Let us know when you got that thing mining!!!