As explained in our How to mine Monero on Windows or Linux
(Fedora or Ubuntu) with CPU
guide, Monero is one of the few cryptocurrencies which can still be mined using a CPU;
nevertheless, GPUs can provide significant performance improvements and often, more value. In this guide we
will first elaborate on some Monero GPU mining topics and then continue with a step-by-step guide on mining Monero
using GPU in the Fedora
and Ubuntu (in progress) Linux distributions.
Advantages and Disadvantages of GPU mining
a. Support for multiple GPUs
A computer or server may support two CPUs, but with the right hardware, it can support up to 19 GPUs.
According to monerobenchmarks.info
the highest performing CPU
is an Intel Xeon E7-8867 v4 (around 4000 hashes per second), which has a recommended price of $4672 USD.
Add the cost of a supported motherboard and additional required hardware and the entire mining rig will
be near $6000 USD. Such a rig cannot be expanded in the future with additional CPUs.
Buying an inexpensive motherboards, and multiple GPUs can provide more hashing power for the price.
Check out monerobenchmarks.info
to compare GPU performance when
considering GPU mining. For example, using six Nvidia GTX 1060 GPUs can generate nearly 3000 hps, and it can
cost around $300 for each card. A mining rig can be completed with a single GPU and as the budget increases,
additional GPUs can be added.
b. Expandable and Flexible
Most motherboards have a limited form factor and will only support specific types of CPUs. New, higher
performing CPUs will likely require a completely new build for an upgrade.
GPUs interface using the PCI-e specification and nearly all modern motherboards support this specification.
GPUs can be added, removed, and replaced with different models as desired.
c. Specific use case
While a CPU is a general purpose machine and could be re-purposed for nearly anything (e.g. home server),
a multi-GPU rig built for mining is less useful if not used for this purpose. One or two cards could be
used for a gaming machine, but a 19 card rig may only be useful for niche cases such as machine-learning.
d. Purchase options
GPU mining is popular, historically profitable, and the demand for GPUs is high. Online as well as brick and
mortar stores often place limits on the number of GPUs available for purchase and the prices reflect
accordingly. Finding enough GPUs for a build can be challenging.
GPU mining on Linux vs Windows and Mac
Windows has excellent support for both Nvidia and AMD GPUs. Drivers are readily available, configuration
software works well, and overclocking is fairly simple. Mining using Windows with GPUs is an excellent
choice with purchased Windows licensing, experience in the Windows environment, and availability of a
GUI based setup.
Mac also has robust support for both Nvidia and AMD GPUs. The hardware is often more expensive, but if
already available, can be re-purposed easily for mining Monero.
On the other hand, Linux has historically struggled to support GPUs but currently works well with nearly
every modern GPU architecture. Drivers for both Nvidia and AMD are widely available, multiple mining
software options support Linux, and most Linux distros work well. Linux requires no licensing, can be
changed easily, and works very well in headless environments (can connect over a network).
Solo vs Pool mining
Solo mining requires connection to a full Monero node and a fairly large mining environment to be feasible.
Miners will likely go long periods of time with no rewards but will not be required to pay any fees once
a block is found. For example, using the six GTX 1060 GPUs mentioned before, a solo miner has about a
1% chance of finding a block every 24 hours. Mathematically, this means a miner will get a reward every
100 days. As mining difficulty changes, this may become more or less likely.
A pool is a collection of miners who combine their hashing power and then share the rewards. Individual
miners are not required to maintain a full Monero node, but just connect to a mining pool using mining
software. Miners are rewarded more frequently, but in smaller amounts. For example, rather than receiving
1 XMR on day 100 solo mining, a miner receives .01 xmr every day for 100 days.
Additionally, pools often have fees associated with them to cover the overhead of running the pool.
Pools also may have minimum payouts to reduce the overhead and network fees of frequent, low payments. Most
mining software are configured to use a pool by default.
If you would like to know how much can you earn by mining Monero then use our
Monero mining calculator
The Monero community is very skeptical of Minergate due to many reports of lowered hash rates. There are
numerous options for highly regarded, high quality Monero pools and the use of Minergate is not recommended.
To mine with Nvidia, both Nvidia drivers and Cuda toolkit are required.
Downloading and Installing the Nvidia Drivers
Download the Nvidia drivers from here
Install the requisite packages for driver compilation and making the project.
The installation assumees the driver is located within the /tmp
dnf install kernel-devel kernel-headers gcc gcc-c++ dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig vim git cmake automake openssl-devel libcurl-devel -y
Nvidia won't install unless the conflicting Nouveau module is disabled. By adding this line to the
file, the kernel won't load the Nouveau module.
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
Edit the grub menu to blacklist nouveau by appending to the GRUB_CMDLINE_LINUX
Update the grub2 configuration.
grub2-mkconfig -o /boot/grub2/grub.cfg
Or for UEFI
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
. Note that this may or may not be
required depending on the installation environment.
dnf remove xorg-x11-drv-nouveau
Additionally, remove any exclusion reference in dnf.conf
if it exists.
Back-up the old initramfs nouveau
image and create a new one.
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
dracut /boot/initramfs-$(uname -r).img $(uname -r)
Reboot to runlevel 3. Note that the GUI (desktop environment) may be unavailable. Save this guide
for reference outside of the Fedora machine updating.
systemctl set-default multi-user.target
After the reboot is completes, run the driver installation.
chmod +x NVIDIA-Linux*
Downloading and Installing the Cuda Toolkit
Download the Cuda toolkit from here
Install the Cuda toolkit and reboot the system. The installation assumees the installation file is located within the /tmp
sudo rpm -i cuda-repo*
sudo dnf clean all
sudo dnf install cuda -y
Mining Monero using xmr-stak
supports both CPU and/or GPU mining. It can be
configured to run CPU, Nvidia GPU, or AMD GPU modes, or any combination of the three.
Install dependencies, get the source, and make the project. The default values will enable both CPU
and GPU mining. To disable CPU mining, add the -DCPU_ENABLE=FALSE
flag the cmake
line. If you are not using AMD GPUs also add
the flag to disable AMD, -DOpenCL_ENABLE=FALSE
sudo dnf install gcc gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel cmake
git clone https://github.com/fireice-uk/xmr-stak.git
Configure the software by running xmr-stak
for the first time.
Dual mining configurations are supported.
will prompt for values as shown below. It will also
automatically generate default values which work well.
- Currency: 'monero' or 'aeon'
- Pool address: e.g. pool.usxmrpool.com:3333
- Username (wallet address or pool login):
- Password (mostly empty or x):
- Does this pool port support TLS/SSL? Use no if unknown. (y/N)
- Do you want to use nicehash on this pool? (y/n)
- Do you want to use multiple pools? (y/n)
has community submitted configurations for
increased performance. To optimize for a particular CPU/GPU, view the configurations there.
Optimization will require some trial and error.
To use both CPU and GPU mining, enable the dependency for hwloc
sudo sysctl -w vm.nr_hugepages=128
sudo echo "* soft memlock 262144" >> /etc/security/limits.conf
sudo echo "* hard memlocl 262144" >> /etc/security/limits.conf
To run the mining software, execute xmr-stak
a second time.
Mining Monero using ccminer-cryptonight
is another option for mining using an
Nvidia GPU. It is more specific than xmr-stak.com
as it only
supports Nvidia GPUs. It does not support CPU mining nor AMD GPUs.
git clone https://github.com/KlausT/ccminer-cryptonight.git
expects some specific libraries included
in OpenSSL v1.0. Therefore, the Autoconf
file needs to be
adapted to check for the 1.0 or 1.1 library.
AC_CHECK_LIB([ssl],[SSL_library_init], , [AC_MSG_ERROR([OpenSSL library required])])
AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [ACCEPT_SSL_LIB="yes"])
AC_CHECK_LIB(ssl, SSL_library_init, [ACCEPT_SSL_LIB="yes"])
AS_IF([test "x$ACCEPT_SSL_LIB" = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
Make and install the software.
Cuda requires gcc version 5 or lower. Modify the MakeFile to use backwards compatibility by appending
$(NVCC) @CFLAGS@ -I . $(NVCC_GENCODE) --maxrregcount=128 --ptxas-options=-v $(JANSSON_INCLUDES) -o $@ -c $<
$(NVCC) -Xcompiler -std=c++98 @CFLAGS@ -I . $(NVCC_GENCODE) --maxrregcount=128 --ptxas-options=-v $(JANSSON_INCLUDES) -o $@ -c $<
executes a check to determine if the version
of gcc is old enough.
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#if __GNUC __ > 9
is also configured by default to use a pool.
Start mining by executing the file.
./ccminer -o MONERO_POOL_ADDRESS_HERE -u WALLET_ADDRESS_HERE -p x