Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

nvidia-settings over ssh sees my local GPU?

 

 

Gentoo user RSS feed   Index | Next | Previous | View Threaded


markknecht at gmail

Jun 23, 2011, 8:54 AM

Post #1 of 6 (1469 views)
Permalink
nvidia-settings over ssh sees my local GPU?

Hi,
BACKGROUND ONLY: I've got a futures trading partner who is
attempting to give up Windows if he can. I've helped him install
Gentoo on his new machine. The box is up and running and so far very
productive for him. We're struggling a bit with getting his three
monitor setup working like it did in Windows on his old machine. He
has an EVGA NVidia-based GeForce 8400GS along with the onboard Intel
Graphics stuff. Our goal is to drive 2 monitors with the NVidia card
and 1 with the Intel VGA.

My question is about running nvidia-settings. I'm finding that if I
shell into his machine using

ssh -X -Y -C IP-address

and run nvidia-settings I get it displayed here, as it should be. The
problem is it is seeing my GTX 465 and not his 8400GS.

Anyone know how can I get nvidia-settings to look at his hardware
and do nothing but paint the GUI here at my end?

Thanks,
Mark


neil at digimed

Jun 23, 2011, 9:21 AM

Post #2 of 6 (1449 views)
Permalink
Re: nvidia-settings over ssh sees my local GPU? [In reply to]

On Thu, 23 Jun 2011 08:54:01 -0700, Mark Knecht wrote:

> My question is about running nvidia-settings. I'm finding that if I
> shell into his machine using
>
> ssh -X -Y -C IP-address
>
> and run nvidia-settings I get it displayed here, as it should be. The
> problem is it is seeing my GTX 465 and not his 8400GS.

Looking at the man page, it appears you need to use the -ctrl-display
parameter or the $DISPLAY env var. The man page mentions that
nvidia-settings queries the X server, which is running locally. It looks
like this setting may force it to use another.


--
Neil Bothwick

Of all the people I've met you're certainly one of them
Attachments: signature.asc (0.19 KB)


yoyo at gl

Jun 23, 2011, 10:39 AM

Post #3 of 6 (1437 views)
Permalink
Re: nvidia-settings over ssh sees my local GPU? [In reply to]

On Thu, Jun 23, 2011 at 05:21:07PM +0100, Neil Bothwick wrote:
> On Thu, 23 Jun 2011 08:54:01 -0700, Mark Knecht wrote:
>
> > My question is about running nvidia-settings. I'm finding that if I
> > shell into his machine using
> >
> > ssh -X -Y -C IP-address
> >
> > and run nvidia-settings I get it displayed here, as it should be. The
> > problem is it is seeing my GTX 465 and not his 8400GS.
>
> Looking at the man page, it appears you need to use the -ctrl-display
> parameter or the $DISPLAY env var. The man page mentions that
> nvidia-settings queries the X server, which is running locally. It looks
> like this setting may force it to use another.


as neil wrote, it is
nvidia-settings -c :0

nvidia-settings connects to the remote xserver to communicate
with the graphics card (through a special nvidia xtenstion to the x
protocol), so you need to be able to access the remote xserver, if you
are logged in as the user running the xserver, you should be ok

yoy


markknecht at gmail

Jun 23, 2011, 11:31 AM

Post #4 of 6 (1523 views)
Permalink
Re: nvidia-settings over ssh sees my local GPU? [In reply to]

On Thu, Jun 23, 2011 at 10:39 AM, YoYo Siska <yoyo [at] gl> wrote:
> On Thu, Jun 23, 2011 at 05:21:07PM +0100, Neil Bothwick wrote:
>> On Thu, 23 Jun 2011 08:54:01 -0700, Mark Knecht wrote:
>>
>> >    My question is about running nvidia-settings. I'm finding that if I
>> > shell into his machine using
>> >
>> > ssh -X -Y -C IP-address
>> >
>> > and run nvidia-settings I get it displayed here, as it should be. The
>> > problem is it is seeing my GTX 465 and not his 8400GS.
>>
>> Looking at the man page, it appears you need to use the -ctrl-display
>> parameter or the $DISPLAY env var. The man page mentions that
>> nvidia-settings queries the X server, which is running locally. It looks
>> like this setting may force it to use another.
>
>
> as neil wrote, it is
> nvidia-settings -c :0
>
> nvidia-settings connects  to the remote xserver to communicate
> with the graphics card (through a special nvidia xtenstion to the x
> protocol), so you need to be able to access the remote xserver, if you
> are logged in as the user running the xserver, you should be ok
>
> yoy

