Skip to content

Instantly share code, notes, and snippets.

@marktellez
Created March 2, 2018 15:59
Show Gist options
  • Save marktellez/7fdb1dc2784d348c2365a3c1cdea5888 to your computer and use it in GitHub Desktop.
Save marktellez/7fdb1dc2784d348c2365a3c1cdea5888 to your computer and use it in GitHub Desktop.
Breaking down the mining process to automate it
  1. Start Ubuntu
  2. Set headless mode
# Start X as a background process and set the default screen to 0
X :0 &
# Export the default display
export DISPLAY=:0
# Sleep for 3 seconds to allow X to start
sleep 3
  1. Set up logging
# Move existing _LOG_FILE_ to a timestamped file
# Create new _LOG_FILE_ in ~/mining-scripts
  1. Overclock all GPUs
# Set coolbits and create a /etc/Xorg/xconf for each GPU
sudo nvidia-xconfig -s -a --enable-all-gpus --allow-empty-initial-configuration --cool-bits=28
# Turn on power management
sudo nvidia-smi -pm 1
# Copy existing _CONFIG_FILE_ to a timestamped file
# Load GPU _CONFIG_FILE_
# Update config file to get _GPU_INDEX_ via the _UUID_
# Loop through config to overclock each GPU
# Apply a memory overclock
nvidia-settings -a [gpu:_GPU_INDEX_]/GPUMemoryTransferRateOffset[3]=_MEM_OVERCLOCK_
# Turn on fan control
nvidia-settings -a [gpu:_GPU_INDEX_]/GPUFanControlState=1
# Set fan speed
nvidia-settings -a [fan:_GPU_INDEX_]/GPUTargetFanSpeed=_FAN_SPEED_%_
# Apply undervolting
sudo nvidia-smi -i _GPU_INDEX_ -pl _POWER_IN_WATTS_
# Write results to the _LOG_FILE_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment