5.5 KiB
NVidia GPU
!!! warning This is not a complete recipe - it's a component of the cryptominer "uber-recipe", but has been split into its own page to reduce complexity.
Ingredients
- Nvidia drivers for your GPU
- Some form of X11 GUI preconfigured on your linux host (yes, it's a PITA, but it's necessary for overclocking)
Preparation
Install kernel-devel and gcc
The nVidia drivers will need the kernel development packages for your OS installed, as well as gcc. Run the following (for CentOS - there will be an Ubuntu equivalent):
yum install kernel-devel-$(uname -r) gcc
Remove nouveau
Your host probably already includes nouveau, free/libre drivers for Nvidia graphics card. These won't cut it for mining, so blacklist them to avoid conflict with the dirty, proprietary Nvidia drivers:
echo 'blacklist nouveau' >> /etc/modprobe.d/blacklist.conf
dracut /boot/initramfs-$(uname -r).img $(uname -r) --force
systemctl disable gdm
reboot
Install Nvidia drivers
Download and uncompress the Nvidia drivers, and execute the installation as root, with a command something like this:
bash NVIDIA-Linux-x86_64-352.30.run
Update your X11 config by running:
nvidia-xconfig
Enable GUID
systemctl enable gdm
ln -s '/usr/lib/systemd/system/gdm.service' '/etc/systemd/system/display-manager.service'
reboot
Overclock
Preparation
!!! warning Like overclocking itself, this process is still a work in progress. YMMV.
Of course, you want to squeeze the optimal performance out of your GPU. This is where the X11 environment is required - to adjust GPU clock/memory settings, you need to use the nvidia-settings command, which (stupidly) requires an X11 display, even if you're just using the command line.
The following command: configures X11 for a "fake" screen so that X11 will run, even on a headless machine managed by SSH only, and ensures that the PCI bus ID of every NVidia device is added to the xorg.conf file (to avoid errors about "(EE) no screens found(EE)")
nvidia-xconfig -a --allow-empty-initial-configuration --cool-bits=28 --use-display-device="DFP-0" --connected-monitor="DFP-0" --enable-all-gpus --separate-x-screens
!!! note The script below was taken from https://github.com/Cyclenerd/ethereum_nvidia_miner
Make a directory for your overclocking script. Mine happens to be /root/overclock/, but use whatever you like.
Create settings.conf as follows:
# Known to work with Nvidia 1080ti, but probably not optimal. It's an eternal work-in-progress.
MY_WATT="200"
MY_CLOCK="100"
MY_MEM="400"
MY_FAN="60"
Then create nvidia-overclock.sh as follows:
#!/usr/bin/env bash
#
# nvidia-overclock.sh
# Author: Nils Knieling - https://github.com/Cyclenerd/ethereum_nvidia_miner
#
# Overclocking with nvidia-settings
#
# Load global settings settings.conf
if ! source ~/overclock/settings.conf; then
echo "FAILURE: Can not load global settings 'settings.conf'"
exit 9
fi
export DISPLAY=:0
# Graphics card 1 to 6
for MY_DEVICE in {0..5}
do
# Check if card exists
if nvidia-smi -i $MY_DEVICE >> /dev/null 2>&1; then
nvidia-settings -a "[gpu:$MY_DEVICE]/GPUPowerMizerMode=1"
# Fan speed
nvidia-settings -a "[gpu:$MY_DEVICE]/GPUFanControlState=1"
nvidia-settings -a "[fan:$MY_DEVICE]/GPUTargetFanSpeed=$MY_FAN"
# Graphics clock
nvidia-settings -a "[gpu:$MY_DEVICE]/GPUGraphicsClockOffset[3]=$MY_CLOCK"
# Memory clock
nvidia-settings -a "[gpu:$MY_DEVICE]/GPUMemoryTransferRateOffset[3]=$MY_MEM"
# Set watt/powerlimit. This is also set in miner.sh at autostart.
sudo nvidia-smi -i "$MY_DEVICE" -pl "$MY_WATT"
fi
done
echo
echo "Done"
echo
Start your engine!
Once you've got X11 running correctly, execute ,/nvidia-overclock.sh, and you should see something like the following:
[root@kvm overclock]# ./nvidia-overclock.sh
Attribute 'GPUPowerMizerMode' (kvm.funkypenguin.co.nz:0[gpu:0]) assigned value 1.
Attribute 'GPUFanControlState' (kvm.funkypenguin.co.nz:0[gpu:0]) assigned value 1.
Attribute 'GPUTargetFanSpeed' (kvm.funkypenguin.co.nz:0[fan:0]) assigned value 60.
Attribute 'GPUGraphicsClockOffset' (kvm.funkypenguin.co.nz:0[gpu:0]) assigned value 100.
Attribute 'GPUMemoryTransferRateOffset' (kvm.funkypenguin.co.nz:0[gpu:0]) assigned value 400.
Power limit for GPU 00000000:04:00.0 was set to 150.00 W from 150.00 W.
All done.
Done
[root@kvm overclock]#
Play with changing your settings.conf file until you break it, and then go back one revision :)
Continue your adventure
Now, continue to the next stage of your grand mining adventure:
- Build your mining rig 💻
- Setup your AMD or Nvidia (this page) GPUs 🎨
- Sign up for mining pools 🏊
- Setup your miners with Miner Hotel 🏨
- Send your coins to exchanges or wallets 💹
- Monitor your empire 💓
- Profit! 💰
Chef's Notes
Tip your waiter (donate) 👏
Did you receive excellent service? Want to make your waiter happy? (..and support development of current and future recipes!) See the support page for (free or paid) ways to say thank you! 👏