- Start Ubuntu
- 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
- Set up logging
# Move existing _LOG_FILE_ to a timestamped file
# Create new _LOG_FILE_ in ~/mining-scripts
- 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_