Post
Topic
Board Mining (Altcoins)
Re: [OS] nvOC easy-to-use Linux Nvidia Mining v0019-1.4
by
papampi
on 08/11/2017, 19:19:28 UTC
@damNmad:

I found a small bug in your telegram configuration. Command which use for getting GPUs count is invalid when rig have installed over 9 cards...

Your command:
Code:
GPU_COUNT=$(nvidia-smi -L | tail -n 1| cut -c 5 |awk '{ SUM += $1+1} ; { print SUM }')
and result:
Code:
m1@rig-bafomet:~$ nvidia-smi -L | tail -n 1| cut -c 5 |awk '{ SUM += $1+1} ; { print SUM }'
2

There isn't any reason, why use awk. Easier way is use wc only.

So, fix:
Code:
GPU_COUNT=$(nvidia-smi -L | wc -l')
and result:
Code:
m1@rig-bafomet:~$ nvidia-smi -L | wc -l
11

I used to use same cmd, fixed it with this one for 1.4:

Code:
nvidia-smi --query-gpu=count --format=csv,noheader,nounits | tail -1



Here is even more optimized code, less cycles, no need to use pipe:

Code:
nvidia-smi -i 0 --query-gpu=count --format=csv,noheader,nounits

every one has GPU0 plugged in so we can query only one GPU to get the total number of GPU's instead of querying all GPU's to return the same number then pipe it trough tail Wink



Totally correct and thanks for the help 👍👍👍