public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Cygwin/X causes NVIDIA GPU to turn on in Optimus systems
@ 2013-03-26 15:58 Aaron A. Kelley
  2013-03-27  0:30 ` Thiago Padilha
  2013-03-27 15:11 ` Jon TURNEY
  0 siblings, 2 replies; 4+ messages in thread
From: Aaron A. Kelley @ 2013-03-26 15:58 UTC (permalink / raw)
  To: cygwin-xfree

For those that aren’t aware, NVIDIA Optimus is a feature that makes use of
the Intel GPU that is included in new Intel Core i series processors (Sandy
Bridge and up).  Basically, in a system that has both the integrated Intel
GPU and also a discrete NVIDIA GPU, the Intel GPU is used for most desktop
operations and the NVIDIA GPU kicks in when the graphics power is needed for
games and other processing jobs.  This is done to save power --- if the
NVIDIA GPU can spend most of its time powered down, your battery lasts
longer.  The NVIDIA card can be used to run only particular applications
individually, and its output is dumped over to the Intel GPU for display
using some fast framebuffer magic.

I usually leave Cygwin/X open on my machine because I use it to access GUI
apps running in SSH terminals from time to time.  Today I noticed that in an
Optimus environment, it is causing the NVIDIA GPU to kick in, which causes
the NVIDIA GPU to stay powered on when maybe it doesn’t need to.

http://stuff.aaron-kelley.net/2013/03/cygxoptimus.png

I went to the NVIDIA control panel and set xwin.exe specifically to use the
integrated GPU but it still says that xwin.exe is running on the NVIDIA GPU
when I run it.  Cygwin/X must be doing something unusual at initialization
that makes the NVIDIA card feel like it has to kick on.  I don’t have to
actually launch any X windows to see this occur, it happens moments after I
launch the Cygwin/X server.

I haven’t been able to find anyone else mentioning this.  It may be because
Optimus configurations aren’t very common.  This also means that this issue
may be tricky to track down.  I’m not sure if it will be easy to find
someone who knows about Cygwin/X development who also has access to an
Optimus environment.  This might be something that has to go for NVIDIA for
them to fix in their drivers, but it’d be nice to know a little more about
the issue before trying to get in touch with them.

I’m interested in doing anything I can do help address this but I don’t know
where to begin, so I’m welcoming your feedback.

Thanks,

-- 
Aaron


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cygwin/X causes NVIDIA GPU to turn on in Optimus systems
  2013-03-26 15:58 Cygwin/X causes NVIDIA GPU to turn on in Optimus systems Aaron A. Kelley
@ 2013-03-27  0:30 ` Thiago Padilha
  2013-03-27 15:11 ` Jon TURNEY
  1 sibling, 0 replies; 4+ messages in thread
From: Thiago Padilha @ 2013-03-27  0:30 UTC (permalink / raw)
  To: cygwin-xfree, aaronkelley

Hi,

I also have nvidia optimus and noticed this problem but with me the
nvidia gpu only kicks in for a brief time whenever a x application is
started, so the extra enery consumed is very small. It is anoying all
the same, I appreciate any workaround for this.

