Bug 106271 - Switch between AMD hybrid graphics (HD 8650G / HD 8970M) makes hardware reset.
Summary: Switch between AMD hybrid graphics (HD 8650G / HD 8970M) makes hardware reset.
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 17:40 UTC by Aneroid
Modified: 2015-11-15 20:08 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.2.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
lspci -vvv (15.35 KB, text/plain)
2015-10-19 17:40 UTC, Aneroid
Details
glxinfo (97.24 KB, text/plain)
2015-10-19 17:41 UTC, Aneroid
Details
dmesg (68.83 KB, text/plain)
2015-10-19 17:42 UTC, Aneroid
Details
dmesg after Xorg fall (69.67 KB, text/plain)
2015-10-30 14:35 UTC, Aneroid
Details
Xorg.log (46.78 KB, text/plain)
2015-10-30 14:36 UTC, Aneroid
Details
Kernel crash log (72.54 KB, text/plain)
2015-11-01 06:06 UTC, Aneroid
Details

Description Aneroid 2015-10-19 17:40:36 UTC
Created attachment 190531 [details]
lspci -vvv

Hello, 
Hardware: MSI GX60 with two graphic cards, integrated inside A10 GPU and discrete AMD R9 M290X.

Integrated card is the main card by default:

sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD:+:Pwr:0000:00:01.0
1:DIS: :DynOff:0000:01:00.0

If I try to swich to discrete card:

sudo echo DIS > /sys/kernel/debug/vgaswitcheroo/switch

Hardware reboot happend and BIOS starting.
Comment 1 Aneroid 2015-10-19 17:41:54 UTC
Created attachment 190541 [details]
glxinfo
Comment 2 Aneroid 2015-10-19 17:42:21 UTC
Created attachment 190551 [details]
dmesg
Comment 3 Lukas Wunner 2015-10-20 19:01:30 UTC
The pitcairn GPU says "No connectors reported connected with modes". I suppose that's the discrete GPU?

Does this machine have a hardware mux at all? If not, the discrete GPU can only be used to offload rendering and switching won't work. I guess the only thing that can be improved in this case is to make radeon_atpx_switchto() a no-op on muxless machines.

If on the other hand the machine *does* have a mux, the question is why the pitcairn GPU didn't find any modes. Are there none in VBT? If so, the issue can probably be solved by temporarily switching DDC to the discrete GPU on probe. I'm working on patches to do that with apple-gmux on the MacBook Pro.
Comment 4 Alex Deucher 2015-10-20 19:08:55 UTC
According to the log, the dGPU has a single VGA port.  I doubt it's muxed, just about all AMD PX laptops have been muxless for a while now.  It's probably a VGA port on a docking station.  As Lukas mentioned, if you want to use the dGPU, you can only use it for offscreen rendering.  See this page for how to utilize that functionality:
http://nouveau.freedesktop.org/wiki/Optimus/
Comment 5 Aneroid 2015-10-27 15:27:58 UTC
Yes, I try to do that.

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7e cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 4 associated providers: 0 name:radeon
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 0 name:radeon

xrandr --setprovideroffloadsink 0x7e 0x46

And it ruined my xorg completely. X fall out in to the shell without any errors.

I could switch between graphics card on flgrx driver with "aticonfig --px-dgpu" and "aticonfig --px-igpu". It worked well.
But now, it seems that I stuck in low power graphics mode and I can't switch to my power card. '

glxinfo always show me AMD ARUBA chip:

glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD ARUBA (DRM 2.43.0, LLVM 3.7.0)

DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD ARUBA (DRM 2.43.0, LLVM 3.7.0)

DRI_PRIME=0 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD ARUBA (DRM 2.43.0, LLVM 3.7.0)
Comment 6 Alex Deucher 2015-10-27 15:47:57 UTC
(In reply to Aneroid from comment #5)
> Yes, I try to do that.
> 
> xrandr --listproviders
> Providers: number : 2
> Provider 0: id: 0x7e cap: 0xf, Source Output, Sink Output, Source Offload,
> Sink Offload crtcs: 4 outputs: 4 associated providers: 0 name:radeon
> Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload,
> Sink Offload crtcs: 6 outputs: 1 associated providers: 0 name:radeon
> 
> xrandr --setprovideroffloadsink 0x7e 0x46

You've got the arguments reversed; the first is the offload device, the second is the display device.  Try:

xrandr --setprovideroffloadsink 0x46 0x7e

> 
> And it ruined my xorg completely. X fall out in to the shell without any
> errors.

Can you attach your dmesg output and xorg log when you do that?

Does adding amdgpu.runpm=0 to the kernel command line in grub help?
Comment 7 Aneroid 2015-10-30 14:33:47 UTC
(In reply to Alex Deucher from comment #6)
> 
> You've got the arguments reversed; the first is the offload device, the
> second is the display device.  Try:
> 
> xrandr --setprovideroffloadsink 0x46 0x7e

Ok.

[an@GX60 ~]$ xrandr --setprovideroffloadsink 0x46 0x7e
[an@GX60 ~]$ DRI_PRIME=0 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD ARUBA (DRM 2.43.0, LLVM 3.7.0)
[an@GX60 ~]$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD ARUBA (DRM 2.43.0, LLVM 3.7.0)

But in that case nothing happend at all.

> > 
> > And it ruined my xorg completely. X fall out in to the shell without any
> > errors.
> 
> Can you attach your dmesg output and xorg log when you do that?
> 
> Does adding amdgpu.runpm=0 to the kernel command line in grub help?

This line does not change anything either.
Comment 8 Aneroid 2015-10-30 14:35:19 UTC
Created attachment 191621 [details]
dmesg after Xorg fall
Comment 9 Aneroid 2015-10-30 14:36:06 UTC
Created attachment 191631 [details]
Xorg.log
Comment 10 Aneroid 2015-11-01 06:06:08 UTC
Created attachment 191771 [details]
Kernel crash log

Very strange things happend.
Kernel crash on every reboot now.

It looks like kernel switch on pitcairin card, but can't boot from it.

I remove any kernel options.
Comment 11 Aneroid 2015-11-12 14:44:03 UTC
May be the root of that problem is that Radeon HD 8970M is not a Pitcairn card ?

It is a Neptune XT, some kind of mobile version:
http://www.techpowerup.com/gpudb/1966/radeon-hd-8970m.html
Comment 12 Alex Deucher 2015-11-12 15:34:40 UTC
(In reply to Aneroid from comment #11)
> May be the root of that problem is that Radeon HD 8970M is not a Pitcairn
> card ?
> 
> It is a Neptune XT, some kind of mobile version:
> http://www.techpowerup.com/gpudb/1966/radeon-hd-8970m.html

Neptune is the just the code name for mobile Pitcairn chips.
Comment 13 Aneroid 2015-11-15 08:39:57 UTC
Ok.

But this strange error: "radeon 0000:01:00.0: VCE init error (-22)."
What does it mean ?
Comment 14 Alex Deucher 2015-11-15 20:08:45 UTC
(In reply to Aneroid from comment #13)
> Ok.
> 
> But this strange error: "radeon 0000:01:00.0: VCE init error (-22)."
> What does it mean ?

The video encoding engine failed to initialize.  This is a known issue on certain SI parts, but is harmless unless you need to use the encoding engine.

Note You need to log in before you can comment on or make changes to this bug.