You are not logged in.

#1 2017-03-31 06:51:48

plintX
Member
Registered: 2016-08-02
Posts: 5

Setting up an AMD GPU as "render offload" with the "amdgpu" driver

Hi all,

I've been having issues verifying whether my Radeon 7850M (Southern Islands card) is working correctly as a render offload provider. The amdgpu module appears to be loaded fine,
but I'm a bit suspicious since I haven't noticed any temperature spikes when running `sensors` while running games.
Also the radeon card doesn't show up as usual under xrandr --listproviders, but rather as still controlled by the modesetting driver.
Furthermore, the radeon-profile tool from https://github.com/marazmista/radeon-profile lists Intel info instead of radeon info.


Is this setup correct for what I want to achieve, and how can I confirm that render offload is working correctly?

Cheers

I've linked to some stuff below from relevant applications and included some relevant code snippets in this post:

Screenshot from radeon-profile tool: http://imgur.com/a/RD3an
10-display.conf in /etc/X11/xorg.conf.d: https://pastebin.com/Gk9CqmpC
Xorg.0.log from ~/.local/share/xorg: https://pastebin.com/rNhWFfLx
dmesg output: https://pastebin.com/1XU2zqZD

uname -a
Linux lintr 4.10.6-1-ARCH #1 SMP PREEMPT Mon Mar 27 08:28:22 CEST 2017 x86_64 GNU/Linux
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x79 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 1 name:modesetting
Provider 1: id: 0x41 cap: 0x5, Source Output, Source Offload crtcs: 2 outputs: 0 associated providers: 1 name:modesetting
sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +45.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +43.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +44.0°C  (high = +100.0°C, crit = +100.0°C)

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        2664 RPM

pch_skylake-virtual-0
Adapter: Virtual device
temp1:        +43.0°C  

amdgpu-pci-0300
Adapter: PCI adapter
temp1:        +45.0°C  (crit = +120.0°C, hyst = +90.0°C)

iwlwifi-virtual-0
Adapter: Virtual device
temp1:        +46.0°C  

acpitz-virtual-0
Adapter: Virtual device
temp1:        +45.0°C  (cri
cat /etc/X11/xorg.conf.d/10-display.conf
Section "Device"
	Identifier "Intel"
	Driver "modesetting"
EndSection

Section "Device"
	Identifier "AMD"
	Driver "amdgpu"
	Option "TearFree" "true"
EndSection


Section "Screen"
	Identifier "ScreenLayout"
	Device "Intel"
	GPUDevice "AMD"
EndSection
lsmod | grep -ie "amd" -ie "radeon"
amdkfd                122880  1
amd_iommu_v2           20480  1 amdkfd
amdgpu               1507328  1
ttm                    86016  1 amdgpu
drm_kms_helper        126976  2 amdgpu,i915
drm                   303104  10 amdgpu,i915,ttm,drm_kms_helper
i2c_algo_bit           16384  2 amdgpu,i915
dmesg | grep -ie "amd" -ie "radeon" -ie "i915"
[    0.000000] RAMDISK: [mem 0x7fa32000-0x7fffefff]
[    0.000000] ACPI: SSDT 0x00000000B7FCF000 00034E (v01 LENOVO AmdTabl  00001000 INTL 20141107)
[    0.984212] ACPI: Power Resource [AMD2] (on)
[   12.332358] [drm] amdgpu kernel modesetting enabled.
[   12.601523] AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>
[   12.601527] AMD IOMMUv2 functionality not available on this system
[   12.752206] i915 0000:00:02.0: enabling device (0006 -> 0007)
[   12.794381] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=mem
[   12.898123] amdgpu 0000:03:00.0: VRAM: 2048M 0x0000000000000000 - 0x000000007FFFFFFF (2048M used)
[   12.898130] amdgpu 0000:03:00.0: GTT: 2048M 0x0000000080000000 - 0x00000000FFFFFFFF
[   12.898399] [drm] amdgpu: 2048M of VRAM memory ready
[   12.898402] [drm] amdgpu: 2048M of GTT memory ready.
[   12.902491] amdgpu 0000:03:00.0: PCIE GART of 2048M enabled (table at 0x0000000000040000).
[   12.902745] amdgpu 0000:03:00.0: amdgpu: using MSI.
[   12.902806] [drm] amdgpu: irq initialized.
[   12.931088] [drm] amdgpu: dpm initialized
[   12.931142] [drm] AMDGPU Display Connectors
[   13.089403] [drm] Finished loading i915/skl_dmc_ver1_26.bin (v1.26)
[   13.176832] amdgpu 0000:03:00.0: fence driver on ring 0 use gpu addr 0x0000000080000010, cpu addr 0xffff880237b8a010
[   13.177045] amdgpu 0000:03:00.0: fence driver on ring 1 use gpu addr 0x0000000080000020, cpu addr 0xffff880237b8a020
[   13.177214] amdgpu 0000:03:00.0: fence driver on ring 2 use gpu addr 0x0000000080000030, cpu addr 0xffff880237b8a030
[   13.177389] amdgpu 0000:03:00.0: fence driver on ring 3 use gpu addr 0x0000000080000040, cpu addr 0xffff880237b8a040
[   13.177552] amdgpu 0000:03:00.0: fence driver on ring 4 use gpu addr 0x0000000080000050, cpu addr 0xffff880237b8a050
[   13.177841] [drm] enabling PCIE gen 3 link speeds, disable with amdgpu.pcie_gen2=0
[   15.162782] [drm] Initialized amdgpu 3.9.0 20150101 for 0000:03:00.0 on minor 0
[   15.165270] [drm] Initialized i915 1.6.0 20161121 for 0000:00:02.0 on minor 1
[   15.499495] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   17.318495] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
cat Xorg.0.log | grep -ie "amd" -ie "radeon"
[    52.096] (**) |   |-->GPUDevice "AMD"
[    52.228] (II) LoadModule: "amdgpu"
[    52.228] (II) Loading /usr/lib/xorg/modules/drivers/amdgpu_drv.so
[    52.257] (II) Module amdgpu: vendor="X.Org Foundation"
[    52.257] (II) AMDGPU: Driver for AMD Radeon:
	All GPUs supported by the amdgpu kernel driver
