How to mine Monero on Ubuntu 16.04 using ccminer-cryptonight

in #monero8 years ago (edited)

With the recent upsurge in Monero popularity and price, now is the perfect opportunity to begin exploring and mining the cryptocurrency. If you're not familiar with Monero, it's a cryptocurrency with privacy built in.

Monero uses a cryptographically sound system that allows you to send and receive funds without your transactions being publicly visible on the blockchain (the distributed ledger of transactions). This ensures that your purchases, receipts, and other transfers remain private by default.
getmonero.org

If you have some spare computing power, or a decent GPU, you can contribute some hashing power to the network and earn some Monero yourself.


Getting started

This tutorial assumes you're running a version of Ubuntu. If you don't have Ubuntu, you can install it on your machine for free here.

Installing ccminer-cryptonight

ccminer-cryptonight is a fork of ccminer that runs on the CUDA architecture and takes advantage of your Nvidia video card.

Download the source code for ccminer-cryptonight

https://github.com/tsiv/ccminer-cryptonight/archive/v0.17.zip.

Update the system

sudo apt-get update && sudo apt-get -y dist-upgrade

Install dependencies

sudo apt-get -y install gcc g++ build-essential automake linux-headers-$(uname -r) git gawk libcurl4-openssl-dev libjansson-dev xorg libc++-dev libgmp-dev python-dev

Install the nvidia display driver

cd && wget http://us.download.nvidia.com/XFree86/Linux-x86_64/352.41/NVIDIA-Linux-x86_64-352.41.run
sudo chmod +x NVIDIA-Linux-x86_64-352.41.run
sudo ./NVIDIA-Linux-x86_64-352.41.run --accept-license --no-questions --disable-nouveau --no-install-compat32-libs
rm NVIDIA-Linux-x86_64-352.41.run
sudo echo 'GRUB_CMDLINE_LINUX="nomodeset"' >> /etc/default/grub
sudo update-grub
sudo nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration  # flags enable OC and fan controls.  via: https://bitcointalk.org/index.php?topic=826901.msg12279696#msg12279696

Install Cuda

cd && wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb
rm cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-6-5 

Note: you can skip having to read over the entire agreement by pressing ctrl+c after the last command above.

sudo usermod -a -G video $USER
echo "" >> ~/.bashrc
echo "export PATH=/usr/local/cuda-6.5/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc

Reboot

sudo reboot

Make the deviceQuery sample. This is used to verify cuda works
cd /usr/local/cuda/samples/1_Utilities/deviceQuery && sudo make

If you see all of your cards listed, and the last line says "Result = PASS" you're good to go.
/usr/local/cuda/samples/1_Utilities/deviceQuery/deviceQuery

Build ccminer-cryptonight

cd ccminer-cryptonight_20140926
./autogen.sh
./configure
make

Mining

First create a wallet, either using the simplewallet binary, or using mymonero.com. Copy your wallet address.

We'll be mining with a pool I like called MoneroHash. It's relatively small, which means payouts will be larger (but might take longer).

Simply start ccminer to begin mining:
ccminer -o stratum+tcp://monerohash.com:3333 -u YOUR_WALLET_ADDRESS -p x

If everything went smoothly, you'll see output like this:

[2016-08-24 17:48:52] Using JSON-RPC 2.0
[2016-08-24 17:48:52] 1 miner threads started, using 'cryptonight' algorithm.
[2016-08-24 17:48:52] Starting Stratum on stratum+tcp://monerohash.com:3333
[2016-08-24 17:48:52] GPU #0: GeForce GTX 970 (13 SMX), using 40 blocks of 8 threads
[2016-08-24 17:48:52] Pool set diff to 5000
[2016-08-24 17:48:52] Stratum detected new block
[2016-08-24 17:48:57] GPU #0: GeForce GTX 970, 76.20 H/s
[2016-08-24 17:49:10] GPU #0: GeForce GTX 970, 350.35 H/s
[2016-08-24 17:49:10] accepted: 1/1 (100.00%), 350.35 H/s (yay!!!)

Happy mining!

Thanks to Zach Shiner for his UbuntuMiner script.

Sort:  

Thanks for share... i will try this right way
Thanks

I am having trouble installing cuda 6.5

How did you get around this "No Hash entry in Release file /var/lib/apt/lists/partial/_var_cuda-repo-6-5-prod_Release which is considered strong enough for security purposes" when you do the sudo apt-get update

Great post but my quadro 2000 just doesnt want to play ball...

Congratulations @mobidick! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 62922.70
ETH 2543.02
USDT 1.00
SBD 2.83