Yeah, I've been tripping over doing this right since Neil pointed me
toward the -c command. I think the problem is that I don't have the
permissions set correctly to allow this to work right. The owner of
the remote machine is logged in and possibly using X. I'm not sure
about that but I'm not 'running the X server' in any meaningful way.
I'm just remotely trying to access his GPU with nvidia-settings but
display the GUI here. The problem seems to be getting the right number
of his server or else permissions.

This page is one of the better ones I've found about running
nvidia-settings remotely, specifically section 6 which gives this
example:
http://www.makelinux.com/man/1/A/alt-nvidia-173-settings

(issued from bartok.nvidia.com)
xhost +stravinsky.nvidia.com

(issued from schoenberg.nvidia.com)
xhost +stravinsky.nvidia.com

nvidia-settings --display=bartok.nvidia.com:0
--ctrl-display=schoenberg.nvidia.com:0

which "allows all X clients run on stravinsky.nvidia.com to connect
and display on bartok.nvidia.com's X server and configure
schoenberg.nvidia.com's X server."

It seems this program allows you to run it from machine1, display it
on machine2 which controlling machine3?

So, locally I ran

mark [at] c2stabl ~ $ xhost
access control enabled, only authorized clients can connect
mark [at] c2stabl ~ $ xhost +DWP-Linux
DWP-Linux being added to access control list
mark [at] c2stabl ~ $ xhost
access control enabled, only authorized clients can connect
INET:DWP-Linux
mark [at] c2stabl ~ $

which I think allows the remote machine access here in my server. I
then log in which creates the .Xauthority file:

mark [at] c2stabl ~ $ ssh -XYC DWP-Linux
Password:
Last login: Thu Jun 23 14:11:33 EDT 2011 from
c-67-161-57-1.hsd1.ca.comcast.net on pts/3
/usr/bin/xauth: file /home/mark/.Xauthority does not exist
mark [at] DWP-Linu ~ $ ls -al .Xauthority
-rw------- 1 mark mark 55 Jun 23 14:21 .Xauthority
mark [at] DWP-Linu ~ $ cat .Xauthority
DWP-Linux11MIT-MAGIC-COOKIE-1��:��T'6�@R��mark [at] DWP-Linu ~ $
mark [at] DWP-Linu ~ $

On that machine I see this $DISPLAY:

mark [at] DWP-Linu ~ $ echo $DISPLAY
localhost:11.0
mark [at] DWP-Linu ~ $

so I run

mark [at] DWP-Linu ~ $ nvidia-settings -c :11

which sees my GPU, not his, presumably because I said to control my
system with -c :11. However if I try something like

mark [at] DWP-Linu ~ $ nvidia-settings -c :0

I get a bunch of stuff ending with


ERROR: Unable to assign attribute XVideoSyncToDisplay specified on
line 62 of configuration file
'/home/mark/.nvidia-settings-rc' (no Display connection).

No protocol specified

ERROR: Cannot open display ':0'.

mark [at] DWP-Linu ~ $

I'm a bit lost at this point. (OBVIOUSLY!) :-)

Thanks for any guidance,
Mark


yoyo at gl

Jun 24, 2011, 6:54 AM

Post #5 of 6 (1481 views)
Permalink
Re: nvidia-settings over ssh sees my local GPU? [In reply to]