[    54.691] (II) UnloadModule: "amdgpu"
[    54.691] (II) Unloading amdgpu
[    55.404] (II) modeset(G0): [DRI2]   DRI driver: radeonsi
[    55.404] (II) modeset(G0): [DRI2]   VDPAU driver: radeonsi

Any help or clarification would be appreciated. Thanks!

Offline

#2 2017-03-31 13:30:52

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Setting up an AMD GPU as "render offload" with the "amdgpu" driver

I also have an intel gpu + amd si gpu on my laptop, however I'm not using the amdgpu given that it doesn't work with my gpu. I'm using the modesetting driver only, this means no xf86-video-{intel,ati} packages installed and no special xorg configuration files.

When the intel gpu is doing the rendering the output of 'glxinfo | grep "OpenGL renderer"' is: 'OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)', when it is the amd gpu doing the rendering i get: 'OpenGL renderer string: Gallium 0.4 on AMD OLAND (DRM 2.49.0 / 4.10.6-1-ARCH, LLVM 3.9.1)'. I suppose you should get something similar.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2017-04-01 09:59:46

plintX
Member
Registered: 2016-08-02
Posts: 5

Re: Setting up an AMD GPU as "render offload" with the "amdgpu" driver

R00KIE wrote:

I also have an intel gpu + amd si gpu on my laptop, however I'm not using the amdgpu given that it doesn't work with my gpu. I'm using the modesetting driver only, this means no xf86-video-{intel,ati} packages installed and no special xorg configuration files.

When the intel gpu is doing the rendering the output of 'glxinfo | grep "OpenGL renderer"' is: 'OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)', when it is the amd gpu doing the rendering i get: 'OpenGL renderer string: Gallium 0.4 on AMD OLAND (DRM 2.49.0 / 4.10.6-1-ARCH, LLVM 3.9.1)'. I suppose you should get something similar.

Yes, this was the case when I was using the modesetting driver + xf86-video-ati for me as well.
I used a similar xorg.conf in that setup, just replaced the driver line with "amdgpu" instead of "radeon". So not sure what the issue is.

The reason I am trying to use the amdgpu rather than the radeon driver is because the amdgpu driver supports vsync fences when offloading,
see: https://www.phoronix.com/scan.php?page= … E-Ex-Patch

Offline

#4 2017-04-04 14:09:35

plintX
Member
Registered: 2016-08-02
Posts: 5

Re: Setting up an AMD GPU as "render offload" with the "amdgpu" driver

update:

after I swapped back to the modesetting + xf86-video-ati driver for a while,
I swapped back to xf86-video-amdgpu without a config file and explicitly set the offload sink using

xrandr --setprovideroffloadsink 1 0

This seems to have done the trick. I now get the usual output when setting DRI_PRIME=1 and xrandr --listproviders

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x69 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 1 name:modesetting
Provider 1: id: 0x41 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 0 associated providers: 1 name:AMD Radeon R7 M370 @ pci:0000:03:00.0
DRI_PRIME=1  glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD OLAND (DRM 3.9.0 / 4.10.6-1-ARCH, LLVM 3.9.1)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.2
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.0.2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

Unfortunately, in the process I've come across a weird tearing issue that seems to be present regardless of whether I use amdgpu, video-ati, or the modesetting driver alone. Oh well.

Offline

#5 2017-04-04 14:23:41

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Setting up an AMD GPU as "render offload" with the "amdgpu" driver

Oh that is nice, too bad the gpu in my laptop and amdgpu still don't play along very well together.

Regarding tearing, at least with the radeon driver and using offloading I've seen what I can only describe as diagonal tearing, as if the image is copied from the dgpu to the igpu as two separate triangles. If I remember correctly I have also seen it while testing with windows so at the time I've just assumed that's how it is going to work and never thought about it more (not that I use offloading that much or play games so not a big problem).

Edit:
You seem to have exactly the same card as me, but mine does not play well with amdgpu, what does the output of 'lspci -nn' have to say about your card? Mine says "Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Mars [Radeon HD 8670A/8670M/8750M] [1002:6600] (rev 81)". Are you loading amdgpu early (as in include the module in the initramfs)?

Last edited by R00KIE (2017-04-04 14:30:09)


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB