You are not logged in.

#1 2017-04-25 03:19:06

rogervn
Member
Registered: 2017-04-09
Posts: 21

Gnome 3.24 and dual GPUs

For some time I've heard that in Gnome 3.24 dual-gpu configurations such as nvidia optimus would be able to launch apps directly under the discrete GPU.

Have anyone managed to make it work? Inside Gnome Details it shows "unknown" as the graphics device and no option to launch apps with the discrete GPU are available whatsoever.

Nvidia proprietary drivers and installed and loaded.

Thanks!

Offline

#2 2017-04-25 07:36:26

phw
Member
Registered: 2013-05-27
Posts: 318

Re: Gnome 3.24 and dual GPUs

AFAIK this needs a PRIME setup (https://wiki.archlinux.org/index.php/PRIME), which does not yet work with proprietary graphics (EDIT: please correct me if this is wrong, it would be cool if this could be used with the proprietary driver). In any way you also need to install and I think enable the switcheroo-control service (available in AUR https://aur.archlinux.org/packages/switcheroo-control/ ) .

With both things in place I have the option to run on dedicated GPU when right clicking on an app icon.

For some background info see:
https://blogs.gnome.org/uraeus/2016/11/ … tation-25/
http://www.hadess.net/2016/10/dual-gpu- … gnome.html

Last edited by phw (2017-04-25 07:38:40)

Offline

#3 2017-04-25 07:57:42

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: Gnome 3.24 and dual GPUs

You will likely also have to make sure you are on GNOME on Xorg I doubt this works on Wayland currently

Offline

#4 2017-04-25 08:13:12

LiquidityC
Member
From: Sweden
Registered: 2011-09-24
Posts: 16

Re: Gnome 3.24 and dual GPUs

V1del wrote:

You will likely also have to make sure you are on GNOME on Xorg I doubt this works on Wayland currently

Don't think this is true. Essentially the whole GNOME 3.24 release is about moving to Wayland. Can't confirm this in release notes though.

Offline

#5 2017-04-25 08:18:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: Gnome 3.24 and dual GPUs

Yeah and hybrid graphics will still only work on Xorg, Wayland doesn't have any support for that yet. (You can read the above posted blogpost, most of which do confirm this)

Offline

#6 2017-04-26 08:02:45

LiquidityC
Member
From: Sweden
Registered: 2011-09-24
Posts: 16

Re: Gnome 3.24 and dual GPUs

Is that still the case? The blog post is 9 months old and suggests that there is a lot of work being done at the time of writing. Not arguing, just hoping that you are wrong big_smile

Offline

#7 2017-04-26 08:30:05

LiquidityC
Member
From: Sweden
Registered: 2011-09-24
Posts: 16

Re: Gnome 3.24 and dual GPUs

OK, did some testing. I uninstalled bumblebee and switched the nvidia driver for the nouveau driver.

This is what I have in my laptop:

$ lspci | egrep "VGA|3D"
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940M] (rev a2)

Running under wayland I tested the following from a regular console

Testing default graphics:

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.4
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.0.4
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 17.0.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

Testing discrete graphics:

$ DRI_PRIME=1 !!
DRI_PRIME=1 glxinfo | grep OpenGL
OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NV118
OpenGL core profile version string: 4.3 (Core Profile) Mesa 17.0.4
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.0.4
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

So that seems to work. However gnome isn't detecting this setup. Going to Settings > Details tells me this:

Graphics: Unknown

I guess that is what I'll have to look into next to get this all working with the gnome "launch option" thingy.

Offline

#8 2017-04-26 08:40:36

phw
Member
Registered: 2013-05-27
Posts: 318

Re: Gnome 3.24 and dual GPUs

LiquidityC wrote:

So that seems to work. However gnome isn't detecting this setup. Going to Settings > Details tells me this:

Graphics: Unknown

I guess that is what I'll have to look into next to get this all working with the gnome "launch option" thingy.


Does it work on X11? Have you installed the switcheroo-control service (see my post above)? Without that it won't be detected by Gnome.

Offline

#9 2017-04-26 10:29:11

LiquidityC
Member
From: Sweden
Registered: 2011-09-24
Posts: 16

Re: Gnome 3.24 and dual GPUs

Yes, I installed switcheroo-control. Should have mentioned that before. Sorry.

I'm currently investigating switcheroo. During boot it fails with : "switcheroo-cont[431]: No switcheroo support available"
if I restart the service after boot it runs fine. Trying to figure this out right now.

I didn't try X11 but that shouldn't have an impact IMO. As proven in my previous post the DRI_PRIME thing works in wayland, it's just that Gnome doesn't know that it does and therefore doesn't provide the menu option.

Offline

#10 2017-04-26 10:35:10

LiquidityC
Member
From: Sweden
Registered: 2011-09-24
Posts: 16

Re: Gnome 3.24 and dual GPUs

switcheroo-control is attempting to access this "/sys/kernel/debug/vgaswitcheroo/switch"
which is the vgaswitcheroo handle, vgaswitcheroo being a kernel module. That isn't present on my machine. At least not during boot it seems.

After I restart switcheroo-control after boot it runs fine and reports that I have dual gpus.

This is the process after boot:

$ sudo gdbus introspect --system --dest net.hadess.SwitcherooControl --object-path /net/hadess/SwitcherooControl
[sudo] password for linus: 
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name net.hadess.SwitcherooControl was not provided by any .service files
$ sudo systemctl restart switcheroo-control.service 
$ sudo gdbus introspect --system --dest net.hadess.SwitcherooControl --object-path /net/hadess/SwitcherooControl
node /net/hadess/SwitcherooControl {
  interface org.freedesktop.DBus.Properties {
    methods:
      Get(in  s interface_name,
          in  s property_name,
          out v value);
      GetAll(in  s interface_name,
             out a{sv} properties);
      Set(in  s interface_name,
          in  s property_name,
          in  v value);
    signals:
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties,
                        as invalidated_properties);
    properties:
  };
  interface org.freedesktop.DBus.Introspectable {
    methods:
      Introspect(out s xml_data);
    signals:
    properties:
  };
  interface org.freedesktop.DBus.Peer {
    methods:
      Ping();
      GetMachineId(out s machine_uuid);
    signals:
    properties:
  };
  interface net.hadess.SwitcherooControl {
    methods:
    signals:
    properties:
      readonly b HasDualGpu = true;
  };
};

EDIT: After restarting switcheroo post boot the option to "Launch using dedicated graphics card" is present when right-clicking an app in gnome and it works. The system details still say "Graphics: Unknown"

Last edited by LiquidityC (2017-04-26 12:43:24)

Offline

#11 2017-04-26 12:52:39

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: Gnome 3.24 and dual GPUs

I set DRI_PRIME=1 to use the discrete card with Gnome 3.22. Without that setting, it uses the onboard Intel HD chip.

Tim

Offline

#12 2017-04-26 13:25:49

phw
Member
Registered: 2013-05-27
Posts: 318

Re: Gnome 3.24 and dual GPUs

ratcheer wrote:

I set DRI_PRIME=1 to use the discrete card with Gnome 3.22. Without that setting, it uses the onboard Intel HD chip.

Tim

Yes, but this discussion is about that Gnome 3.24 can do this for you from GUI by adding a context menu entry to application icons smile

Offline

#13 2017-04-27 12:34:13

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: Gnome 3.24 and dual GPUs

phw wrote:

Yes, but this discussion is about that Gnome 3.24 can do this for you from GUI by adding a context menu entry to application icons smile

Yeah, I have been led to believe that 3.24 will have that capability. Sorry.

Tim

Offline

Board footer

Powered by FluxBB