• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Former overclocker playing around with mining

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.
It's more complicated than this. However the solution for ubuntu server is here:
https://gist.github.com/johnstcn/add029045db93e0628ad15434203d13c
Unlike so many results you get by searching the web for the solution - this one gives all the details.
I followed it and now I can change clock settings over ssh on ubuntu server. The command to add 100 mhz to the core clock looks like this:

Code:
sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -a [gpu:0]/GPUGraphicsClockOffset[3]=100
[sudo] password for xxx:
Attribute 'GPUGraphicsClockOffset' (skvetta:0[gpu:0]) assigned value 100.

After getting this to work I switched my miners to ubuntu server.
 
Last edited:
Ok, I got two "multi" GPU rigs now (two cards each and ready for more), I want to share with you how to set up headless UBUNTU linux server with good control over the cards via remote SSH service.

This works for typical PC with one Nvidia card on the motherboard during installation. Start with that, don't connect risers right away. (perhaps it works fine I just haven't tried and adding them later is almost plug and play)

Ok - get Ubuntu Server 16.04.4 LTS iso - and do the install with keyboard and monitor. Only thing you have to select during the install is to install the SSH server. After install reboot the machine and type $ifconfig - to see the IP for the box so you can SSH into it with $ssh 192.168.1.x or whatever IP you got. Then park the box in a dark place without monitor or keyboard but LAN access. Then use whatever ssh client to ssh into it.

Once in SSH to the machine:
Code:
$sudo apt-get update
$sudo apt-get upgrade
$sudo reboot
$sudo apt-add-repository ppa:graphics-drivers/ppa
$sudo apt update
$sudo apt install -y nvidia-390 nvidia-cuda-toolkit
$sudo reboot
$sudo apt install --no-install-recommends xorg lightdm
$sudo power off.
This does big update on the server, installs repository for graphics drivers and installs Nvidia 390 driver, Nvidia-CUDA toolkit and minimal X server and a display manager (lightdm). I put in two reboots for good measure and lastly the box is shut off. Now you connect your riser(s) and start it up again.

SSH into it once again.
This one should show you connected graphics cards
Code:
$nvidia-smi

If you see your cards it's time to create configuration file for them. Note the --enable all gpus section. This command creates a separate "screen" section for EACH vid-card in the xorg.conf configuration file. Something necessary for clock control over them. This command gives an error message but also indicates it has created xorg.conf file in /etc/X11/xorg.conf
Code:
$sudo nvidia-xconfig --enable-all-gpus

Let's take a look at the configuration file for X.
Code:
$sudo nano /etc/X11/xorg.conf

Near the bottom of the file you hopefully see "screen" section that looks like this - and remember one for EACH card you got plugged in.

Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection

Modify it by adding these lines into each "screen" section (paste with nano is ctrl+shift+v)
Option "AllowEmptyInitialConfiguration" "True"
Option "ConnectedMonitor" "DFP-0"
Option "Interactive" "False"
Option "Coolbits" "12"

In my box the final version looks like this with two cards:
Code:
Section "Screen"
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "ConnectedMonitor" "DFP-0"
    Option         "Interactive" "False"
    Option         "Coolbits" "12"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "ConnectedMonitor" "DFP-0"
    Option         "Interactive" "False"
    Option         "Coolbits" "12"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection

The coolbits thing enables manual clock control (and god knows what), the other stuff is to trick the "nvidia-settings" program to do it's job without proper display features (or whatever and it works over SSH just fine. You can get better explanation here:

After this you start the x server:
$sudo service lightdm start

Install is Done! :salute:

Now, either with the cards mining or not use this command to get detailed info about the card(s) status, power, clock speed etc. Add -q and it gives more details, without it gives quick glance - check it out.

Code:
$nvidia-smi

Screenshot from 2018-03-02 02-05-13.png

To change settings you either use nvidia-smi or nvidia-settings. Google is your friend here, but lets see some examples:
Set all GPU's in persistance mode to keep the driver and settings loaded all the time. You loose them all however during power off or reboot.
Code:
$sudo nvidia-smi -pm 1
Sets the power level for GPU0 to 160 watts.
Code:
sudo nvidia-smi -i 0 -pl 160
Sets power level for GPU1 to 100 watts.
Code:
sudo nvidia-smi -i 1 -pl 100