On Thu, Jun 23, 2011 at 11:31:29AM -0700, Mark Knecht wrote:
> On Thu, Jun 23, 2011 at 10:39 AM, YoYo Siska <yoyo [at] gl> wrote:
> > On Thu, Jun 23, 2011 at 05:21:07PM +0100, Neil Bothwick wrote:
> >> On Thu, 23 Jun 2011 08:54:01 -0700, Mark Knecht wrote:
> >>
> >> >    My question is about running nvidia-settings. I'm finding that if I
> >> > shell into his machine using
> >> >
> >> > ssh -X -Y -C IP-address
> >> >
> >> > and run nvidia-settings I get it displayed here, as it should be. The
> >> > problem is it is seeing my GTX 465 and not his 8400GS.
> >>
> >> Looking at the man page, it appears you need to use the -ctrl-display
> >> parameter or the $DISPLAY env var. The man page mentions that
> >> nvidia-settings queries the X server, which is running locally. It looks
> >> like this setting may force it to use another.
> >
> >
> > as neil wrote, it is
> > nvidia-settings -c :0
> >
> > nvidia-settings connects  to the remote xserver to communicate
> > with the graphics card (through a special nvidia xtenstion to the x
> > protocol), so you need to be able to access the remote xserver, if you
> > are logged in as the user running the xserver, you should be ok
> >
> > yoy
>
> Yeah, I've been tripping over doing this right since Neil pointed me
> toward the -c command. I think the problem is that I don't have the
> permissions set correctly to allow this to work right. The owner of
> the remote machine is logged in and possibly using X. I'm not sure
> about that but I'm not 'running the X server' in any meaningful way.
> I'm just remotely trying to access his GPU with nvidia-settings but
> display the GUI here. The problem seems to be getting the right number
> of his server or else permissions.
>
> This page is one of the better ones I've found about running
> nvidia-settings remotely, specifically section 6 which gives this
> example:
> http://www.makelinux.com/man/1/A/alt-nvidia-173-settings
>
> (issued from bartok.nvidia.com)
> xhost +stravinsky.nvidia.com
>
> (issued from schoenberg.nvidia.com)
> xhost +stravinsky.nvidia.com
>
> nvidia-settings --display=bartok.nvidia.com:0
> --ctrl-display=schoenberg.nvidia.com:0
>
> which "allows all X clients run on stravinsky.nvidia.com to connect
> and display on bartok.nvidia.com's X server and configure
> schoenberg.nvidia.com's X server."


this seems pretty old... defaults on most distros these days are that X
server does not listen on tcp/ip (ip-address:0) only on a local unix sockets
(:0), see below for more

>
> It seems this program allows you to run it from machine1, display it
> on machine2 which controlling machine3?
>
> So, locally I ran
>
> mark [at] c2stabl ~ $ xhost
> access control enabled, only authorized clients can connect
> mark [at] c2stabl ~ $ xhost +DWP-Linux
> DWP-Linux being added to access control list
> mark [at] c2stabl ~ $ xhost
> access control enabled, only authorized clients can connect
> INET:DWP-Linux
> mark [at] c2stabl ~ $
>
> which I think allows the remote machine access here in my server. I
> then log in which creates the .Xauthority file:
>
> mark [at] c2stabl ~ $ ssh -XYC DWP-Linux
> Password:
> Last login: Thu Jun 23 14:11:33 EDT 2011 from
> c-67-161-57-1.hsd1.ca.comcast.net on pts/3
> /usr/bin/xauth: file /home/mark/.Xauthority does not exist
> mark [at] DWP-Linu ~ $ ls -al .Xauthority
> -rw------- 1 mark mark 55 Jun 23 14:21 .Xauthority
> mark [at] DWP-Linu ~ $ cat .Xauthority
> DWP-Linux11MIT-MAGIC-COOKIE-1��:��T'6�@R��mark [at] DWP-Linu ~ $
> mark [at] DWP-Linu ~ $
>
> On that machine I see this $DISPLAY:
>
> mark [at] DWP-Linu ~ $ echo $DISPLAY
> localhost:11.0
> mark [at] DWP-Linu ~ $
>
> so I run
>
> mark [at] DWP-Linu ~ $ nvidia-settings -c :11
>
> which sees my GPU, not his, presumably because I said to control my
> system with -c :11. However if I try something like
>
> mark [at] DWP-Linu ~ $ nvidia-settings -c :0
>
> I get a bunch of stuff ending with
>
>
> ERROR: Unable to assign attribute XVideoSyncToDisplay specified on
> line 62 of configuration file
> '/home/mark/.nvidia-settings-rc' (no Display connection).
>
> No protocol specified
>
> ERROR: Cannot open display ':0'.
>
> mark [at] DWP-Linu ~ $
>
> I'm a bit lost at this point. (OBVIOUSLY!) :-)


