You are not logged in.

#1 2014-07-30 10:48:18

Crysis85
Member
Registered: 2014-07-27
Posts: 24

Hybrid Graphics

I read a lot about this subject let me ask you a couple of things to see if I understood

my current setting is

[crysis@arch-lenovo ~]$ lspci -vv -s 00:02
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device 3978
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 62
	Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=4M]
	Region 2: Memory at b0000000 (64-bit, prefetchable) [size=256M]
	Region 4: I/O ports at 6000 [size=64]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

[crysis@arch-lenovo ~]$ lspci -vv -s 03:00
03:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun LE [Radeon HD 8550M] (rev ff) (prog-if ff)
	!!! Unknown header type 7f
	Kernel driver in use: radeon
	Kernel modules: radeon



Provider 0: id: 0x78 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 5 associated providers: 1 name:Intel
Provider 1: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 0 outputs: 0 associated providers: 1 name:radeon

I when here https://wiki.archlinux.org/index.php/PRIME
and did all the steps required and running something like

DRI_PRIME=1 glxgears

fires up the Radeon to be used for that particular application (tested, works)

My questions are:
- do I have to explictly tell "use that damn radeon for this application!" (DRI_PRIME=1) or there is an automatic switching that I missed?
- the wiki says that I have to and i quote "put it in /etc/X11/xinit/xinitrc.d/" the script for auto starting the xrandr --setprovideroffloadsink radeon Intel. How do I do that?

P.S I added at startup the kernel parameter radeon.dpm=0 because it gave me some nasty errors at boot and hung the machine at shutdown after the last update. For what i understand that was the power management...but since the radeon in shutdown most of the time anyway I don't think changes something having it disable (apart from being able to shut down the PC, that is)

Offline

#2 2014-07-30 12:48:45

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Hybrid Graphics

Crysis85 wrote:

automatic switching

I suppose you could create simple wrapper scripts in ~/bin/, e.g. ~/bin/firefox:

/bin/sh

exec DRI_PRIME=1 /usr/bin/firefox "$@"

Of course, $HOME/bin must be before /usr/bin in your PATH.

Offline

#3 2014-07-30 13:31:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,643
Website

Re: Hybrid Graphics

Crysis85 wrote:

- the wiki says that I have to and i quote "put it in /etc/X11/xinit/xinitrc.d/" the script for auto starting the xrandr --setprovideroffloadsink radeon Intel. How do I do that?

Right before that it says "Alternatively you can ..."

That is one option.  It is only saying that the quoted command can be put anywhere that will be sourced when X starts up.  ~/.xinitrc would work, if you don't use a DM that ignores xinitrc.  A file in the path you quoted would work, if the files in that directory are sourced by the xinit process (they commonly are).  You could also put it in your window manager's autostart script if it has one (e.g. ~/.config/openbox/autostart for openbox).  But this all depends on your DE/WM and/or how you start X.  The directory you quoted from the wiki is just one of the more generic options.

As for how you do it ... you just create a file in that directory, and put that command in it.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2014-07-30 17:21:12

Crysis85
Member
Registered: 2014-07-27
Posts: 24

Re: Hybrid Graphics

Trilby wrote:
Crysis85 wrote:

- the wiki says that I have to and i quote "put it in /etc/X11/xinit/xinitrc.d/" the script for auto starting the xrandr --setprovideroffloadsink radeon Intel. How do I do that?

Right before that it says "Alternatively you can ..."

That is one option.  It is only saying that the quoted command can be put anywhere that will be sourced when X starts up.  ~/.xinitrc would work, if you don't use a DM that ignores xinitrc.  A file in the path you quoted would work, if the files in that directory are sourced by the xinit process (they commonly are).  You could also put it in your window manager's autostart script if it has one (e.g. ~/.config/openbox/autostart for openbox).  But this all depends on your DE/WM and/or how you start X.  The directory you quoted from the wiki is just one of the more generic options.

As for how you do it ... you just create a file in that directory, and put that command in it.

Do i just put the command "xrandr --setprovideroffloadsink radeon Intel" in a file named whatever in that folder and it should run it at boot? Sorry for the stupid question but I've never written a script and the xinitrc section on the wiki it's rather confusing.
Anyway tryed and dont work this way (double checked) so maybe I'm missing something

Offline

#5 2014-07-30 17:25:37

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Hybrid Graphics

As a useful check that your script is actually being run, add this line:

echo "$(date)" >> /tmp/xinitrc.log

Offline

#6 2014-07-30 17:48:59

Crysis85
Member
Registered: 2014-07-27
Posts: 24

Re: Hybrid Graphics

smart

Now I  know for sure that the script doest work. I think I'm writing it wrong i tryed placing it in the /etc/X11/xinit/xinitrc.d/ and in the /home/crysis/.xinitrc file (it didn't exist before so i created a new one). Oh, I'm using GNOME if that helps

Last edited by Crysis85 (2014-07-30 17:50:11)

Offline

#7 2014-07-30 17:55:56

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Hybrid Graphics

"doest" is a bit ambiguous wink

"work" is also ambiguous - you mean your xrandr line doesn't *run*?

Try also logging your xrandr command:

xrandr --setprovideroffloadsink radeon Intel >> /tmp/xinitrc.log 2>&1

Offline

Board footer

Powered by FluxBB