You are not logged in.

#1 2018-01-18 20:20:29

Potomac
Member
Registered: 2011-12-25
Posts: 526

[radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

Hello,

I have a radeon HD4650 pcie, I use the radeon driver,
CPU : intel core 2 quad Q9650 3 Ghz, 8 Gb ram, kde plasma 5

I notice that with kernel 4.15.rc8 mainline some videos in 1080p@60fps format in youtube play with slight lags in fullscreen mode,

but If use kernel 4.14.13-1 then all is Ok, streaming videos in 1080p@60fps play without lags ( perfect 60 fps ),

so I suspect a bug in radeon driver provided by kernel 4.15.rc8,

some example of video 1080@60 fps for youtube :
https://www.youtube.com/watch?v=CcUXxM_rbAM

Last edited by Potomac (2018-01-18 20:20:55)

Offline

#2 2018-01-19 16:34:01

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

I am not seeing a question in your post.  If you believe there is a bug in 4.15.rc8's radeon module what have you done to find the commit that introduced that bug?

Offline

#3 2018-01-20 04:46:32

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

I wanted to know if someone has also the same bug,

I made a git bisect, I have found the commit that introduced the bug :

commit 648bc3574716400acc06f99915815f80d9563783

Date:   Thu Jul 6 09:59:43 2017 +0200

    drm/ttm: add transparent huge page support for DMA allocations v2
    
    Try to allocate huge pages when it makes sense.
    
    v2: fix comment and use ifdef

I created a workaround with a patch but it will probably work only for radeon driver ( to work with all gpu cards the patch has to be improved ) :

https://bugzilla.kernel.org/attachment.cgi?id=273757

my bugreport if it can help someone :
https://bugzilla.kernel.org/show_bug.cgi?id=198511

Last edited by Potomac (2018-01-20 04:59:45)

Offline

#4 2018-01-20 12:59:48

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

On the kernel with the issue were any hugepages in use when the issue occurred or was just having the infrastructure in use enough to trigger the issue? ( `cat /proc/meminfo` )

Offline

#5 2018-01-20 15:33:39

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

I am not sure to understand your question,

the problem occurs every time with this use case :

- install kernel 4.15rc7 ( or 4.15rc8 ) from "mainline" branch
- plasma 5 ( kde ) for desktop ( I didn't test with other windows manager )
- graphic card : amd radeon hd4650 pcie ( radeon driver ) but I don't know if the bug occurs also with other cards
- open firefox
- go to youtube website, in html5 mode ( no flash plugin )
- choose a video which has 1080p, 60 FPS format and go to fullscreen mode
- you will notice that playback is not 100% fluid, there are some little lags on travelling images, and the contextual menu ( right click when the screen is on fullscreen mode ) reacts slowly

the bug occurs every time, even if there is no high activity on the PC,  it's not a random bug, we can see easily a performance issue for streaming video in HD@60 fps in youtube fullscreen mode, streaming video in 30 fps seems ok, the problem is noticeable when the video has a framerate format of 60 FPS, 


my CPU : intel core 2 quad Q9650 ( 3 Ghz )
ram : 8 Gb DDR2
motherboard: gigabyte GA-P35-DS3L ( socket 775, chipset intel P35 )

if you have a more recent and powerfull CPU ( ryzen, core i7 ) then the performance issue will be probably hidden by your CPU, but if you have a less powerfull CPU then the performance loss will be noticeable in youtube for HD videos 60 fps in fullscreen mode,

all these problems are solved if we use kernel 4.14.x ( stable branch ) or if we revert the changes made by commit 648bc35747 ( drm/ttm changes )

the output of "cat /proc/meminfo" when the bug occurs :

MemTotal:        8171844 kB
MemFree:         6188792 kB
MemAvailable:    6979356 kB
Buffers:          156940 kB
Cached:           780372 kB
SwapCached:            0 kB
Active:          1020160 kB
Inactive:         742148 kB
Active(anon):     647812 kB
Inactive(anon):   126472 kB
Active(file):     372348 kB
Inactive(file):   615676 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       5242876 kB
SwapFree:        5242876 kB
Dirty:             21768 kB
Writeback:             0 kB
AnonPages:        812840 kB
Mapped:           423408 kB
Shmem:            127600 kB
Slab:              73336 kB
SReclaimable:      46020 kB
SUnreclaim:        27316 kB
KernelStack:        6256 kB
PageTables:        29324 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     9328796 kB
Committed_AS:    2785064 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:    145408 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      187264 kB
DirectMap2M:     8200192 kB

Last edited by Potomac (2018-01-20 15:55:37)

Offline

#6 2018-01-20 17:52:18

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

AnonHugePages:    145408 kB

So transparent huge pages were used.
Edit:
changed from checking Explicit Huge Pages to Anon Huge Pages which is the relevant use.
Edit2:
If you add the kernel parameter transparent_hugepage=never does the issue still occur?

Last edited by loqs (2018-01-20 18:01:37)

Offline

#7 2018-01-21 07:49:23

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

I tried with the kernel parameter "transparent_hugepage=never" : the bug is still here

here is the output of "cat /proc/meminfo" when the kernel parameter "transparent_hugepage=never" is used and when I see hd youtube video@60 fps in fullscreen mode :

MemTotal:        8171844 kB
MemFree:         6201872 kB
MemAvailable:    7196352 kB
Buffers:          175860 kB
Cached:           828424 kB
SwapCached:            0 kB
Active:           962712 kB
Inactive:         770948 kB
Active(anon):     572560 kB
Inactive(anon):   117736 kB
Active(file):     390152 kB
Inactive(file):   653212 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       5242876 kB
SwapFree:        5242876 kB
Dirty:              6592 kB
Writeback:             0 kB
AnonPages:        729364 kB
Mapped:           446376 kB
Shmem:            118880 kB
Slab:              80408 kB
SReclaimable:      52736 kB
SUnreclaim:        27672 kB
KernelStack:        5956 kB
PageTables:        31036 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     9328796 kB
Committed_AS:    2722200 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      201600 kB
DirectMap2M:     8185856 kB

some additionnal informations :

- I use plasma 5 ( kde ) as window manager, the vsync option is set to "automatic" in plasma 5 options, "openGL 2.0 acceleration" option is used for the compositor for plasma 5,

- mesa version : 17.3.2-2

$ glxinfo | grep "OpenGL version"                                                                           
OpenGL version string: 3.0 Mesa 17.3.2          

- the contain of /etc/X11/xorg.conf.d/20-radeon.conf :

Section "Device"
    Identifier "Radeon"
    Driver "modesetting"
    Option "TearFree" "off"
    Option "DRI" "3"
    Option "AccelMethod" "glamor"
EndSection

Last edited by Potomac (2018-01-21 08:17:10)

Offline

#8 2018-01-21 10:30:18

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

AnonHugePages:         0 kB

So that disabled transparent huge pages.  So the bug is caused by what i termed 'the infrastructure' just the code changes to support the use of transparent huge pages.

Offline

#9 2018-01-21 17:26:02

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

here is the output of "cat /sys/kernel/debug/dri/0/ttm_dma_page_pool" when no youtube video are played ( firefox is not running ), with kernel 4.15rc8 :

         pool      refills   pages freed    inuse available     name
           wc         1682             0     1344     5384 radeon 0000:01:00.0
       wchuge         1130          4514        0        6 radeon 0000:01:00.0
       cached       106272        424533      552        3 radeon 0000:01:00.0
   cachedhuge            6            18        0        6 radeon 0000:01:00.0

and now with firefox running, youtube video hd@60 fps in full screen mode ( output given by my bash script running in background ) :

         pool      refills   pages freed    inuse available     name
           wc         1682             0     2089     4639 radeon 0000:01:00.0
       wchuge         3012         12042        3        3 radeon 0000:01:00.0
       cached       113562        453693      552        3 radeon 0000:01:00.0
   cachedhuge            7            24        0        4 radeon 0000:01:00.0

I made another expirement : using a different web-browser :

- If I use chromium 63.0.3239.132 ( a web browser based on chrome ) then there is no bug, playback is 100% fluid, no lags, it's perfect,

- If I use opera 50.0 then there is a bug, like firefox 57, I get lags, the only difference is that I get also a vsync problem ( tearing )

so it seems that this commit breaks something on applications like web-browsers if they use a precise technic for rendering streaming video ( related to memory management ? )

chromium seems to be the only web-browser which is not affected by this commit

Offline

#10 2018-01-21 17:43:39

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

In firefox can you check about:support under the Graphics section HW_COMPOSITING.  If it is disabled try toggling layers.acceleration.force-enabled restart firefox and retest see if there is any difference.

Offline

#11 2018-01-21 18:00:01

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

I checked in about:support, I can read this :

HW_COMPOSITING	blocked by default: Acceleration blocked by platform

OPENGL_COMPOSITING	unavailable by default: Hardware compositing is disabled

WEBRENDER	opt-in by default: WebRender is an opt-in feature
unavailable by runtime: Build doesn't include WebRender

so I went to about:config et set to "true" the option "layers.acceleration.force-enabled", I restarted firefox and now there is no lags, it's perfect on firefox 57,

but does it mean that it's just a workaround ?
or there is still a bug in kernel 4.15rc8 ?

because with kernel 4.14.14 ( stable branch ) and with the option "layers.acceleration.force-enabled" disabled I get no lags

Offline

#12 2018-01-21 18:05:37

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

I would call this a work around as the the option is disabled for linux by default for firefox 57.  The extra overhead of not using hardware compositing plus the extra overhead of the kernel change leads to frame drops.
Edit:
spelling disabled  not disbaled

Last edited by loqs (2018-01-21 18:06:51)

Offline

#13 2018-01-21 18:28:31

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [radeon] lags in youtube video 1080p@60fps with kernel 4.15rc8

ok thanks for your help, I understand better this bug,

however it seems that enabling "layers.acceleration.force-enabled" is not a good idea because the GPU hardware acceleration support in firefox for linux can trigger instability :

https://www.reddit.com/r/firefox/commen … ox_may_be/
https://bugzilla.mozilla.org/show_bug.cgi?id=1323284

Last edited by Potomac (2018-01-21 18:31:02)

Offline

Board footer

Powered by FluxBB