And here comes the part that took me quite a while to get working:
Change memory clock on GPU0 - add 1000mhz:
Code:
sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -a [gpu:0]/GPUMemoryTransferRateOffset[3]=1000
Add 150 mhz to GPU clock on GPU1
Code:
sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -a [gpu:1]/GPUGraphicsClockOffset[3]=150

Enable manual fan control for gpu0 (careful here because this might leave your fans off under load if you dont set them to speed)
Code:
sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -a '[gpu:0]/GPUFanControlState=1'

Set fan speed on gpu0.
Code:
sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -a '[fan:0]/GPUTargetFanSpeed=85'

That's it. Enjoy!
 
Last edited:
Here is a screenshot from "Glofaxi" - he is intel core 2 duo 6400 with 2 gigs of ram running one Gigabyte 1080-8gb and MSI 1060-3gb. With Seasonic 750w psu. It's been up for 52 hours, I can't remember if I restarted the mining process, don't think so. It almost boring it runs so well. I am not seeing any performance issues because of this old hardware mining Zcash with EWBF's miner.

Both cards are on +150 GPU and +1000 memory, 160watts for the 1080 and 100 for the 1060.

Screenshot from 2018-03-02 01-35-51.png
 
Last edited:
Following the clocks on the cards - here is what I see:

Limit the power level and the driver automatically reduces clock speed. To compensate you have to add to the clocks. So the clocks are not actually running much over the stock max limit. They are just not on reduced speed.
 
nice job ! this can be a guide btw ;)
also glad you're moving towards multi-gpu setups, it just makes sense from an efficiency pov
 
Thanks.

I spent way to much time figuring this out - not to share it! :)
I still can't find a way to control the fan speeds. And the adaptive clocks are fighting me. I can still alter the clock speeds up to unstable levels and crash the cards but finding the sweet spot where the card is running on full clocks at reduced power is a bit tricky. And once you have found that setting the numbers you are adding to the clocks are so high the card crashes at startup before the adaptive control can kick in. (or something like that). Annoying so to speak, but in reality hardly a big deal. For the long run it's hardly practical to run the cards on the edge of stability. Temp swings or whatever will probably crash them when I am on a vacation.


The cat dragged in used 1060 3g card I am testing right now. Adding it to the miners after I am done figuring out what it will do.

Edit:

I did figure out how to enable manual fan speed and now I can set the fan speeds individually for each card. I edited the instruction post above and added the commands for the fans. Problem was "coolbits" in the "screen" section in /etc/X11/xorg.conf. I used 24 this didn't enable the fan control. 12 does. If I understand correctly this coolbit thingy is a binary register that enables various unsupported features like overclocking and fan controls and possibly voltage control and whatnot. By that logic I tried 255 (1111 1111 -binary) for the coolbits and this seems to work fine. Hopefully dangerous as well. :D
 
Last edited:
Money:

I have bought for my mining hobby (approx numbers)

ASUS 1080 $1000
Gigabyte 1080 $1000
Msi 1060-3g $340
Asus dual 1060-3g $390
Gigayte 1060-3g $300
Seasonic 750w psu $200
Raidmax Thunder 750W $130

Invested so far $3360


I am sitting @ 1900 H/s on flypool mining zcash. Currently time between payouts of 0.01 ZEC is just below 11 hours.
A month or 30 days is 24*30=720 hours. 720/11 gives approx 65 payouts of 0.01 ZEC or 0.65 ZEC total per month. At current exchange rates that about $260 per month.
It seems my rigs are using total of 760W right now. So 0.76kw*720hours*0.13$/kwh=$71/ month.

After paying electricity I have left approx $190 per month. To recoup the invested $3360 will take 3360/190 =~18 months.

I suspect long before that - mining profits will be reduced so this will will be just one more expensive hobby. :screwy:
 
Where are you buying your stuff???? Are those prices in USD? You paid $1000 for regular 1080's? Man no offense but you got really ripped off on just about everything on that list. Friend of my recently just bought a 1080 FTW2 right off EVGA's website for $660. They aren't in stock all the time, but you can get brand new 1080's all the time under 700. Even a gtx 1080 Ti I wouldn't pay $1000 for! $300 was an OK but not great price for the 1060 3gb but 340 and 390 is way too high. The PSU's are also overpriced. That 750w seasonic you shouldn't pay more than $130 for. IMO you overpaid by about a thousand dollars for all that hardware!
 