To connect to an Xserver, you need to know its "address", which is
something like machine_or_ip:NUMNER for tcp/ip connection or just
:NUMBER for (local) unix socket connection.

When you do a ssh -X , ssh creates a tunnel from the remote computer to
your local Xserver (:0 at your side), and creates a new "address",
usually localhost:10 (or 11, 12, which on is free)

if i'm behing a laptop named 'tabletka' and there is also a desktop
named 'yoyo' (its the same as my username... on both), you could do:

yoyo [at] tabletk ~ $ DISPLAY=:0 xterm
which runs xterm here (tabletka), displays it here

yoyo [at] tabletk ~ $ DISPLAY=yoyo:0 xterm
runs xterm here, displays it on yoyo

however as i said, most distributions don't allow Xservers to listen on
tcp/ip and only allow it to listen on local sockets... you can however
use ssh to tunnel X traffic, so you could do:

yoyo [at] tabletk ~ $ echo $DISPLAY
:0.0
yoyo [at] tabletk ~ $ ssh -X yoyo
yoyo [at] yoy:~$ echo $DISPLAY
localhost:10.0



now if you run an X application, it would connect to localhost:10.0
which would be transfere by ssh to your local :0.0 (on tabletka)

but you could also do (still in the ssh session)
yoyo [at] yoy:~$ DISPLAY=:0.0 xterm

which would run xterm on the xserver on that remote desktop computer...

(note that apps use the DISPLAY variable, but usually also have a
command line option to specify the Xserver on which they should display
things, that is the --display option from nvidia-settings)


however the example above most probably won't work, because the Xserver
uses authentication to only allow authorized clients/applications to
display things on it... the xhost commands in the example you found
basically allow access to all applications from a certain ip, but this
only works for the tcp/ip connections, which are not used...

Xserver uses xauth "cookies" to authenticate a user... so if you can get
a hold a "cookie" for that remote Xserver, you can connect to it /
control it. If a user is logged on the remote Xserver, he most probably
has a ~/.Xauthority file in his home (or a file pointed to by
$XAUTHORITY variable), which contains the cookie, so if
you can read his files (it is of course only readable by him, but if
have root on that machine...) you can run

xauth merge /home/LOGGED_USER/.Xauthority

of course, if you log in as that user, it is not needed...

if there is no-one logged in, it is a bit more problematic, because the
login manager takes care of the auth cookies, but for KDM the cookies
are in /var/run/xauth/ (readable only by root), so you could either do

xauth merge /var/run/xauth/*

or set XAUTHORITY to the path of the file corresponding to :0 (kdm names
them A:0-somethingrandom, so it si /var/run/xauth/A:0* ), but that might
override any XAUTHORITY file ssh might have set up for the -X tunnel to
your local Xserver ;)

the kdm xauth cookie should work even if a user is logged in, of
course...


note that if you do a ssh -X othermachine, and then su in that ssh
session, the DISPLAY and XAUTHORITY vars might get reset...


so in short, if there is kdm on the remote machine:
ssh -X othermachine
(now $DISPLAY should be something like localhost:10)
sudo chmod 644 /var/run/xauth/A:0*
xauth merge /var/run/xauth/A:0*
(now your xauthority file should have cookies fot both
yor tunneled local xserver (if ssh created it) and also for
the :0 xserver on the remote machine)
nvidia-settings -c :0
(nvidia-settings uses $DISPLAY to select where to display it's ui ->
i.e. your ssh tunel to your local display, and "controls" the graphics
card on the :0 display)


yoyo


bill.longman at gmail

Jun 24, 2011, 7:46 AM

Post #6 of 6 (1450 views)
Permalink
Re: nvidia-settings over ssh sees my local GPU? [In reply to]

On 06/23/2011 09:21 AM, Neil Bothwick wrote:
> Looking at the man page, it appears you need to use the -ctrl-display
> parameter or the $DISPLAY env var. The man page mentions that
> nvidia-settings queries the X server, which is running locally. It looks
> like this setting may force it to use another.

You may also want to throw in "-no-xshm" for giggles. Probably won't
work, but it would be worth a try....

Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.