Ethereum Mining Guide: Build and Optimize Your GPU Mining Rig

·

Ethereum mining has long been a popular entry point into the world of cryptocurrency for tech-savvy enthusiasts. While Ethereum has transitioned to a proof-of-stake model, understanding how to build and configure a GPU mining rig remains valuable for those interested in alternative proof-of-work blockchains or historical context. This comprehensive guide walks you through constructing a high-performance mining rig using NVIDIA graphics cards and the Ubuntu Server LTS operating system.

By leveraging open-source software and general-purpose computing, your rig can be easily maintained, upgraded, and even repurposed for other compute-intensive tasks like machine learning—especially if you're using NVIDIA GPUs with CUDA support.


Why Choose Ubuntu for Ethereum Mining?

Before diving into hardware and setup, it's worth considering why Ubuntu Server LTS is a strong choice for mining rigs. Unlike specialized mining OSes such as ethOS or consumer-focused Windows, Ubuntu offers:

This makes Ubuntu an ideal long-term platform, especially if mining profitability fluctuates.

👉 Discover how blockchain technology is evolving beyond mining


Step 1: Selecting the Right Hardware

Building a mining rig starts with selecting compatible and efficient components. Below is a recommended parts list for a 6-GPU setup using NVIDIA cards. While specific models may vary in availability, this configuration serves as a solid foundation.

Core Components

Power and Compatibility Tips


Step 2: Assembling the Mining Rig

Careful assembly ensures stability, cooling efficiency, and ease of troubleshooting.

Frame and Base Setup

Begin by assembling the aluminum frame. Secure the motherboard tray and ensure all standoffs are properly placed to prevent short circuits.

Mounting Key Components

  1. Install the CPU, RAM, and heatsink onto the motherboard before securing it to the frame.
  2. Attach the SSD using SATA or M.2 connections.
  3. Mount the power supply at the designated spot and connect the 24-pin ATX and 8-pin EPS power cables to the motherboard.

GPU Installation

  1. Position each graphics card on the frame’s support brackets.
  2. Connect each GPU to a riser card using the PCIe slot.
  3. Insert riser daughterboards into the motherboard’s PCIe slots.
  4. Link each riser card to its daughterboard via USB 3.0 cable.
  5. Connect PCIe power cables directly from the PSU to each GPU.

Ensure all risers are securely fastened and powered. Poor connections here are a common cause of undetected GPUs.

👉 Learn how to maximize your digital asset potential today


Step 3: Installing Ubuntu and Mining Software

With hardware assembled, it’s time to install the operating system and configure mining software.

Preparing the BIOS

  1. Enter BIOS (usually by pressing Delete or F2 at boot).
  2. Update BIOS to the latest version for improved stability.
  3. Enable Above 4G Memory/Resizing under PCI settings.
  4. Set primary display output to Integrated Graphics (IGD) if available.
  5. Save settings and reboot.

Installing Ubuntu Server LTS

  1. Boot from USB with Ubuntu Server ISO.
  2. At the GRUB menu, edit the boot line and add:
    nouveau.modeset=0
    This prevents conflicts with the open-source NVIDIA driver.
  3. Proceed with standard installation—set up user, network, and disk partitioning.
  4. Reboot after installation and reapply nouveau.modeset=0 in GRUB.

Verifying GPU Detection

Run:

lspci | grep -i vga

Ensure all six GPUs appear. If not:


Installing NVIDIA Drivers on Ubuntu

To maximize GPU performance, use NVIDIA’s proprietary drivers compiled for your kernel.

