Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dual GPU switching
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Elaman
n00b
n00b


Joined: 28 Jul 2016
Posts: 23

PostPosted: Wed Feb 20, 2019 5:53 pm    Post subject: Dual GPU switching Reply with quote

I have a laptop with two graphic cards, the Intel integrated HD graphics and an AMD Radeon. I want to know which one of them is being used in my current X session and how can I switch between the two.

Apologies beforehand if this is covered on the handbook, but I couldn't find anything. I understand this is a quite common thing in laptops, and if one has a dedicated graphics card it's probably because one wants to use it.
I have followed the steps for the AMDGPU, which is the driver I use for the Radeon.

This is the full log for my X session:
https://pastebin.com/Qgaqp567

I don't really have a device configuration file nor xorg.conf as such. My only configuration files are for keyboard and mouse.
Back to top
View user's profile Send private message
joanandk
n00b
n00b


Joined: 12 Feb 2017
Posts: 71

PostPosted: Thu Feb 21, 2019 7:59 pm    Post subject: Reply with quote

Hi,

As root, please send us the output of
Code:
lspci -k


If you are using the opensource driver for AMD, then you should have the file "switch" under "/sys/kernel/debug/vgaswitcheroo". This file will tell you which adapter you are using:
Code:
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynOff:0000:01:00.0


You can then switch to the dedicated by executing
Code:
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
. You must log out of Xorg and log in back to use the dedicated adapter.

BE AWARE: I am not sure if your system will automatically switch the gmux correctly! If not you will have a black screen on the laptop, but the external monitor connector will work.

BR
PS: This topic is not in the Gentoo manual, as this is Linux specific issue.
Back to top
View user's profile Send private message
Elaman
n00b
n00b


Joined: 28 Jul 2016
Posts: 23

PostPosted: Sun Feb 24, 2019 4:14 pm    Post subject: Reply with quote

I got this working and it was surprisingly simple. I Guess I was almost there configuration-wise, but didn't know anything about PRIME.

First of all, for checking what is the card currently in use, I have added the following alias:

Code:
alias activecard='glxinfo | grep OpenGL.renderer'


I have the dedicated graphics card from AMD on profile 1, and Intel on 0, so for setting the GPU offload I do the following:

Code:
xrandr --setprovideroffloadsink 1 0


Finally, I run the applications that I want to use AMD with, as follows:

Code:
DRI_PRIME=1 <command>


And that was all there is to it, it seems.
I'd run some benchmarks but I already notice a pretty clear difference in performance, especially with mplayer.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum