Skip to content

Instantly share code, notes, and snippets.

@streslab
Last active April 4, 2022 23:45
Show Gist options
  • Save streslab/c51e09ca0e44c79910a4bd26b924eccd to your computer and use it in GitHub Desktop.
Save streslab/c51e09ca0e44c79910a4bd26b924eccd to your computer and use it in GitHub Desktop.

Revisions

  1. streslab revised this gist Mar 25, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -117,9 +117,9 @@ Helpful overclocking commands:
    // Set GPU 0 power level to 100W
    sudo nvidia-smi -i 0 -pl 100
    // Enable GPU 0 manual fan control and set to 50%
    nvidia-settings -a '\[gpu:0]/GPUFanControlState=1' -a '\[fan:0]/GPUTargetFanSpeed=50'
    nvidia-settings -a '[gpu:0]/GPUFanControlState=1' -a '[fan:0]/GPUTargetFanSpeed=50'
    // Increase GPU 0 memory clock by 1000Hz
    nvidia-settings -a '\[gpu:0]/GPUMemoryTransferRateOffset\[3]=1000'
    nvidia-settings -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=1000'

    ## Set Up Ethminer
    TODO
  2. streslab revised this gist Mar 25, 2018. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,7 @@ To complete this guide, you should already have:
    I downloaded a copy of Ubuntu Server 16.04 (amd64) and copied it to a USB flash drive using dd.

    The hard drive was partitioned as follows:

    Partition 0: 256MB - EFI
    Partition 1: 8GB - swap
    Partition 2: 40GB - /
    @@ -38,23 +39,27 @@ If you receive an error that a file system could not be created on the EFI parti
    ### Installing Necessary Utilities

    The first order of business after logging in the first time is to update and install SSH:

    sudo apt update
    sudo apt upgrade
    sudo apt install openssh-server

    Take note of the IP address:

    ip addr show

    At this point, the monitor and keyboard can be disconnected. I then connected over SSH to ensure that I was not inadvertently relying on a connected monitor in any way while performing the rest of the setup.

    These utilities will be required to install and run the NVIDIA driver/utilities:

    sudo apt install build-essential libgtk-3-0 xorg

    ### Installing the NVIDIA driver

    Go to the [NVIDIA website](http://www.nvidia.com/Download/index.aspx?lang=en-us) and download the latest Linux 64-bit driver.

    Extract the archive and execute the installation script:

    gzip -d NVIDIA-Linux-x86_64-xxx.xx.tar.gz
    tar -xvf NVIDIA-Linux-x86_64-xxx.xx.tar
    chmod +x NVIDIA-Linux-x86_64-xxx.xx.run
    @@ -65,12 +70,15 @@ Feel free to answer 'Yes' to running nvidia-xconfig, though it will probably onl
    Run nvidia-smi to ensure that all the GPUs are visible. If some or all are missing, stop and troubleshoot.

    Reboot the machine:

    sudo init 6

    Run nvidia-xconfig to enable overclocking and allow things to work without a real monitor connected:

    sudo nvidia-xconfig --cool-bits=31 --allow-empty-initial-configuration

    Check the /etc/X11/xorg.conf file to ensure all GPUs have been configured. Each GPU should have a Device, Monitor, and Screen section. The Screens should show the following options:

    Section "Screen"
    Identifier "ScreenX"
    Device "DeviceX"
    @@ -88,20 +96,24 @@ Check the /etc/X11/xorg.conf file to ensure all GPUs have been configured. Each
    Annoyingly enough, you will need to start an X server in order to overclock the GPUs. Doing this also requires root privileges, so I updated my sudoers file to slightly ease the pain.

    Using visudo, I added the following lines to sudoer:

    USERNAME HOST = (root) NOPASSWD: /usr/bin/xinit
    USERNAME HOST = (root) NOPASSWD: /usr/bin/nvidia-smi
    Note: replace USERNAME and HOST with your specific info. For example, joe@glados would use "joe glados =..."

    ## Overclocking

    Start an X server and push it into the background:

    sudo xinit &
    export DISPLAY=:0.0

    Enable persistence mode on the GPUs:

    sudo nvidia-smi -pm 1

    Helpful overclocking commands:

    // Set GPU 0 power level to 100W
    sudo nvidia-smi -i 0 -pl 100
    // Enable GPU 0 manual fan control and set to 50%
  3. streslab revised this gist Mar 25, 2018. 1 changed file with 95 additions and 1 deletion.
    96 changes: 95 additions & 1 deletion Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,100 @@ To complete this guide, you should already have:
    * ASUS Z270-P Motherboard
    * Intel Celeron G3930 Processor
    * 8GB DDR4 RAM
    * 128GB HDD
    * EVGA SuperNOVA G3 750W ATX PSU
    * 2x NVIDIA GTX 1060
    * 3x NVIDIA GTX 1070
    * Monitor and Keyboard (for initial installation)
    * Monitor and Keyboard (for initial installation)

    ## Basic Setup

    ### Installing the Operating System

    I downloaded a copy of Ubuntu Server 16.04 (amd64) and copied it to a USB flash drive using dd.

    The hard drive was partitioned as follows:
    Partition 0: 256MB - EFI
    Partition 1: 8GB - swap
    Partition 2: 40GB - /
    Partition 3: 30GB - /home
    Note: There is plenty of room for optimization in this partitioning scheme. Only about ~3GB of the root partition will be used in the end. Reduce at your own risk!

    If you receive an error that a file system could not be created on the EFI partition, try deleting and recreating the partition. Also ensure that no other EFI hard drives are connected.

    ### Installing Necessary Utilities

    The first order of business after logging in the first time is to update and install SSH:
    sudo apt update
    sudo apt upgrade
    sudo apt install openssh-server

    Take note of the IP address:
    ip addr show

    At this point, the monitor and keyboard can be disconnected. I then connected over SSH to ensure that I was not inadvertently relying on a connected monitor in any way while performing the rest of the setup.

    These utilities will be required to install and run the NVIDIA driver/utilities:
    sudo apt install build-essential libgtk-3-0 xorg

    ### Installing the NVIDIA driver

    Go to the [NVIDIA website](http://www.nvidia.com/Download/index.aspx?lang=en-us) and download the latest Linux 64-bit driver.

    Extract the archive and execute the installation script:
    gzip -d NVIDIA-Linux-x86_64-xxx.xx.tar.gz
    tar -xvf NVIDIA-Linux-x86_64-xxx.xx.tar
    chmod +x NVIDIA-Linux-x86_64-xxx.xx.run
    sudo ./NVIDIA-Linux-x86_64-xxx.xx.run

    Feel free to answer 'Yes' to running nvidia-xconfig, though it will probably only pick up the first card at this time.

    Run nvidia-smi to ensure that all the GPUs are visible. If some or all are missing, stop and troubleshoot.

    Reboot the machine:
    sudo init 6

    Run nvidia-xconfig to enable overclocking and allow things to work without a real monitor connected:
    sudo nvidia-xconfig --cool-bits=31 --allow-empty-initial-configuration

    Check the /etc/X11/xorg.conf file to ensure all GPUs have been configured. Each GPU should have a Device, Monitor, and Screen section. The Screens should show the following options:
    Section "Screen"
    Identifier "ScreenX"
    Device "DeviceX"
    Monitor "MonitorX"
    DefaultDepth 24
    **Option "AllowEmptyInitialConfiguration" "True"
    Option "Coolbits" "31"**
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection

    ### Miscellaneous Adjustments

    Annoyingly enough, you will need to start an X server in order to overclock the GPUs. Doing this also requires root privileges, so I updated my sudoers file to slightly ease the pain.

    Using visudo, I added the following lines to sudoer:
    USERNAME HOST = (root) NOPASSWD: /usr/bin/xinit
    USERNAME HOST = (root) NOPASSWD: /usr/bin/nvidia-smi
    Note: replace USERNAME and HOST with your specific info. For example, joe@glados would use "joe glados =..."

    ## Overclocking

    Start an X server and push it into the background:
    sudo xinit &
    export DISPLAY=:0.0

    Enable persistence mode on the GPUs:
    sudo nvidia-smi -pm 1

    Helpful overclocking commands:
    // Set GPU 0 power level to 100W
    sudo nvidia-smi -i 0 -pl 100
    // Enable GPU 0 manual fan control and set to 50%
    nvidia-settings -a '\[gpu:0]/GPUFanControlState=1' -a '\[fan:0]/GPUTargetFanSpeed=50'
    // Increase GPU 0 memory clock by 1000Hz
    nvidia-settings -a '\[gpu:0]/GPUMemoryTransferRateOffset\[3]=1000'

    ## Set Up Ethminer
    TODO
  4. streslab revised this gist Mar 25, 2018. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,19 @@
    # Headless Ethereum Miner Setup
    # Headless Ethereum Miner Setup - NVIDIA
    *Reed Slaby, March 2018*

    Having grown tired of wasting a perfectly good monitor on my ethereum mining rig, I finally decided to replace the Ubuntu Desktop 16.04 installation with Ubuntu Server 16.04. Many of the gtutorials available at the time of this writing range from unecessarily complicated to flat-out wrong. This guide is intended to address many of those shortfalls.

    ## Prerequisites

    To complete this guide, you should already have:
    * Basic knowledge of Linux
    * An Ethereum wallet

    ### Hardware Used

    * ASUS Z270-P Motherboard
    * Intel Celeron G3930 Processor
    * 8GB DDR4 RAM
    * 2x NVIDIA GTX 1060
    * 3x NVIDIA GTX 1070
    * Monitor and Keyboard (for initial installation)
  5. streslab revised this gist Mar 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    # Headless Ethereum Mining Setup using Ubuntu Server 16.04
    # Headless Ethereum Miner Setup
  6. streslab revised this gist Mar 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    #Headless Ethereum Mining Setup using Ubuntu Server 16.04
    # Headless Ethereum Mining Setup using Ubuntu Server 16.04
  7. streslab revised this gist Mar 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    Hello World
    #Headless Ethereum Mining Setup using Ubuntu Server 16.04
  8. streslab created this gist Mar 25, 2018.
    1 change: 1 addition & 0 deletions Headless_Ethereum_Ubuntu_16.04.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Hello World