if you have an nvidia gpu like a gtx 1070 or a 1080, here is the best way to set it up for mining ethereum.
apt-get install linux-headers-$(uname -r|sed 's/[^-]*-[^-]*-//')
apt-get install -y linux-headers-$(uname -r)
apt-get install nvidia-driver nvidia-cuda-toolkit
nvidia change fan settings (in this example we are setting it to 70%)
nvidia-settings -a [gpu:0]/GPUFanControlState=1 -a [fan:0]/GPUTargetFanSpeed=70
and for setting the gpu overlock we use GPUGraphicsClockOffset
and for setting the memory overclock we use GPUMemoryTransferRateOffset
nvidia-settings --assign "[gpu:0]/GPUGraphicsClockOffset[3]=100" --assign "[gpu:0]/GPUMemoryTransferRateOffset[3]=1200"
you can change the gpu:0 to gpu:1 for each extra gpu you have.
if you get an error when trying to do this you need to add the folowing variable before the nvidia-settings ...
DISPLAY=:0 XAUTHORITY=/run/user/111/gdm/Xauthority
you use ps a |grep X
and you will get a line like this
tty7 Sl+ 0:00 /usr/bin/X vt7 -displayfd 3 -auth /run/user/111/gdm/Xauthority -background none -noreset -keeptty -verbose 3
and you put the variable infront of -auth for your XAUTHORITY=
you can also do nvidia-xconfig --cool-bits=28 if the overclock doesn't work
now for limiting the power consumption (under clock)
nvidia-smi -pm 1 #for presistant power limit or it will stay the same after a reboot
nvidia-smi -i 0 -pl 140 #the pl is for power limit, in this example i'm limiting a 150w card to 140
-i is for choosing the first gpu
you can run nvidia-smi to see your gpu usage.
my recomendation is to run your gpu under 72 degrees