On Tue, Mar 26, 2013 at 12:58 PM, Aaron A. Kelley
<aaronkelley@hotmail.com> wrote:
> For those that aren’t aware, NVIDIA Optimus is a feature that makes use of
> the Intel GPU that is included in new Intel Core i series processors (Sandy
> Bridge and up).  Basically, in a system that has both the integrated Intel
> GPU and also a discrete NVIDIA GPU, the Intel GPU is used for most desktop
> operations and the NVIDIA GPU kicks in when the graphics power is needed for
> games and other processing jobs.  This is done to save power --- if the
> NVIDIA GPU can spend most of its time powered down, your battery lasts
> longer.  The NVIDIA card can be used to run only particular applications
> individually, and its output is dumped over to the Intel GPU for display
> using some fast framebuffer magic.
>
> I usually leave Cygwin/X open on my machine because I use it to access GUI
> apps running in SSH terminals from time to time.  Today I noticed that in an
> Optimus environment, it is causing the NVIDIA GPU to kick in, which causes
> the NVIDIA GPU to stay powered on when maybe it doesn’t need to.
>
> http://stuff.aaron-kelley.net/2013/03/cygxoptimus.png
>
> I went to the NVIDIA control panel and set xwin.exe specifically to use the
> integrated GPU but it still says that xwin.exe is running on the NVIDIA GPU
> when I run it.  Cygwin/X must be doing something unusual at initialization
> that makes the NVIDIA card feel like it has to kick on.  I don’t have to
> actually launch any X windows to see this occur, it happens moments after I
> launch the Cygwin/X server.
>
> I haven’t been able to find anyone else mentioning this.  It may be because
> Optimus configurations aren’t very common.  This also means that this issue
> may be tricky to track down.  I’m not sure if it will be easy to find
> someone who knows about Cygwin/X development who also has access to an
> Optimus environment.  This might be something that has to go for NVIDIA for
> them to fix in their drivers, but it’d be nice to know a little more about
> the issue before trying to get in touch with them.
>
> I’m interested in doing anything I can do help address this but I don’t know
> where to begin, so I’m welcoming your feedback.
>
> Thanks,
>
> --
> Aaron
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://x.cygwin.com/docs/
> FAQ:                   http://x.cygwin.com/docs/faq/
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cygwin/X causes NVIDIA GPU to turn on in Optimus systems
  2013-03-26 15:58 Cygwin/X causes NVIDIA GPU to turn on in Optimus systems Aaron A. Kelley
  2013-03-27  0:30 ` Thiago Padilha
@ 2013-03-27 15:11 ` Jon TURNEY
  2013-03-29 13:06   ` Aaron A. Kelley
  1 sibling, 1 reply; 4+ messages in thread
From: Jon TURNEY @ 2013-03-27 15:11 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: aaronkelley

On 26/03/2013 15:58, Aaron A. Kelley wrote:
> I usually leave Cygwin/X open on my machine because I use it to access GUI
> apps running in SSH terminals from time to time.  Today I noticed that in an
> Optimus environment, it is causing the NVIDIA GPU to kick in, which causes
> the NVIDIA GPU to stay powered on when maybe it doesnÂ’t need to.
> 
> http://stuff.aaron-kelley.net/2013/03/cygxoptimus.png
> 
> I went to the NVIDIA control panel and set xwin.exe specifically to use the
> integrated GPU but it still says that xwin.exe is running on the NVIDIA GPU
> when I run it.  Cygwin/X must be doing something unusual at initialization
> that makes the NVIDIA card feel like it has to kick on.  I donÂ’t have to
> actually launch any X windows to see this occur, it happens moments after I
> launch the Cygwin/X server.

The Cygwin X server doesn't do anything special (and specifically, doesn't do
any of the things listed in [1] to explicitly use the high-performance GPU),
so if it's being allowed to use OpenGL on the high-performance GPU despite the
application profile you have created, I would say that might be a bug in the
optimus driver.

Note that this policy does belong in your hands, not in XWin, as it cannot
know if you are going to be running any X programs using OpenGL, and if you
are, if you want high-performance rendering in them at the cost of additional
power usage.

As a workaround, you could start the X server with the -nowgl option added,
which should prevent any use of native OpenGL, forcing the use of software
rendering using mesa and see if that helps.

> I havenÂ’t been able to find anyone else mentioning this.  It may be because
> Optimus configurations arenÂ’t very common.  This also means that this issue
> may be tricky to track down.  IÂ’m not sure if it will be easy to find
> someone who knows about Cygwin/X development who also has access to an
> Optimus environment.  This might be something that has to go for NVIDIA for
> them to fix in their drivers, but itÂ’d be nice to know a little more about
> the issue before trying to get in touch with them.
> 
> IÂ’m interested in doing anything I can do help address this but I donÂ’t know
> where to begin, so IÂ’m welcoming your feedback.

For a start, you could look for the GL_VENDOR and GL_RENDERER lines in
/var/log/xwin/XWin.0.log to confirm that XWin also thinks it is using the
high-performance GPU.

[1]
http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Cygwin/X causes NVIDIA GPU to turn on in Optimus systems
  2013-03-27 15:11 ` Jon TURNEY
