Xrandr error when try to set switchable graphics


i’m trying to apply this article:

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0xc5 cap: 0xd, Source Output, Source Offload, Sink Offload crtcs: 0 outputs: 0 associated providers: 1 name:AMD Radeon R7 M340 @ pci:0000:01:00.0

when i try :

$ xrandr --setprovideroutputsource “AMD Radeon R7 M340 @ pci:0000:01:00.0” modesetting

i got this error

X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 35 (RRSetProviderOutputSource)
Value in failed request: 0xc5
Serial number of failed request: 16
Current serial number in output stream: 17


That does not look like anything on that article you try to follow. By it, and the information you provided, you should run:
xrandr --setprovideroutputsource 0x43 0xc5

But, if you installed the intel-amd hybrid drivers the proper way, via MHWD, then running
DRI_PRIME=1 your_progam
should be just that easy and work …