Step-by-Step Driver Installation

  1. Install build tools:

    sudo apt install gcc g++ make
  2. Download and compile GCC 7.4 (matching kernel build environment):

    cd /opt
    sudo wget https://ftp.gnu.org/gnu/gcc/gcc-7.4.0/gcc-7.4.0.tar.xz
    sudo tar xJf gcc-7.4.0.tar.xz
    cd gcc-7.4.0
    ./contrib/download_prerequisites
    mkdir build && cd build
    ../configure --disable-multilib --enable-checking=release
    make -j2 && sudo make install
  3. Enable source repositories in /etc/apt/sources.list:

    deb-src http://archive.ubuntu.com/ubuntu bionic main restricted
  4. Install kernel headers and source:

    sudo apt update
    sudo apt install dpkg-dev libssl-dev
    apt source linux-image-unsigned-$(uname -r)
  5. Prepare kernel source directory:

    cd /usr/src/linux-4.15.0
    cp /boot/config-$(uname -r) .config
    cp /usr/src/linux-headers-$(uname -r)/Module.symvers ./
    make oldconfig && make prepare && make modules_prepare
  6. Edit utsrelease.h to match your kernel version:

    #define UTS_RELEASE "4.15.0-55-generic"
  7. Download NVIDIA driver (e.g., NVIDIA-Linux-x86_64-430.14.run) and install:

    sudo chmod +x NVIDIA-Linux-x86_64-430.14.run
    sudo CC=/usr/local/bin/gcc ./NVIDIA-Linux-x86_64-430.14.run --kernel-source-path=/usr/src/linux-4.15.0
  8. Blacklist Nouveau driver:
    Create /etc/modprobe.d/blacklist-nouveau.conf:

    blacklist nouveau
    options nouveau modeset=0

    Then run:

    sudo update-initramfs -u
  9. Reboot and verify:

    nvidia-smi

    All GPUs should now appear with driver status.


Setting Up the Mining Software

We’ll use ethminer, a popular open-source Ethereum miner.

Installation Steps

  1. Download from GitHub:

    wget https://github.com/ethereum-mining/ethminer/releases/download/v0.17.1/ethminer-0.17.1-linux-x86_64.tar.gz
    tar xzf ethminer-0.17.1-linux-x86_64.tar.gz
    sudo cp ethminer-0.17.1-linux-x86_64/bin/ethminer /usr/bin/
  2. Test stability:

    ethminer -U -M 1

    Watch for crashes—this reveals power or thermal issues.

  3. Create a systemd service file /etc/systemd/system/eth-miner.service:

    [Unit]
    Description=Mine Ether
    [Service]
    Environment=GPU_FORCE_64BIT_PTR=0
    Environment=GPU_MAX_HEAP_SIZE=100
    Environment=GPU_USE_SYNC_OBJECTS=1
    Environment=GPU_MAX_ALLOC_PERCENT=100
    Environment=DISPLAY=:0
    Environment=XAUTHORITY=/home/youruser/.Xauthority
    WorkingDirectory=/home/youruser
    ExecStart=/bin/bash --login -c "ethminer -U --farm-recheck 200 -P stratum1+ssl://[email protected]:5555"
    Restart=always
    [Install]
    WantedBy=multi-user.target
  4. Enable and start the service:

    sudo systemctl daemon-reload
    sudo systemctl enable eth-miner.service
    sudo service eth-miner start
  5. Monitor logs:

    journalctl -u eth-miner.service -f

After 5–10 minutes, your hashrate should appear on Ethermine dashboard.


Frequently Asked Questions (FAQ)

Q: Can I use AMD GPUs instead of NVIDIA?
A: Yes, but driver setup differs significantly—use amdgpu-pro drivers and adjust mining parameters accordingly.

Q: Why does my rig reboot during stress tests?
A: Likely due to insufficient PSU wattage or unstable power delivery. Check connections and consider upgrading your PSU.

Q: Is Ubuntu better than ethOS for mining?
A: Ubuntu offers more flexibility and long-term usability, while ethOS is optimized purely for mining performance.

Q: Can I repurpose my rig after mining?
A: Absolutely—especially with NVIDIA GPUs, you can shift to machine learning, rendering, or distributed computing projects.

Q: How do I monitor temperatures remotely?
A: Use tools like nvtop, htop, or set up Prometheus/Grafana dashboards over SSH.

Q: What happens if mining becomes unprofitable?
A: You can switch algorithms or cryptocurrencies, or reconfigure the rig for other GPU-intensive applications.

👉 Explore next-generation crypto platforms built for performance


This guide covers core principles applicable beyond Ethereum, including GPU optimization, system stability, and efficient resource management—essential skills in today’s decentralized computing landscape.