@ 2013-03-29 13:06   ` Aaron A. Kelley
  0 siblings, 0 replies; 4+ messages in thread
From: Aaron A. Kelley @ 2013-03-29 13:06 UTC (permalink / raw)
  To: 'cygwin-xfree'

Hi, thanks for your reply.  Very helpful.

I checked the XWin.0.log and found:

[ 73510.875] GL_VERSION:     4.3.0
[ 73510.875] GL_VENDOR:      NVIDIA Corporation
[ 73510.875] GL_RENDERER:    Quadro K5000M/PCIe/SSE2

So, it looks like XWin is running on the NVIDIA GPU even though the Intel
GPU is set at the default rendering device (both for all apps by default and
by XWin.exe specifically) in the NVIDIA control panel.  I'll see if I can
get NVIDIA to comment on this at all but who knows if I'll actually be able
to get in touch with anyone.

Anyway, I don't need OpenGL for the programs that I use, so I checked into
using the -nowgl parameter that you suggested and that took care of it.
With -nowgl set, XWin happily runs on the Intel GPU and Optimus does not
engage.

Thanks,

-- 
Aaron

-----Original Message-----
From: Jon TURNEY [mailto:jon.turney@dronecode.org.uk] 
Sent: Wednesday, March 27, 2013 11:11 AM
To: cygwin-xfree@cygwin.com
Cc: aaronkelley@hotmail.com
Subject: Re: Cygwin/X causes NVIDIA GPU to turn on in Optimus systems

On 26/03/2013 15:58, Aaron A. Kelley wrote:
> I usually leave Cygwin/X open on my machine because I use it to access GUI
> apps running in SSH terminals from time to time.  Today I noticed that in
an
> Optimus environment, it is causing the NVIDIA GPU to kick in, which causes
> the NVIDIA GPU to stay powered on when maybe it doesn't need to.
> 
> http://stuff.aaron-kelley.net/2013/03/cygxoptimus.png
> 
> I went to the NVIDIA control panel and set xwin.exe specifically to use
the
> integrated GPU but it still says that xwin.exe is running on the NVIDIA
GPU
> when I run it.  Cygwin/X must be doing something unusual at initialization
> that makes the NVIDIA card feel like it has to kick on.  I don't have to
> actually launch any X windows to see this occur, it happens moments after
I
> launch the Cygwin/X server.

The Cygwin X server doesn't do anything special (and specifically, doesn't
do
any of the things listed in [1] to explicitly use the high-performance GPU),
so if it's being allowed to use OpenGL on the high-performance GPU despite
the
application profile you have created, I would say that might be a bug in the
optimus driver.

Note that this policy does belong in your hands, not in XWin, as it cannot
know if you are going to be running any X programs using OpenGL, and if you
are, if you want high-performance rendering in them at the cost of
additional
power usage.

As a workaround, you could start the X server with the -nowgl option added,
which should prevent any use of native OpenGL, forcing the use of software
rendering using mesa and see if that helps.

> I haven't been able to find anyone else mentioning this.  It may be
because
> Optimus configurations aren't very common.  This also means that this
issue
> may be tricky to track down.  I'm not sure if it will be easy to find
> someone who knows about Cygwin/X development who also has access to an
> Optimus environment.  This might be something that has to go for NVIDIA
for
> them to fix in their drivers, but it'd be nice to know a little more about
> the issue before trying to get in touch with them.
> 
> I'm interested in doing anything I can do help address this but I don't
know
> where to begin, so I'm welcoming your feedback.

For a start, you could look for the GL_VENDOR and GL_RENDERER lines in
/var/log/xwin/XWin.0.log to confirm that XWin also thinks it is using the
high-performance GPU.

[1]
http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/Op
timusRenderingPolicies.pdf

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-28 13:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 15:58 Cygwin/X causes NVIDIA GPU to turn on in Optimus systems Aaron A. Kelley
2013-03-27  0:30 ` Thiago Padilha
2013-03-27 15:11 ` Jon TURNEY
2013-03-29 13:06   ` Aaron A. Kelley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).