Bug 832 - Lag in openGL games.
: Lag in openGL games.
Status: CLOSED WONTFIX
Product: AMD Catalyst™Proprietary Display Driver
Classification: Unclassified
Component: OpenGL Driver
: .archived
: All Linux
: low normal
Assigned To: nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-07 08:06 CDT by f.volejnik
Modified: 2014-03-31 12:13 CDT (History)
11 users (show)



Attachments
CS:S Linux openGL frame times (21.03 KB, text/plain)
2013-10-08 13:20 CDT, f.volejnik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description f.volejnik 2013-06-07 08:06:01 CDT
Hello,

on linux i experience an input lag (input->display delay) while using openGL applications. User input is rendered with varying delay, from non-recognizable to painfully obvious (it could be as much as 0.5s, or more). From what I experienced it seems as if the CPU is never synchronized with GPU - so more complex scenes that take time to render set the GPU "back in time" and create the multi-frame delay. 

Forcing vsync or frame cap somehow helps to sweep the problem under the carpet, in a way that the maximal delay experienced is related to the frame time cap.

Affected games that I tested: Left 4 Dead 2 Beta, Counter Strike: Source, Awesomenauts.

Example: in L4D2 i can get a visible (e.g. way over 100ms) input lag whilst maintaining solid framerate of 160FPS (<=7 ms/frame) or more - so it is a multi-frame delay (>=14 frames of delay!).

Note: Interestingly for mouse cursors in games: HW cursor is not delayed - only SW cursor (think awesomenauts) is delayed. Lookaround and keyboard input are both delayed. Tweaking input parameters in applications does not help.

There is a bug filed on Valve's github bug tracker that covers it (but this bug is not limited to valve's games, so I doubt it is source engine's bug): https://github.com/ValveSoftware/Source-1-Games/issues/765
Comment 1 f.volejnik 2013-06-07 08:34:17 CDT
My configuration:

AMD RADEON 6770
Intel Core i5@3.3Ghz
Arch Linux
i3 WM
Comment 2 Tomasz 2013-06-09 10:20:09 CDT
I confirm that "bug" - applies also 13.6 beta:

http://ati.cchtml.com/show_bug.cgi?id=821
Comment 3 christian_obst@gmx.de 2013-06-09 11:15:33 CDT
I am also using 13.6_beta, my machine is a HP Pavilion Dv6 with Intel / ATI Hybrid graphics. I thought the lag comes from the transfer from the ATI discrete gpu to the framebuffer of the Intel integrated GPU, but as with the other bug reporters, it only happens with certain games.

Half Life 2 in Wine: no mouse lag, everything is fine (longer startup though, and stuttering at the beginning of loading a games sometimes, goes away after moving around on the map a bit).

HL2 native: lag as described, but no stuttering after loading a game.
Comment 4 bakitajoshua 2013-06-13 22:44:57 CDT
I'd also like to confirm this, or at least a variation of this. On my Radeon HD 5450 using the latest stable drivers and the latest beta drivers, when a OpenGL game is focused I see severe input lag about every second.

System Specs:
-Radeon HD 5450
-AMD Phenom x4
-4GB RAM
-Fully Updated Ubuntu 13.04

Possibly relevant info:
-Non-default Emerald window manager
Comment 5 f.volejnik 2013-06-15 13:00:37 CDT
I've investigated a bit further and put up a project that fixes the lag by using fences at the end of the frames. It is not an ideal solution (not 100% error prone) but it illustrates the problem and introduces a hacked-up solution.

https://github.com/volca02/glsync
Comment 6 pyro_1v1aniac 2013-06-17 17:02:26 CDT
Just a "Me too"

ATI Mobility Radeon HD5470, Intel Core i3, same symptoms present in 13.6 and since 13.4

I've stuck with 13.3-3 Beta which doesn't show this bug, though it also doesn't recognize my hardware, leaving me with an "unsupported hardware" watermark.
Comment 7 christian_obst@gmx.de 2013-06-18 14:19:38 CDT
I will try the LD_PRELOAD trick soon and report. I already compiled it, went well.