I am in Iceland. And I converted all prices to USD. We don't have US prices over here in the far north. Everything I buy abroad -for example from the US- carries freight cost probably $50 for small $500+ item with tracking and insurance via USPS. And when it arrives (usually after 3 weeks with USPS priority) I have to pay 24% value added tax on both purchase price + freight cost.

So a $700 item would be 750 with freight and $930 at my doorstep after 2-3 weeks. And then is the issue of warranty...

:)
 
Last edited:
Happy Mining and welcome to the Community!
Nice info on the Linux setup. Been curious if I should look into that myself for my other rig I have.

That exchange rate of Zec seems off... Its mid 300's right now, was upper 300's last week, so your current numbers should be a little higher at least per month as is. But if your expecting that payoff time frame to stand, you might want to revisit it. There are calculators to help see what the payoff timeframe is for gear/currency mining, power cost, equipment cost, diffuclty increase, potential currency increase in price, etc. Sorry forgot the site name but if I find it I'll post it.

If your payout time will increase over time, which most likely it will, its going to increase payoff time for the gear. Though as things stabilize, and stop doing what ever it has been in the past week. Prices should be pretty stable/slightly increasing over time which might help offset the difficulty.

Here are some information I have dating back to October last year. All numbers below are based off 0.02zec payout
I had 1.0k rig mining that pays out around the 28-31 hour range. (October to early Jan)
I added 2 extra cards and managed to get 1.6k average, and payouts went to 18-20 hours. (Jan to Early Feb)
About 1 month after this same setup at 1.6k average, I was getting payouts around 24-27 hours. (Early Feb to Mid Feb)
Recently dropped one card (sold) and now sitting at roughly 1.38k average and getting payouts around 29-32 hours. (Mid Feb to Current)

Note the drastic change was roughly a 2 month window! If popularity increases at a steady rate, expect roughly a 25-30% increase in difficulty every 2 months at current trends. Though I think this kick up is part of last years fall out of the huge price jumps with Crypto and really should stabilize a little more now.
 
Hi deathman20, thanks for warm welcome and good info. Your numbers seem pretty consistent with what I am seeing. I am at just over 11 hours between payouts of 0.01 zec running @ 1.9K currently. And yes, zec has dropped a lot since I wrote the post above. I was actually expecting that but perhaps not so fast so soon.

BTW "coionwarz" has nice charts for difficulty rates for many currencies. Here is zcash: https://www.coinwarz.com/difficulty-charts/zcash-difficulty-chart

I am digging in for the long haul. I am setting up my miners so they require minimum care and won't bother me with noise and heat. This is going to be a long ride. Something tells me we can pick up cheap graphics cards in the near future if we want to feed our hobby with more equipment. :)
 
zcash node

I set up the official zcash wallet on one of the miners since it's cpu has nothing better to do - and since I am mining zcash for the moment - why not. This machine has early version of Intel I5 and 6gig of ram. It was sluggish as hell after starting this thing up and barely responsive for few hours. When I went to sleep last night (early morning actually) this was the situation. Note how many transactions are verified - no wonder the CPU was busy. This however didn't effect the mining speeds on the two cards it was running at the same time. :cool:

zcash-node.png

I cant remember the final number of verified transactions before it caught up with the chain, probably 6-7M. After finishing downloading the block-chain things settle and the past 10 hours it has only verified 14k transactions. So it doesn't seem to pose any problems or much extra cost. This thing requires 13Gig of diskspace currently.
 
Last edited:
Changed 2x1060 cards to mining ETH. Combined they do 39mhz, Same power and clock settings as with zcash seem to work best. Using etherniner for linux. About a month ago zcash was close to $500 to Now ~ $230. Expecting it to test $200 soon. Thankfully my little mining project is just a hobby and has been great fun. I expect very boring months ahead while the market figures out what to do with all these crypto-currencies. Most will die because the world don't need them. All follow the price swing in Bitcoin. For the media, the public and everyone else that matters in the big picture - Bitcoin is the king of cryptos and will be for years to come. Hence - most of my mining earnings is stashed in Bitcoin.
 
Last edited:
Back