I'm running Xubuntu 18.04 on my Dell Inpiron 15 7548. Machine has integrated HD 5500 graphics, and a dedicated AMD R7 card. I've tried getting access to my dedicated card several times, but always ended up giving up, so I would really like to try and get to the bottom of this so I can actually use my hardware.
First off, both cards are detected just fine:
narameh@Hydrogen:~$ lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09) 08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Opal XT [Radeon R7 M265/M365X/M465] (rev ff)
I've tried following Dell's own guide on how to use switcheroo to just switch the entire system to the dedicated card, found here: https://www.dell.com/support/article/uk/en/ukbsdt1/sln298475/a-guide-to-hybrid-video-on-dell-pcs-with-an-ubuntu-operating-system?lang=en
Here's some output:
VGA switcheroo is enabled:
narameh@Hydrogen:~$ grep -i switcheroo /boot/config-* /boot/config-4.15.0-50-generic:CONFIG_VGA_SWITCHEROO=y /boot/config-4.15.0-51-generic:CONFIG_VGA_SWITCHEROO=y
Switch file exists:
narameh@Hydrogen:~$ sudo ls -l /sys/kernel/debug/vgaswitcheroo/switch -rw-r--r-- 1 root root 0 Jun 12 16:07 /sys/kernel/debug/vgaswitcheroo/switch
narameh@Hydrogen:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch 0:IGD:+:Pwr:0000:00:02.0 1:DIS: :DynOff:0000:08:00.0
The tutorial assumes it's either Pwr or Off, but since this is meant to be a hybrid system, for me it's DynOff. Hence, when I try to turn on the disconnected GPU as per instructions, nothing happens, as it's not really disconnected, just dynamically turned off. This has to happen as root, otherwise I cannot echo due to lack of permissions.
narameh@Hydrogen:~$ sudo su root@Hydrogen:/home/narameh# echo ON > /sys/kernel/debug/vgaswitcheroo/switch root@Hydrogen:/home/narameh# cat /sys/kernel/debug/vgaswitcheroo/switch 0:IGD:+:Pwr:0000:00:02.0 1:DIS: :DynOff:0000:08:00.0
Next I tried to use DRI_PRIME to run something on my AMD card to see if I could get it to turn on at all. I can for a second, by running
in one terminal window, and spamming
narameh@Hydrogen:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
in the other. However, the first terminal then spits out a load of errors and we go back to DynOff. Pastebin of error output: https://pastebin.com/gJ4StVLS
Googling the error code got me this topic with a similar issue: https://www.linuxquestions.org/questions/slackware-14/current-14-2-and-dri-3-and-dri_prime-ain%27t-working-4175578108/ More info on what this poster is doing here: https://kaosx.us/docs/hybrid_gfx/
Following the steps there gets me the following
DRI seems to be fine:
narameh@Hydrogen:~$ cat /var/log/Xorg.0.log | grep DRI [ 45.527] (II) RADEON(G0): [DRI2] Setup complete [ 45.527] (II) RADEON(G0): [DRI2] DRI driver: radeonsi [ 45.527] (II) RADEON(G0): [DRI2] VDPAU driver: radeonsi [ 46.672] (II) modeset(0): [DRI2] Setup complete [ 46.672] (II) modeset(0): [DRI2] DRI driver: i965 [ 46.672] (II) modeset(0): [DRI2] VDPAU driver: i965 [ 46.704] (II) GLX: Initialized DRI2 GL provider for screen 0 narameh@Hydrogen:~$ xrandr --listproviders Providers: number : 2 Provider 0: id: 0x66 cap: 0x9, Source Output, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting Provider 1: id: 0x41 cap: 0x6, Sink Output, Source Offload crtcs: 2 outputs: 0 associated providers: 1 name:OLAND @ pci:0000:08:00.0 narameh@Hydrogen:~$ xrandr --setprovideroffloadsink 0x41 0x66 narameh@Hydrogen:~$
Note that it throws no errors, so this command seems to work fine. When I then try to run on either card, the intel onboard works fine:
narameh@Hydrogen:~$ DRI_PRIME=0 glxinfo | grep "OpenGL vendor string" OpenGL vendor string: Intel Open Source Technology Center
But the AMD still throws the same errors: https://pastebin.com/W56z6z3L
In the end, the user in the thread traces his problems to a bad kernel commit and rolls back, but as this is a) a thread from 2016 and b) I am not an advanced enough user to go messing with my kernel, that is not an option for me.
I can find multiple other similar errors that seem related to kernel versions (e.g. https://bugs.freedesktop.org/show_bug.cgi?id=102800 on Ubuntu 17.01 or this one https://bugs.freedesktop.org/show_bug.cgi?id=94874)
In both topics, adding radeon.nopm=0 to the kernel boot is suggested, but I am hesitant to try this without some guidance as I don't know enough about what I'm doing.
I hope it's clear from this post I have put in the work to try and solve this on my own, but am running into the limits of my knowledge and don't want to mess up my system by changing things I don't understand or cannot undo if I end up booting into a black screen because of it. Some help from someone more advanced would be extremely appreciated.
tldr: discrete AMD is in DynOff can't be forced on with VGA_switcheroo. DRI_PRIME can talk to discrete card, but errors with what seems to be a kernel issue? User is at the end of her knowledge and afraid to break stuff. Help appreciated.
EDIT: realised including kernel version etc would be useful:
narameh@Hydrogen:~$ uname -r 4.15.0-51-generic narameh@Hydrogen:~$ lspci -nnk | grep -i vga -A3 00:02.0 VGA compatible controller : Intel Corporation HD Graphics 5500 [8086:1616] (rev 09) Subsystem: Dell HD Graphics 5500 [1028:066f] Kernel driver in use: i915 Kernel modules: i915 -- 08:00.0 VGA compatible controller : Advanced Micro Devices, Inc. [AMD/ATI] Opal XT [Radeon R7 M265/M365X/M465] [1002:6604] (rev ff) Kernel driver in use: radeon Kernel modules: radeon, amdgpu
EDIT 2: Also useful to add there are no options to switch on/off my GPUs in my bios. No video related options at all.