One question: I will test with HL 2. Do I need to start it directly from the command line, or can I use "LD_PRELOAD=blabla steam", and then start HL2 from Steam? Does the lib precedence carry over to HL2?
Comment 8 christian_obst@gmx.de 2013-06-18 19:29:21 CDT
Ok, I tried starting steam with 'STEAM_FRAME_FORCE_CLOSE=1 STEAM_RUNTIME=1 LD_PRELOAD=/home/christian/glsync/build/sync/libglsync.so  steam'. (Others needed to force proper tray icon behaviour and make it run). It doesn't work and I get this:

/usr/bin/env: symbol lookup error: /home/christian/glsync/build/sync/libglsync.so: undefined symbol: dlopen



(Also tried libglsync32.so, but I get this several times before failing:

ERROR: ld.so: object '/home/christian/glsync/build/sync/libglsync32.so' from LD_PRELOAD cannot be preloaded: ignored.

Although I figure this is normal, since I my machine is 64-bit.)

I also tested "Unvanquished" (Daemon engine), it fails with: 

/bin/sh: symbol lookup error: /home/christian/glsync/build/sync/libglsync.so: undefined symbol: glClientWaitSync

Thirdly, I tried OpenArena, it worked, but it doesn't lag noticably anyway when not LD_PRELOADing. With the other ones, I noticed lag, but I cannot run them with this.
Comment 9 f.volejnik 2013-06-19 02:50:39 CDT
Hi, try copying the hl2.sh and inserting the LD_PRELOAD line directly into the shell script, after the line mentioning LD_PRELOAD:

#   LD_PRELOAD=../src/thirdparty/gperftools-2.0/.libs/libtcmalloc_debug.so:$LD_PRELOAD

export LD_PRELOAD=./libglsync32.so:$LD_PRELOAD

