Bug 26850

Summary: [i5 Clarkdale, Intel Graphics HD] Too low OpenGL performance
Product: Mesa Reporter: Artem S. Tashkinov <aros>
Component: Drivers/DRI/i965Assignee: Eric Anholt <eric>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: low CC: jbarnes
Version: unspecifiedKeywords: NEEDINFO
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Xorg.0.log
dmesg with drm.debug=0x04
Quake 3 screenshot at 640x480 showing 60FPS limit
q3config.cfg for 1600x1200 desktop resolution with FPS < 35
Entire /sys/kernel/debug/dri/*

Description Artem S. Tashkinov 2010-03-02 16:04:45 UTC
Created attachment 33701 [details]
Xorg.0.log

Quake 3 is unplayable at any resolution, glxgears show very terrible results:

00:02.0 VGA compatible controller [0300]: Intel Corporation Auburndale/Havendale Integrated Graphics Controller [8086:0042] (rev 12)

glxgears
3459 frames in 5.0 seconds = 691.785 FPS

Distro: Fedora 12 i686 with all updates installed

glxinfo
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control,
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_make_current_read,
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) IGDNG_D GEM 20091221 2009Q4
OpenGL version string: 2.1 Mesa 7.7.1-DEVEL
OpenGL shading language version string: 1.20
OpenGL extensions:

Kernel: 2.6.33 vanilla
xorg-x11-drv-intel-2.9.1-1.fc12.i686
xorg-x11-server-1.7.5-1.fc12.i686

_____________________________________________________________________________
[birdie@localhost ~]$ export LIBGL_DEBUG=verbose
[birdie@localhost ~]$ quake3
Q3 1.32b linux-i386 Nov 14 2002

...loading libGL.so.1: Initializing OpenGL display
...setting mode 9: 1600 1200
Using XFree86-VidModeExtension Version 2.2
XF86DGA Mouse (Version 2.0) initialized
XFree86-VidModeExtension Activated at 1600x1200
libGL: OpenDriver: trying /usr/lib/dri/i965_dri.so
Using 8/8/8 Color bits, 24 depth, 0 stencil display.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/birdie/.drirc: No such file or directory.
GL_RENDERER: Mesa DRI Intel(R) IGDNG_D GEM 20091221 2009Q4
Initializing OpenGL extensions
...GL_S3_s3tc not found
...ignoring GL_EXT_texture_env_add
...using GL_ARB_multitexture
...using GL_EXT_compiled_vertex_array
XF86 Gamma extension initialized

GL_VENDOR: Tungsten Graphics, Inc
GL_RENDERER: Mesa DRI Intel(R) IGDNG_D GEM 20091221 2009Q4
GL_VERSION: 2.1 Mesa 7.7.1-DEVEL
GL_EXTENSIONS: GL_ARB_copy_buffer GL_ARB_depth_texture GL_ARB_depth_clamp GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_half_float_pixel GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shading_language_120 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_logic_op GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_cull_vertex GL_EXT_compiled_vertex_array GL_EXT_copy_texture GL_EXT_draw_range_elements GL_EXT_framebuffer_blit GL_EXT_framebuffer_object GL_EXT_fog_coord GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texture GL_EXT_texture3D GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_swizzle GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_3DFX_texture_compression_FXT1 GL_APPLE_client_storage GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ATI_blend_equation_separate GL_ATI_envmap_bumpmap GL_ATI_texture_env_combine3 GL_ATI_separate_stencil GL_IBM_multimode_draw_arrays GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_INGR_blend_func_separate GL_MESA_pack_invert GL_MESA_texture_signed_rgba GL_MESA_ycbcr_texture GL_MESA_window_pos GL_NV_blend_square GL_NV_depth_clamp GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_texgen_reflection GL_NV_vertex_program GL_NV_vertex_program1_1 GL_OES_read_format GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays
GL_MAX_TEXTURE_SIZE: 4096
GL_MAX_ACTIVE_TEXTURES_ARB: 8

PIXELFORMAT: color(24-bits) Z(24-bit) stencil(0-bits)
MODE: 9, 1600 x 1200 fullscreen hz:N/A
GAMMA: hardware w/ 0 overbright bits
CPU:
rendering primitives: single glDrawElements
texturemode: GL_LINEAR_MIPMAP_NEAREST
Comment 1 Artem S. Tashkinov 2010-03-02 16:44:10 UTC
Hm, I've discovered some drm messages:

Mar  3 02:47:38 localhost kernel: [    0.000000] Kernel command line: root=/dev/sda2 ro reboot=warm noexec=off vga=0x314 drm.debug=0x06
Mar  3 02:47:38 localhost kernel: [   13.685785] [drm] Initialized drm 1.1.0 20060810
Mar  3 02:47:38 localhost kernel: [   13.754462] [drm] MTRR allocation failed.  Graphics performance may suffer.
Mar  3 02:47:38 localhost kernel: [   13.754565] [drm] set up 127M of stolen space
Mar  3 02:47:38 localhost kernel: [   14.135180] fb: conflicting fb hw usage inteldrmfb vs VESA VGA - removing generic driver
Mar  3 02:47:38 localhost kernel: [   14.461449] fb0: inteldrmfb frame buffer device
Mar  3 02:47:38 localhost kernel: [   14.461482] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
Mar  3 02:47:41 localhost kernel: [   20.803413] [drm:i915_gem_madvise_ioctl] *ERROR* Attempted i915_gem_madvise_ioctl() on a pinned object
Mar  3 05:23:24 localhost kernel: [ 9359.280471] [drm:i915_gem_madvise_ioctl] *ERROR* Attempted i915_gem_madvise_ioctl() on a pinned object
Comment 2 Artem S. Tashkinov 2010-03-02 17:33:24 UTC
A relevant kernel bug is filed here http://bugzilla.kernel.org/show_bug.cgi?id=15431
Comment 3 Artem S. Tashkinov 2010-03-03 02:51:43 UTC
I have eliminated the MTTR error message by adding these options to my kernel configuration:

CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1

However OpenGL performance is still unsatisfactory (probably up to 3-5 times slower than in Windows XP SP3):

[birdie@localhost ~]$ glxgears
4044 frames in 5.0 seconds = 808.746 FPS
4012 frames in 5.0 seconds = 802.318 FPS

Please, advise how OpenGL performance can be improved.
Comment 4 Eric Anholt 2010-03-03 10:27:58 UTC
The only issue with your glxgears numbers is that they're not pinned to your vertical refresh rate.  Updating the graphics stack to master should fix that.  glxgears is not a benchmark.

Sounds like you don't have PAT enabled in your kernel?  You should fix that, because then you don't rely on MTRRs

I have no idea what your criteria are for "unplayable" or what framerates you got, so it's hard to do anything with this bug.  You'll probably want to do some investigation of why openarena is slow.  Info is at http://dri.freedesktop.org/wiki/IntelPerformanceTuning
Comment 5 Artem S. Tashkinov 2010-03-03 10:57:58 UTC
Created attachment 33732 [details]
dmesg with drm.debug=0x04

Well, with all settings set to maximum I can play Quake 3 in Windows and FPS keeps steadily around 100FPS.

On Linux with the same settings i get around 50FPS at best and quite often FPS falls below 20, the movement becomes jerky and it's getting really hard to play because the game doesn't follow your mouse movements.

In both Linux and Windows I have the resolution of Quake 3 set to 1600x1200 with 32 bit depth, 32 bit textures, texture and geometric details set to maximum.

PAT is enabled here:

CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y

from dmesg:
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
[    0.000000] MTRR variable ranges enabled:
[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[    0.000000] original variable MTRRs
[    0.000000] Found optimal setting for mtrr clean up
[    0.000000] New variable MTRRs
Comment 6 Sven Arvidsson 2010-03-05 06:41:12 UTC
On my G45 I have the same MTRR error and work around it by booting with  "enable_mtrr_cleanup mtrr_spare_reg_nr=1"

CONFIG_X86_PAT is enabled.
Comment 7 Eric Anholt 2010-03-08 16:39:35 UTC
OK, so acceleration is working, it's just not as good as you hope.  There are improvements that could be done to the driver on Ironlake for 3D games, but they aren't done yet.
Comment 8 Ian Romanick 2010-03-18 15:19:03 UTC
(In reply to comment #5)
> Well, with all settings set to maximum I can play Quake 3 in Windows and FPS
> keeps steadily around 100FPS.
> 
> On Linux with the same settings i get around 50FPS at best and quite often FPS
> falls below 20, the movement becomes jerky and it's getting really hard to play
> because the game doesn't follow your mouse movements.

Is this retail Quake3 or ioquake?  There was some recent discussion on the mesa3d-dev list about a bug in the extension detection code in Quake3 that caused it to erroneously not use some extensions.  This caused a major drop in performance.
Comment 9 Artem S. Tashkinov 2010-03-18 23:21:02 UTC
(In reply to comment #8)
> 
> Is this retail Quake3 or ioquake?  There was some recent discussion on the
> mesa3d-dev list about a bug in the extension detection code in Quake3 that
> caused it to erroneously not use some extensions.  This caused a major drop in
> performance.
> 

I'm using retail Quake 3 version, I will try ioquake3 and report the results later.
Comment 10 Artem S. Tashkinov 2010-04-28 22:41:42 UTC
ioqake3 has the same performance issue.

I may attach Windows screenshot with 100FPS and Linux screenshot with 30FPS, both of the same scene and identical settings.
Comment 11 Artem S. Tashkinov 2010-04-30 08:23:05 UTC
Created attachment 35346 [details]
Quake 3 screenshot at 640x480 showing 60FPS limit

I've noticed this bug with the Linux Intel drivers: most applications that I run have an upper 60FPS limit, probably due to this message when I run glxgears:

$ glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately 1/1936613746 the monitor refresh rate.
300 frames in 5.0 seconds = 60.000 FPS

For instance Quake 3 never goes beyond 60FPS even in 640x480 mode, that's more than weird taking into consideration that Intel Clarkdale HD GPU has approximately the same performance as NVIDIA 6800GT.

Now Phoronix has really shown that there's something inherently wrong with Linux Intel drivers: http://www.phoronix.com/scan.php?page=news_item&px=ODIwMQ

> On average, Windows 7 with the Intel driver is 10x faster than Ubuntu 10.04 with the Intel driver.
Comment 12 Eric Anholt 2010-05-13 14:36:07 UTC
Pinning to your monitor's refresh rate of 60hz is sensible behavior -- don't waste many watts of power to render indistinguishable (except for framerate number) results.

As far as the performance when below refresh rate not matching up, we've got other bugs open to track our limitations, particularly comparing nexuiz performance where we're far below Windows numbers.

Is there some other issue?  Is there something unique to quake3 (please say openarena, as it's harder to test quake3) performance?  If so, please record a demo of where the bad behavior is and attach the file so that we can see what issue you're seeing.
Comment 13 Artem S. Tashkinov 2010-06-26 11:21:34 UTC
Created attachment 36524 [details]
q3config.cfg for 1600x1200 desktop resolution with FPS < 35

OK, here's a configuration file for 11 yo game, where in 1600x1200 desktop mode you'll never get more than 35FPS and playing is excruciatingly slow.

Under Windows Q3 has no problems with the same configuration.
Comment 14 Eric Anholt 2011-01-02 15:39:20 UTC
Your dmesg indicates you don't have the intel_ips driver loaded.  That is critical for graphics performance on Ironlake.  Once you get that loaded, you should see /sys/kernel/debug/dri/0/i915_cur_delayinfo report of the current p-state lower from the maximum (9 on my system, see i915_drpc_info for limits) toward the higher-performance minimum (0 on my system, about 3x faster than 9).  Please fix your kernel and re-test.
Comment 15 Artem S. Tashkinov 2011-01-03 00:38:22 UTC
Created attachment 41579 [details]
Entire /sys/kernel/debug/dri/*

(In reply to comment #14)
> Your dmesg indicates you don't have the intel_ips driver loaded.  That is
> critical for graphics performance on Ironlake.  Once you get that loaded, you
> should see /sys/kernel/debug/dri/0/i915_cur_delayinfo report of the current
> p-state lower from the maximum (9 on my system, see i915_drpc_info for limits)
> toward the higher-performance minimum (0 on my system, about 3x faster than 9).
>  Please fix your kernel and re-test.

modprobing intel_ips made zero difference:

$ lsmod | grep intel_ips
intel_ips               8761  0

$ cat /sys/kernel/debug/dri/0/i915_drpc_info (dri/64/i915_drpc_info is the same)
HD boost: no
Boost freq: 0
HW control enabled: no
SW control enabled: no
Gated voltage change: no
Starting frequency: P0
Max P-state: P0
Min P-state: P0
RS1 VID: 0
RS2 VID: 38
Render standby enabled: yes

and Quake 3 performance hasn't changed a bit. GLXgears performance also hasn't changed a bit. I'm now attaching the entire /sys/kernel/debug/dri directory (compressed with XZ).

I'm running Fedora 14 i686, I have mesa-libGL-7.9-5.fc14.i686, kernel 2.6.37-rc8 and GIT snapshot of Intel X.org driver.
Comment 16 Jesse Barnes 2011-01-03 09:04:28 UTC
Looks like your CPU doesn't support gfx turbo, so that's probably not the issue.  Ian's suggestion sounded promising; have you looked into the mesa archives to find out which extensions should be enabled and confirm that they are on your system?  It's quite possible we just have a lot of performance work to do on our ILK GL drivers.  Hi-z is one of the big optimizations we're missing aiui, I'm not sure of its status on ILK.
Comment 17 Artem S. Tashkinov 2011-01-03 10:57:56 UTC
(In reply to comment #16)
> Looks like your CPU doesn't support gfx turbo, so that's probably not the
> issue.  Ian's suggestion sounded promising; have you looked into the mesa
> archives to find out which extensions should be enabled and confirm that they
> are on your system?  It's quite possible we just have a lot of performance work
> to do on our ILK GL drivers.  Hi-z is one of the big optimizations we're
> missing aiui, I'm not sure of its status on ILK.

You message sound absolutely cryptic to me, I just don't understand what I have to do and for what I've to look for.

Anyway I wonder if there's maybe an OpenGL profiler utility/application which can collect which calls a particular application is issuing and how much time the system spends running those calls. That can help you identify which OpenGL calls need to be improved/properly implemented.
Comment 18 Eric Anholt 2011-01-04 13:29:00 UTC
For CPU performance bottlenecks, the tool is called sysprof.   But at least on my machine, while running openarena the CPU is nearly idle.  

Have you tested against ioquake3 yet?
Comment 19 Artem S. Tashkinov 2011-01-04 14:21:32 UTC
(In reply to comment #18)
> For CPU performance bottlenecks, the tool is called sysprof.   But at least on
> my machine, while running openarena the CPU is nearly idle.  
> 
> Have you tested against ioquake3 yet?

I tested ioquake3 (1.36-8.svn1802.fc14 i686) months ago, and aside from inability to properly set ingame brightness (the game is very darkish regardless brightness settings) the FPS is just the same as in the official Quake 3 binary (1.32b).

I even tried disabling cpufreq power savings (I'm referring to still unresolved bug 30364 in Intel drivers) to no avail.
Comment 20 Artem S. Tashkinov 2012-03-12 16:22:56 UTC
I no longer own this hardware, so I have to close this bug report.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.