nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   Interesting observation with nvidia-settings and stderr redirection (http://www.nvnews.net/vbulletin/showthread.php?t=177794)

uOpt 04-08-12 10:44 AM

Interesting observation with nvidia-settings and stderr redirection
 
If you redirect stderr (although nothing is printed on stderr), some but not all values disappear.

Code:

nvidia-settings -c :8.0 -q all 2>&1 |  egrep "Attribute '(ThermalSensorReading|GPUCurrentFanSpeed)'" | tee l
  Attribute 'GPUCurrentFanSpeed' (wavehh.hanse.de:8[fan:0]): 40.
  Attribute 'ThermalSensorReading' (wavehh.hanse.de:8[thermalsensor:0]):
  Attribute 'ThermalSensorReading' (wavehh.hanse.de:8[thermalsensor:1]):
  Attribute 'ThermalSensorReading' (wavehh.hanse.de:8[thermalsensor:2]):

Code:

nvidia-settings -c :8.0 -q all |  egrep "Attribute '(ThermalSensorReading|GPUCurrentFanSpeed)'" | tee l
  Attribute 'GPUCurrentFanSpeed' (wavehh.hanse.de:8[fan:0]): 40.
  Attribute 'ThermalSensorReading' (wavehh.hanse.de:8[thermalsensor:0]): 74.
  Attribute 'ThermalSensorReading' (wavehh.hanse.de:8[thermalsensor:1]): 64.
  Attribute 'ThermalSensorReading' (wavehh.hanse.de:8[thermalsensor:2]): 59.


sandipt 04-09-12 06:17 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
Is this specific to your system, motherboard OR GPU ? Please attach logs by running nvidia-bug-report.sh as root user.
How frequently this happens ?

uOpt 04-09-12 07:51 PM

Re: Interesting observation with nvidia-settings and stderr redirection
 
It happens on several systems that have nothing in common except for having NVidia video cards. This looks purely like a userland issue with nvidia-settings or libraries it links to.

It happens every time and can be reproduced just by copy'n'pasting the two commands. I edited them for you for easier cut'n'paste since I use $DISPLAY=:8.x.

Code:

#works:
 DISPLAY=:0.0 nvidia-settings -q all |  egrep "Attribute '(ThermalSensorReading|GPUCurrentFanSpeed)'"
# redirection breaks it, number is missing:
DISPLAY=:0.0 nvidia-settings -q all 2>&1 |  egrep "Attribute '(ThermalSensorReading|GPUCurrentFanSpeed)'"


sandipt 04-10-12 12:06 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
I am not observing this issue with Quadro 4000 on Dell Workstation system T7500.

leigh123linux 04-10-12 04:44 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
Works ok here
Code:

[leigh@main-pc ~]$ DISPLAY=:0.0 nvidia-settings -q all |  egrep "Attribute '(ThermalSensorReading|GPUCurrentFanSpeed)'"
  Attribute 'GPUCurrentFanSpeed' (main-pc.home:0[fan:0]): 40.
  Attribute 'ThermalSensorReading' (main-pc.home:0[thermalsensor:0]): 41.
[leigh@main-pc ~]$ DISPLAY=:0.0 nvidia-settings -q all 2>&1 |  egrep "Attribute '(ThermalSensorReading|GPUCurrentFanSpeed)'"
  Attribute 'GPUCurrentFanSpeed' (main-pc.home:0[fan:0]): 40.
  Attribute 'ThermalSensorReading' (main-pc.home:0[thermalsensor:0]): 44.
[leigh@main-pc ~]$


uOpt 04-11-12 11:43 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
I don't know why you can't see the same thing, or why only some attributes are affected and others are not.

However, an strace of this clearly shows a storm of
Code:

3348  ioctl(2, TIOCGWINSZ, {ws_row=83, ws_col=264, ws_xpixel=1867, ws_ypixel=1166}) = 0
That's not gonna work right if fd 2 isn't connected to the terminal. The straces clearly show that you do it regardless of whether fd 2 goes to the tty or is redirected. It seems a safe bet that not doing this to non-terminals will solve this problem.

ETA: You also do that "ioctl(2, ..." a total of 10404 times for the above command. That is probably one reason why it's so slow.

uOpt 04-11-12 12:23 PM

Re: Interesting observation with nvidia-settings and stderr redirection
 
Allright, so here is what happens:

you try to figure out the terminal size and then you do a manual line break at word boundaries. That makes the number drop to the next line and hence un-grepable in some cases.

The reason why you don't see it is that your wimpy hostnames are shorter than my awesome one :) Try narrowing the window and then do the one without redirection again.

In the case of fd2 not being connected to the terminal the whole thing seems to default to 80, which makes yours work (thanks to the short hostname) and mine fail regardless of actual window size. It seems to me that defaulting to INT_MAX would be the right fix for this.

bugspray 04-12-12 07:59 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
This has been an issue since at least 2008. Here is a comment from a script last modifed that year:

NV="nvidia-settings -c $MHD -q [gpu:$G]/FrameLockMasterable[${K}-$P]"
# unbelievable. Running $NV 2>/dev/null gives different output than just running $NV
# even when no error.

uOpt 04-12-12 12:34 PM

Re: Interesting observation with nvidia-settings and stderr redirection
 
Now that you say it, I think I might have reported this before. Like years ago.

Plagman 04-12-12 03:28 PM

Re: Interesting observation with nvidia-settings and stderr redirection
 
You'd think the army of open-source hackers would have sent in a patch by now if it was reported years ago.

git://people.freedesktop.org/~aplattner/nvidia-settings

sandipt 04-13-12 05:19 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
NVIDIA internal Bug ID: 969308 to track this issue.

danix 04-13-12 10:57 AM

Re: Interesting observation with nvidia-settings and stderr redirection
 
Like Plagman says, you can easily change the default width to anything you want: see DEFAULT_MAX_WIDTH in src/msg.c. I think that defaulting to < 80 characters and defaulting to INT_MAX are both reasonable, for different reasons. Redirecting std{err,out} is a pretty common use case and when doing so, I imagine that we can often expect that the file descriptors won't be associated with any terminal, which might tip the scales slightly in the favor of INT_MAX.


All times are GMT -5. The time now is 03:15 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.