Then run the modified shell script to run the game (maybe this can be done on the hl2.sh directly, didn't test).
Comment 10 christian_obst@gmx.de 2013-06-19 14:56:11 CDT
I tried your suggestion (with libglsync.so, libglsync32 didn't start with the same error) and got the "ignored" message like with the 32-bit lib, but then it started anyway (but without preloading):

ERROR: ld.so: object '/home/christian/glsync/build/sync/libglsync.so' from LD_PRELOAD cannot be preloaded: ignored.
SDL video target is 'x11'
SDL video target is 'x11'
This system supports the OpenGL extension GL_EXT_framebuffer_object.
This system supports the OpenGL extension GL_EXT_framebuffer_blit.
This system supports the OpenGL extension GL_EXT_framebuffer_multisample.
This system DOES NOT support the OpenGL extension GL_APPLE_fence.
This system DOES NOT support the OpenGL extension GL_NV_fence.
This system supports the OpenGL extension GL_ARB_sync.
This system supports the OpenGL extension GL_EXT_draw_buffers2.
This system supports the OpenGL extension GL_EXT_bindable_uniform.
This system DOES NOT support the OpenGL extension GL_APPLE_flush_buffer_range.
This system supports the OpenGL extension GL_ARB_map_buffer_range.
This system supports the OpenGL extension GL_ARB_vertex_buffer_object.
This system supports the OpenGL extension GL_ARB_occlusion_query.
This system DOES NOT support the OpenGL extension GL_APPLE_texture_range.
This system DOES NOT support the OpenGL extension GL_APPLE_client_storage.
This system DOES NOT support the OpenGL extension GL_ARB_uniform_buffer.
This system supports the OpenGL extension GL_ARB_vertex_array_bgra.
This system supports the OpenGL extension GL_EXT_vertex_array_bgra.
This system supports the OpenGL extension GL_ARB_framebuffer_object.
This system DOES NOT support the OpenGL extension GL_GREMEDY_string_marker.
This system DOES NOT support the OpenGL extension GL_ARB_debug_output.
This system supports the OpenGL extension GL_EXT_direct_state_access.
This system DOES NOT support the OpenGL extension GL_NV_bindless_texture.
This system supports the OpenGL extension GL_AMD_pinned_memory.
This system DOES NOT support the OpenGL extension GL_EXT_framebuffer_multisample_blit_scaled.
This system supports the OpenGL extension GL_EXT_texture_sRGB_decode.
This system DOES NOT support the OpenGL extension GL_NVX_gpu_memory_info.
This system supports the OpenGL extension GL_ATI_meminfo.
This system supports the OpenGL extension GL_EXT_texture_compression_s3tc.
This system DOES NOT support the OpenGL extension GL_EXT_texture_compression_dxt1.
This system DOES NOT support the OpenGL extension GL_ANGLE_texture_compression_dxt3.
This system DOES NOT support the OpenGL extension GL_ANGLE_texture_compression_dxt5.
This system DOES NOT support the OpenGL extension GLX_EXT_swap_control_tear.
GL_NV_bindless_texture: DISABLED
GL_AMD_pinned_memory: DISABLED
GL_EXT_texture_sRGB_decode: AVAILABLE
Using breakpad crash handler
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
Did not detect any valid joysticks.
GL_NVX_gpu_memory_info: UNAVAILABLE
GL_ATI_meminfo: AVAILABLE
GL_ATI_meminfo: GL_TEXTURE_FREE_MEMORY_ATI: Total Free: 2030702, Largest Avail: 1829188, Total Aux: 2024317, Largest Aux Avail: 6765
GL_MAX_SAMPLES_EXT: 8
CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3100 MHz, Processor: GenuineIntel
GlobalMemoryStatus: 4294967295
CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3100 MHz, Processor: GenuineIntel
GlobalMemoryStatus: 4294967295
[0619/214716:ERROR:resource_bundle.cc(411)] Failed to load /home/christian/.local/share/Steam/SteamApps/common/Half-Life 2/cef_gtk.pak
Some features may not be available.
[0619/214717:WARNING:proxy_service.cc(646)] PAC support disabled because there is no system implementation
IDirect3DDevice9::Create: BackBufWidth: 1366, BackBufHeight: 768, D3DFMT: 3, BackBufCount: 1, MultisampleType: 0, MultisampleQuality: 0
GL sampler object usage: ENABLED
GL prefer MapBufferRange: NO
Could not load program cache file glbaseshaders.cfg
Could not find base GL shader cache file
CGLMShaderPair::SetProgramPair: Centroid masks differ at link time of vertex shader lightmappedgeneric_vs20 and pixel shader decalbasetimeslightmapalphablendselfillum2_ps20b!
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 0 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 0 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 0 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 0 ps-combo 3
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 40 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 40 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 100 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 100 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 100 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 100 ps-combo 3
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 96 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 96 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 96 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 96 ps-combo 3
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 24 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 24 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 24 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 24 ps-combo 3
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 4 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 4 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 4 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 4 ps-combo 3
Loaded program cache file "glshaders.cfg", total keyvalues: 307, total successfully linked: 307
Precache: Took 9521 ms, Vertex 804, Pixel 1041
ConVarRef mat_dxlevel doesn't point to an existing ConVar
Game.so loaded for "Half-Life 2"
Setting breakpad minidump AppID = 220
Forcing breakpad minidump interfaces to load
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
maxplayers set to 1
Error: Material "debug/debugluxels" uses unknown shader "DebugLuxels"
Error: Material "___fillrate_0" uses unknown shader "FillRate"
Error: Material "___debugnormalmap_1" uses unknown shader "DebugNormalMap"
Error: Material "___debugdrawenvmapmask_2" uses unknown shader "DebugDrawEnvmapMask"
Error: Material "___debugdepth_3" uses unknown shader "DebugDepth"
Error: Material "___debugdepth_4" uses unknown shader "DebugDepth"
Steam config directory: /home/christian/.local/share/Steam/SteamApps/common/Half-Life 2/platform/config
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
CClientSteamContext logged on = 0
JOY_AXIS_X:  mapped to Turn (absolute)
JOY_AXIS_Y:  mapped to Look (absolute)
JOY_AXIS_Z:  unmapped
JOY_AXIS_R:  mapped to Forward (absolute)
JOY_AXIS_U:  mapped to Side (absolute)
JOY_AXIS_V:  unmapped
Advanced Joystick settings initialized
Can't use cheat cvar cam_snapto in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_ideallag in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_idealdelta in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_idealyaw in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_idealpitch in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_idealdist in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_idealdistright in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_idealdistup in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar cam_collision in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_maxpitch in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_minpitch in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_maxyaw in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_minyaw in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_maxdistance in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_mindistance in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_orthowidth in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar c_orthoheight in multiplayer, unless the server has sv_cheats set to 1.
Unknown command "cl_thirdperson"
Unknown command "sv_backspeed"
Did not detect any valid joysticks.
Not playing a local game.

Console initialized.
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
--- Missing Vgui material vgui/servers/icon_replay
--- Missing Vgui material vgui/servers/icon_replay_column
Can't use cheat cvar fog_start in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar fog_end in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar fog_startskybox in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar fog_endskybox in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar r_farz in multiplayer, unless the server has sv_cheats set to 1.
env_cubemap used on world geometry without rebuilding map. . ignoring: wood/woodfloor008a
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 120 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 120 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 120 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 120 ps-combo 3
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 40 ps-combo 0
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 40 ps-combo 1
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 40 ps-combo 2
IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000000) differs from mask derived from shader name (0x0000000C) for shader ps-file flashlight_ps20b ps-index 40 ps-combo 3
'cfg/motd.txt' not found; not loaded
'cfg/motd_text.txt' not found; not loaded
Requesting texture value from var "$basetexture" which is not a texture value (material: skybox/sky_day01_05rt)
Requesting texture value from var "$basetexture" which is not a texture value (material: skybox/sky_day01_05bk)
Requesting texture value from var "$basetexture" which is not a texture value (material: skybox/sky_day01_05lf)
Requesting texture value from var "$basetexture" which is not a texture value (material: skybox/sky_day01_05ft)
Warning: using WorldTwoTextureBlend on a non-displacement surface.
Support for this will go away soon.
   - Material       : nature/blenddirtgrass008b
   - Surface center : 3388 6249 -192
Warning: WorldTwoTextureBlend found on a non-displacement surface (material: nature/blenddirtgrass008b). This wastes perf for no benefit.
Requesting texture value from var "$basetexture" which is not a texture value (material: dev/bloomadd)
Requesting texture value from var "$basetexture" which is not a texture value (material: dev/no_pixel_write)
Requesting texture value from var "$basetexture" which is not a texture value (material: dev/lumcompare)
JOY_AXIS_X:  mapped to Turn (absolute)
JOY_AXIS_Y:  mapped to Look (absolute)
JOY_AXIS_Z:  unmapped
JOY_AXIS_R:  mapped to Forward (absolute)
JOY_AXIS_U:  mapped to Side (absolute)
JOY_AXIS_V:  unmapped
Advanced Joystick settings initialized
Redownloading all lightmaps
m_face->glyph->bitmap.width is 0 for ch:32 Arial
m_face->glyph->bitmap.width is 0 for ch:32 Verdana
m_face->glyph->bitmap.width is 0 for ch:32 Verdana
Dropped be8cc260c054 from server (Server shutting down)
Host_WriteConfiguration: Wrote cfg/config.cfg
Shutdown function ShutdownMixerControls() not in list!!!
Comment 11 Pavel 2013-06-20 08:05:22 CDT
I approve this bug
Comment 12 Magbed 2013-06-23 13:36:42 CDT
Same issue as described on the first report, im running a 5450HD mobility radeon.
Comment 13 pierre.boudier@amd.com 2013-06-24 17:16:52 CDT
thanks for the report; we found a regression in OGL to control the lag indeed. this will be fixed shortly.
Comment 14 christian_obst@gmx.de 2013-07-07 15:53:05 CDT
Thanks! Will it come with the next beta or release version? When will that be (if possible to say)?
Comment 15 f.volejnik 2013-08-03 06:15:30 CDT
Latest beta (13.8) seems to gave fixed this, thank you
Comment 17 christian_obst@gmx.de 2013-08-03 17:24:39 CDT
Not to mention the permission problem, which only allows root to access 3D capabilities (also mentioned in one of the threads posted by Tomasz). I would post some error messages, but I just downgraded back to 13.6_beta2, and one would have to open a seperate bug report for that, anyway.
Comment 18 christian_obst@gmx.de 2013-08-03 17:26:52 CDT
Sorry, the error has been provided here:

http://phoronix.com/forums/showthread.php?82948-AMD-Catalyst-13-8-Beta-Driver-For-Linux-Released&p=347996#post347996
Comment 19 f.volejnik 2013-10-07 15:33:52 CDT
I see the situation somewhat improved with 13.10 beta, good. Anyway I still have to report the lag/stutter is still there, noticeable, although not as profound as before.

It would seem the core issue remains the same, just the hard limits were pushed somehow.

I have a "humble" request, thus - could you please implement a way to force the driver to flush on 2(or N for that matter) frame basis? I would be totally glad for a kernel parameter that'd force the driver to flush first frame on the end of the second, etc.

Via my wrapper, the games are forced to behave as they should, with only a little penalty, but some of applications just fail to work with the preload wrapper (it's far from bulletproof). Having a in-driver feature to force the frame fencing would be great.


These are the notable strings from glxinfo, just for reference:

OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 6700 Series 
OpenGL core profile version string: 4.3.12443 Core Profile Context 8.961
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
Comment 20 pierre.boudier@amd.com 2013-10-07 15:43:27 CDT

(In reply to comment #19)
> I have a "humble" request, thus - could you please implement a way to force
> the driver to flush on 2(or N for that matter) frame basis? I would be
> totally glad for a kernel parameter that'd force the driver to flush first
> frame on the end of the second, etc.

the driver already has a limit of 3 frames (which is what was "disabled" for some reason). this is handled by the OpenGL driver directly, not the kernel.
Comment 21 f.volejnik 2013-10-07 16:27:42 CDT
Understood, thanks for the prompt reply.

From what I experience the issue is present in the beta - the occasional flushes that make the process stall for a split second, then the lag in the meantime.

I just tested the hl2 (namely counter strike: source) with the glsync preload and without. The preload stabilises the experience - makes it fluid, without hiccups. Without, the aforementioned symptoms arise. 

From the frequency of the stutters (optically ~2-3 times per second at maximum) I gather the time interval of the flushes is ~330-500 ms. The framerate reported is >55 FPS (i.e. 18ms in the worst case). Thus calculating in the worst combination (stutter-stutter delay) I get the max of 18-27 frames of frame latency.

I'll gladly run any tests you throw at me, if you'd need that.
Comment 22 christian_obst@gmx.de 2013-10-07 16:36:30 CDT
How did you start hl2 with the wrapper? I tried that a few month ago, but it didn't work. Have you worked on the wrapper in the meantime?
Comment 23 pierre.boudier@amd.com 2013-10-07 16:51:39 CDT
this may be a different issue than frame lag. usually, a large stutter happens because of resource management operation.

can you try to run in two different conditions:
- with lots of windows opened before/during game
- with no windows opened before/during game
?

if that was the issue, I would expect that you would see more stutters in the first case.
Comment 24 Frederik vom Hofe 2013-10-08 12:50:36 CDT
I noticed that there are extreme sync issues on linux if vsync is enabled.
I made a very simple test where I render one single polygon. With vsync enabled I get like 1-2 Second input lag! glFinish or fences won't make a difference.

Running some brute force performance test on pixel shaders (just a simple redraw loop in one frame) I also noticed memory bandwidth saturation causes input lag even when the frame rate is still good (60-120 fps). This I also observe in games on windows that run on direct3d with other radeon cards. For example with the 5770 in farcry3 with high msaa. It looks like something not related, but who knows.

Currently running 7870 with Catalyst 13.4 on Xubuntu.
Comment 25 Dennis Martin Herbers 2013-10-08 13:08:24 CDT
This has nothing to do with Linux, it is a problem with the OpenGL driver.

You can try Unigine Heaven (free camera mode) on Windows. If you launch it with the OpenGL render, you will notice the same input lag on Windows. Try walking and looking around, it is a nightmare even with 40 FPS (HD 6870). With DirectX 11 render, about the same FPS but no input lag whatsoever.

Valve is aware of this problem and "gl_finish 1" in console fixes it for games like Team Fortress 2 (Source Engine). Input lag then is completely gone, although FPS are not as good as running Windows/DirectX.

This horrible input lag is exactly the same as it was half a year ago and makes AMD cards basicly useless for demanding OpenGL games with Catalyst. The open source drivers have lower FPS but have no input lag and are a lot more useable for Source engine-based games.
Comment 26 f.volejnik 2013-10-08 13:20:27 CDT
Created attachment 847 [details]
CS:S Linux openGL frame times

This is a recording of frame times (time from one end of glxSwapBuffers to the end of the next one) on linux counter strike: source. A repetitive "flush" frame that takes ~10 times the time of the other frames is clearly noticeable.
Comment 27 f.volejnik 2013-10-08 13:42:27 CDT
While looking at the data I also noticed that there are three levels of frame time - low (~4 msec), medium (~20 msec), high (~120 msec). 

The low frames are consecutive to the high ones.

Pure Speculation:

Low time frames seem as if the glxSwapBuffers would not block at all. 

Then the glxSwapBuffers starts blocking - and I think it tries to block with some kind of heuristic in place, but if there is one, then it constantly undershoots.

This gets as far as there are N frames buffered. This hard-blocks the glxSwapBuffers totally (as glFinish would do). This probably flushes all the pending frames. From the delay it seems to flush around 5-8 frames.

The cycle then continues anew...
Comment 28 f.volejnik 2013-10-08 13:52:32 CDT
Sorry for the numerous posts.

Mr. Boudier, I just tested the game as you requested - once with many windows open, once nearly clean session. No difference noticeable.
Comment 29 pierre.boudier@amd.com 2013-10-08 17:00:50 CDT
the driver does not work at all this way.

rendering commands are packed into command buffers which are regularly sent to the GPU (typically multiple times per frame). we have as well a queue of N fences for swaps, and will wait for the most ancient fence before enqueuing the next swap.

the regression (only on linux) was that the stall on the fence was removed, but that has been fixed in the latest beta (I don't know why our website has a delta for non beta driver for windows/linux).

a behavior where you would still a significant stall every N frames seems to indicate that some resource is running out indeed, and something is stalling the system.

PS: for Dennis, the microsoft OS has a hard limit  about the maximum frame latency which the driver (DX or OGL) can't really bypass, so if you experience much higher latency in OGL versus DX, there must be something else going on.
Comment 30 Frederik vom Hofe 2013-10-09 08:31:49 CDT
This extreme input lag with enabled vsync is still present in the 13.11 Beta V1
Comment 31 Dennis Martin Herbers 2013-10-25 20:21:28 CDT
AMD Catalyst 13.11 Beta 6 seems to have a *dramatic* improvements to OpenGL performance and input latency for me (Source-based Games) (HD 6870). Fantastic!!

Sometimes there is still the odd frame-skip or whatever which should not happen but it is tolerable and not nearly as bad as before.

Unigine Heaven 4.0 on Linux is now even slower (half the performance, unusable), but I don't care, maybe Unigine messed up somewhere.
Comment 32 Vi0L0 2013-10-26 07:49:37 CDT
13.11 beta 6 fixed bug here.
Comment 33 Dennis Martin Herbers 2013-10-26 08:12:15 CDT
Did some more testing and input lag is definitly mostly gone. I found some minor cases where it still applied (flashlight in L4D2/HL2 can make things worse), but it's completely usable now. Two people on the Steam Forums and on Phoronix confirmed they also see improvements. Good job, AMD!

AntiAliasing penalty is still too high (half the performance with 2x MSAA already?), but that's unrelated to this bug here.
Comment 34 Frederik vom Hofe 2013-10-26 11:10:29 CDT
The 13.11 beta6 brings no changes for me.
In my simple test cases I have the same ~1Sec. lag if vsync is enabled. glFinish and fences still make no difference.
Comment 35 Michael Cronenworth 2014-03-18 23:22:05 CDT
This message is a reminder that your bug is marked as Catalyst 13.4.

The current legacy Catalyst version is 13.1.
The current Catalyst version is 13.12.
The current Catalyst beta version is 14.2.

Approximately 7 days from now the Bugzilla administrator will be removing the 13.4 version. At that time your bug will be CLOSED as WONTFIX.

Bug Reporter: Thank you for reporting this issue. However, the Bugzilla administrator provides this as a unofficial, free service to AMD customers, and I like to keep my systems neat and tidy. If you would like to keep your bug from being closed, please try a new Catalyst version and update the 'version' field if the issue still occurs.

If you are unable to update the version, please make a comment and someone will change it for you.
Comment 36 Michael Cronenworth 2014-03-31 12:12:48 CDT
This bug is being closed due to the 'version' being 13.4 after 13 days of the previous closure notice.

Thank you for your bug report.