Some notes on how to setup various open-source XMR Miners on Ubuntu 16
Last active
March 22, 2021 10:45
-
-
Save 9bitbear/8c350847f82d7f6bc3ec6023c6b32423 to your computer and use it in GitHub Desktop.
XMR mining on Ubuntu
sudo apt-get install git libcurl4-openssl-dev build-essential libjansson-dev autotools-dev automake
git clone https://github.com/hyc/cpuminer-multi
cd cpuminer-multi
./autogen.sh
CFLAGS="-march=native" ./configure
make
Try it:
sudo ./minerd -a cryptonight -o stratum+tcp://pool.minexmr.com:4444 -u WALLET_ADDRESS
- add xmr-stak.service to
/etc/systemd/system
enable service (on startup):
sudo systemctl start xmr-stak.service
sudo systemctl status xmr-stak.service # check for errors
sudo systemctl enable xmr-stak.service # enable for system startup
sudo apt install git build-essential libmicrohttpd-dev libssl-dev cmake libhwloc-dev
cd ~
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd xmr-stak/build
cmake .. ## add -DCUDA_ENABLE=OFF or -DOpenCL_ENABLE=OFF
## or -DOpenCL_INCLUDE_DIR=/opt/amdgpu-pro/lib/x86_64-linux-gnu
## or -DOpenCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so -DOpenCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include/CL
## or -DOpenCL_LIBRARY=/opt/amdgpu-pro/lib/x86_64-linux-gnu/libOpenCL.so -DOpenCL_INCLUDE_DIR=/opt/amdgpu-pro/bin
make install
## if u get error 'CL/cl.h: No such file or directory', try: sudo apt-get install opencl-headers
# quick test
bin/./xmr-stak
-
Copy binary for systemd use:
cp bin/xmr-stak /usr/local/bin/xmr-stak # so system can execute
/usr/local/bin/xmr-stak -c ~/xmr-stak/config.txt
- To avoid OUT_OF_MEMORY errors with older cards:
export GPU_FORCE_64BIT_PTR=1
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
export GPU_MAX_HEAP_SIZE=100
- fix for build error:
'CL/cl.h: No such file or directory'
sudo apt-get install opencl-headers
If you run into issues related to mmap this means you need to enable hugepages. To do this type the following commands:
sudo sysctl -w vm.nr_hugepages=128
sudo nano /etc/sysctl.conf
At the end of the sysctl.conf file add:
vm.nr_hugepages=128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=XMR-stak service | |
After=network.target | |
[Service] | |
Type=simple | |
GuessMainPID=no | |
ExecStart=/usr/local/bin/xmr-stak -c /home/miner/xmr-stak/config.txt --amd /home/miner/xmr-stak/amd.txt | |
Restart=on-failure | |
User=miner | |
[Install] | |
WantedBy=multi-user.target |
sudo apt-get install git build-essential cmake libuv1-dev libmicrohttpd-dev
git clone https://github.com/xmrig/xmrig.git
cd xmrig
mkdir build
cd build
cmake ..
make
cp xmrig /usr/local/bin/xmrig # so system can execute
- copy xmrig.service to
/etc/systemd/system
optional:
- For AMD/OpenCL
cmake .. -DOpenCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so -DOpenCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include/CL
The xmrig.service link is broken
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fix for build error:
'CL/cl.h: No such file or directory'
fix for build error:
make[2]: *** No rule to make target '/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so', needed by 'bin/libxmrstak_opencl_backend.so'. Stop.
fireice-uk/xmr-stak-amd#182