Search found 33 matches

Go to advanced search

by ricksebak
June 28th, 2015, 9:54 pm
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

TLDR: Change line 36 of your script to newstr=$(echo $str | awk '{print $7}') and it should work. Longer version: I don't have an nvidia card, so I have no way to run nvidia-smi -q -d temperature | grep GPU | perl -pe '/^GPU/ && s/\n//' | grep ^GPU "GPU 0000:0$i:00.0". So in my exa...
by ricksebak
June 28th, 2015, 9:20 pm
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

In fact, a while loop could work better than a for loop, since a while loop will still work with any number of GPU cores:

cat /tmp/nvidaoutput | while read line
> do
> newstr=$(echo $line | awk '{print $7}')
> echo $newstr
> done
49
39
44
47
by ricksebak
June 28th, 2015, 9:17 pm
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

Yes, I understand what you are trying to do with newstr. And the awk command that I posted earlier will do what you want. For example: cat /tmp/nvidaoutput GPU 0000:01:00.0 GPU Current Temp : 49 C GPU 0000:02:00.0 GPU Current Temp : 39 C GPU 0000:03:00.0 GPU Current Temp : 44 C GPU 0000:04:00.0 GPU ...
by ricksebak
June 28th, 2015, 7:26 pm
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

In your watchdoggputemp.sh script that you posted previously, line 36 looks like you are attempting to set newstr to the value of the GPU temperature. I don't really know why that isn't working, but if you change line 36 in the way that I mentioned, newstr should be able to find the temperature valu...
by ricksebak
June 28th, 2015, 1:47 pm
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

I don't normally use string splitting or whatever "newstr=${str:54:2}" would be called. But it looks like you are trying to grab the temperature value, which could also be done using awk:

newstr=`echo $str | awk '{print $7}'`
by ricksebak
June 20th, 2015, 2:56 am
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

And obviously, don't use the [code] lines that I used. I clearly don't know how to use a message board. But the rest of it should work in bash.
by ricksebak
June 20th, 2015, 2:51 am
Forum: General Discussion
Topic: Shell script & "nvidia-smi" - needs right command/flag!
Replies: 14
Views: 2403

Re: Shell script & "nvidia-smi" - needs right command/flag!

I don't use nvidia, so there might well be a more elegant way to do this. But based on what I see in your post: [code] for TEMP in `nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader` do if [ $TEMP -gt 100 ] then run some commands here, maybe send me an email or whatever you want fi [\code...
by ricksebak
June 16th, 2015, 7:06 pm
Forum: General Discussion
Topic: Need help with setting up a good media solution
Replies: 3
Views: 845

Re: Need help with setting up a good media solution

Depends on if you need the advanced features, such as the ability to watch videos on a phone, or not.

I would probably start out with the free version, then upgrade if you need some special feature.
by ricksebak
June 15th, 2015, 2:12 pm
Forum: General Discussion
Topic: Need help with setting up a good media solution
Replies: 3
Views: 845

Re: Need help with setting up a good media solution

Plex would do what you described.

Go to advanced search

cron