Bug 11131

Summary: [wine] Mesa 6.5.2/7.0.3 implementation error: i915_program_error: Exceeded max nr indirect texture lookups
Product: Mesa Reporter: Thomas Gillespie <tomjamesgillespie>
Component: Drivers/DRI/i915Assignee: haihao <haihao.xiang>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: 123johndoe321, davidthewatson, derek, diamondx, exa.exa, fade, fgouget, giacomo_succi, guillaume.melquiond, laurento.frittella, markotahal, masterxw, michael.fu, mrwaltercool, myr.jedi, mzenzes, periliocastrol, phoenixget, saulius2, Sevkme, tomwolfe
Version: 6.5   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 17865    
Bug Blocks: 16029    
Attachments: my xorg.conf file
The console output, when running half life (garrys mod) under wine
console log of steam running half life 2 on wine
my xorg.conf
Fade@EEE : Console log of wine + wow wine command line + Config.wtf
Fade@EEE : system configuration with hardinfo utility
Fade@EEE : xorg.conf
Fade@EEE : glxinfo
Fade@EEE : RPM list of the EEEDORA install on my Asus EEE PC.
Fade@EEE : Bug not occuring until the door come to view.
Fade@EEE : Buggy open GL gives us a clue about D3D crash!
console output of wine...

Description Thomas Gillespie 2007-06-03 13:33:16 UTC
Hi, i get this error when trying to run a number of games, including paintball 2, and numerous half life based games under wine. The game just closes and leaves this in the console. Paintball it seems to do it after a certain time playing, half life crashes just before the level loads (i.e. just when it starts 3d) I am running ubuntu 7.04, with an intel gma 950.

Tom
Comment 1 Thomas Gillespie 2007-06-03 13:34:40 UTC
Created attachment 10167 [details]
my xorg.conf file
Comment 2 Thomas Gillespie 2007-06-03 13:36:30 UTC
Created attachment 10168 [details]
The console output, when running half life (garrys mod) under wine
Comment 3 Roland Scheidegger 2007-07-29 09:40:29 UTC
The crashes should be fixed in git.
However, the driver will still complain, and you're going to be short lived if you play half life with swrast fallback...
Comment 4 Roland Scheidegger 2007-10-26 07:31:29 UTC
*** Bug 12957 has been marked as a duplicate of this bug. ***
Comment 5 David Watson 2007-11-01 18:42:46 UTC
I have duplicated this bug on Ubuntu 7.10 with wine-0.9.48 and Half Life 2 with the latest updates on my acer aspire 5570 2067 with intel gma 945 chipset.
Comment 6 David Watson 2007-11-01 18:46:03 UTC
Created attachment 12308 [details]
console log of steam running half life 2 on wine
Comment 7 David Watson 2007-11-01 18:47:26 UTC
Created attachment 12309 [details]
my xorg.conf
Comment 8 Ismael 2007-11-10 18:19:45 UTC
This error also appear with FlatOut2 in intel 945gm and wine 0.9.48. The same game in Nvidia 8500GT works perfect 
Comment 9 Brian Paul 2007-11-12 07:27:22 UTC
The error about exceeding the max number of indirect texture lookups indicates that a hardware limit is being hit.  A software fallback probably insn't very desirable.  I'll try to look into this someday, but there might not be a good solutions...
Comment 10 Roland Scheidegger 2007-11-12 07:45:21 UTC
(In reply to comment #9)
> The error about exceeding the max number of indirect texture lookups indicates
> that a hardware limit is being hit.  A software fallback probably insn't very
> desirable.  I'll try to look into this someday, but there might not be a good
> solutions...
In this case, it's very likely a driver limitation (since those games typically honor the indirect limit of 4 which is the same limit the r300 has, and the minimum d3d ps 2.0 mandates).
The driver counts each new texture fetch using coordinates from a temp reg as a new indirection. That's not how the spec or the chip works. Something similar to what the r300 driver does would be needed (note though that texture instructions really are explicitly different to set up on r300 compared to alu instructions, they are not on i915, the texture nodes are rather implicit and internally generated, but it doesn't really matter).
Comment 11 Michael Fu 2008-01-07 17:44:24 UTC
Is there any luck with a newer release?

unless there is freely-available software to reproduce the issue, we are unlikely be able to debug and fix this issue...
Comment 12 Thomas Gillespie 2008-01-08 09:15:55 UTC
I got the same error with paintball two after playing for about a minute or two, its freely available at http://digitalpaint.planetquake.gamespy.com/files/ if you want to try it out.

Tom
Comment 13 Mirek Kratochvil 2008-01-19 07:33:02 UTC
*** Bug 13697 has been marked as a duplicate of this bug. ***
Comment 14 Mirek Kratochvil 2008-01-19 07:44:02 UTC
OK, more info: running WoW in wine with -opengl causes this bug in 100% cases. (I have kernel 2.6.23.1, xserver 1.3.0, xfree-i810 driver 2.1.0 and all other versions I tried, Mesa 6.5.2 and 7.0.1 too, graphic card is intel945GM)

Note that running WoW with -directx is OK. (but well the rendering is _slow_)

Did anyone try to ask Intel guys about this? (if not, I'm gonna try it next week)
Did anyone try to compare Mesa to OpenGL implementation which runs on Windows? (I'm also gonna peer into it next week)

thx
[exa]
Comment 15 Michael Fu 2008-01-19 17:42:19 UTC
*** Bug 14140 has been marked as a duplicate of this bug. ***
Comment 16 Michael Fu 2008-01-19 17:43:31 UTC
Eric, we've got 3 dup bug report about this...
Comment 17 Fade 2008-02-09 11:32:19 UTC
Hi !

I try to run World Of Warcraft on EEE PC.

It works with -opengl but at a low frame rate (less than 1FPS). In -d3d, however, the application crash at the end of loading (just before entering the game and after caracter selection screen. But until it crash, I can see that the frame rate is higher than in open GL.

Here is the text:

****************************
Mesa 7.0.3 implementation error: i915_program_error: Exceeded max temporary reg
Please report at bugzilla.freedesktop.org
Mesa 7.0.3 implementation error: i915_program_error: Exceeded max nr indirect texture lookups
Please report at bugzilla.freedesktop.org
indowed: intel_batchbuffer.c:145: intel_flush_inline_primitive:  l'assertion « intel->prim.primitive != ~0 » a échoué.
fixme:dbghelp:dump_system_info fill in CPU vendorID and feature set
fixme:system:SystemParametersInfoW Unimplemented action: 113 (SPI_SETMOUSESPEED)
****************************

To help you, I'll attach some documents.
Comment 18 Fade 2008-02-09 11:37:41 UTC
Created attachment 14244 [details]
Fade@EEE : Console log of wine + wow wine command line + Config.wtf
Comment 19 Fade 2008-02-09 11:38:51 UTC
Created attachment 14245 [details]
Fade@EEE : system configuration with hardinfo utility
Comment 20 Fade 2008-02-09 11:40:24 UTC
Created attachment 14246 [details]
Fade@EEE : xorg.conf
Comment 21 Fade 2008-02-09 11:41:45 UTC
Created attachment 14247 [details]
Fade@EEE : glxinfo
Comment 22 Fade 2008-02-09 11:45:04 UTC
Created attachment 14249 [details]
Fade@EEE : RPM list of the EEEDORA install on my Asus EEE PC.
Comment 23 Fade 2008-02-09 11:56:40 UTC
Comment on attachment 14245 [details]
Fade@EEE : system configuration with hardinfo utility

This report says that my Celeron runs at 900MHz but it's false. My EEE isn't overclocked so it runs at 630MHz.
Comment 24 Fade 2008-02-10 09:38:49 UTC
Created attachment 14260 [details]
Fade@EEE : Bug not occuring until the door come to view.

While loading NPC are textured but quick become white. WoW donesn't hang until I move the POV to see the open door (I can't see it, program hang just before).
Comment 25 Mirek Kratochvil 2008-02-10 11:30:47 UTC
> While loading NPC are textured but quick become white. WoW donesn't hang until
> I move the POV to see the open door (I can't see it, program hang just before).

You have a good point, this probably leads to blaming stencil buffer operations and/or some other kind of hidden surface culling. Maybe we could ask WoW devs about that.
Comment 26 Fade 2008-02-11 04:55:57 UTC
The crash occure if I turn to see the door or if I walk backward through the door, looking at the wall.
Comment 27 Pablo Cholaky 2008-02-11 08:00:53 UTC
(In reply to comment #23)
> (From update of attachment 14245 [details])
> This report says that my Celeron runs at 900MHz but it's false. My EEE isn't
> overclocked so it runs at 630MHz.
> 


I have it normal clocked (at 900 Mhz, you have it underclocked, EEE comes underclocked by factory)

And same problem.
Comment 28 Fade 2008-02-14 11:48:09 UTC
Created attachment 14314 [details]
Fade@EEE : Buggy open GL gives us a clue about D3D crash!

A) I can move around in the little house, the background stays black.

B) As soon as I can see the door, the background becomes lighter. At this point the -d3d wow crashs.

C) The background stays light, even if I return in my first position.
Comment 29 Don Park 2008-03-15 13:46:44 UTC
Mesa 7.0.3-rc2 implementation error: i915_program_error: Exceeded max nr indirect texture lookups
Please report at bugzilla.freedesktop.org
DRM_I830_CMDBUFFER: -22

this is trying to start World of Warcraft with wine 0.9.57 on Ubuntu Hardy Heron (alpha 6)

installed mesa libs
ii  libgl1-mesa-dri      7.0.3~rc2-1ubuntu2   A free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-glx      7.0.3~rc2-1ubuntu2   A free implementation of the OpenGL API -- GLX runtime
ii  libglu1-mesa         7.0.3~rc2-1ubuntu2   The OpenGL utility library (GLU)
ii  mesa-utils           7.0.3~rc2-1ubuntu2   Miscellaneous Mesa GL utilities

video card from lspci
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 02)

Comment 30 Bryce Harrington 2008-04-08 13:56:20 UTC
Eric/Brian, if the max nr indirect texture lookups is a hardware specific thing, is there a mechanism for quirking particular cards?  I hear the 945/G33 can support > 4, so am wondering if we could override I915_MAX_TEX_INDIRECT (or whatever) on a per-pciid basis?
Comment 31 Adam Bittner 2008-06-19 21:42:10 UTC
Trying to run Star Wars Republic Commando in wine 1.0.0 on Ubuntu 7.10 with an Intel 915GM graphics card, mesa 7.0.1

a demo version is available at http://www.gamershell.com/download_8203.shtml

I am downloading the demo now to make sure I get the same error...
Comment 32 Adam Bittner 2008-06-19 21:46:02 UTC
*** Bug 13806 has been marked as a duplicate of this bug. ***
Comment 33 Adam Bittner 2008-06-19 21:55:00 UTC
*** Bug 16070 has been marked as a duplicate of this bug. ***
Comment 34 Adam Bittner 2008-06-24 20:44:03 UTC
(In reply to comment #31)
> Trying to run Star Wars Republic Commando in wine 1.0.0 on Ubuntu 7.10 with an
> Intel 915GM graphics card, mesa 7.0.1
> 
> a demo version is available at http://www.gamershell.com/download_8203.shtml
> 
> I am downloading the demo now to make sure I get the same error...
> 

I could not get the demo to run in wine, so I don't know if I would have gotten the i915_program_error or not.
Comment 35 mzenzes 2008-07-06 08:41:00 UTC
Same problem with wine1.0, "Civilization4 - Beyond The Sword".
The program crashes after loading a game, when it tries to display the (3D) landscape.

--------snip--------
fixme:d3d:IWineD3DDeviceImpl_EvictManagedResources (0x1e67f0) : stub
fixme:d3d:IWineD3DDeviceImpl_EvictManagedResources (0x1e67f0) : stub
Mesa 7.0.3-rc2 implementation error: i915_program_error: Exceeded max nr indirect texture lookups
Please report at bugzilla.freedesktop.org
intel_batchbuffer.c:145: intel_flush_inline_primitive: Assertion `intel->prim.primitive != ~0' failed.
wine: Assertion failed at address 0xb7fde410 (thread 0009), starting debugger...
--------snip--------

Any hints?
Comment 36 mzenzes 2008-07-06 08:42:20 UTC
Created attachment 17553 [details]
console output of wine...
Comment 37 haihao 2008-07-10 22:12:57 UTC
*** Bug 16670 has been marked as a duplicate of this bug. ***
Comment 38 John 2008-07-23 14:02:23 UTC
I am getting the same crashes with Civilization 4 patched to version 1.74.:

"Mesa 7.0.3 implementation error: i915_program_error: Exceeded max nr indirect texture lookups
Please report at bugzilla.freedesktop.org
er/Application Data/Firaxis Games/Sid Meier's Civilization 4/Civilization4: intel_batchbuffer.c:145: intel_flush_inline_primitive: Assertion `intel->prim.primitive != ~0' failed.

[...]

Backtrace:
=>1 0xffffe430 (0x0032ecf8)
  2 0xb7d16238 abort+0x188() in libc.so.6 (0x0032ee20)
  3 0xb7d0d70e __assert_fail+0xee() in libc.so.6 (0x0032ee64)
  4 0x7d852038 in i915_dri.so (+0x25038) (0x0032eea4)
  5 0x7d8524cb intelWrapInlinePrimitive+0x2b() in i915_dri.so (0x0032eec4)
  6 0x7d874588 in i915_dri.so (+0x47588) (0x0032eef4)
[...]
"

lspci output:
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
Comment 39 John 2008-07-24 03:56:04 UTC
Just for adding more detail to this bug: I've found that disabling vertex shaders in Wine allows me to run Civilization 4 flawlessly without triggering the texture lookup bug.
Comment 40 mzenzes 2008-07-24 04:47:27 UTC
Confirming the "work around". But this leaves the game with unplayable performance...

Btw: lspci...
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
Comment 41 John 2008-08-04 16:45:35 UTC
@Adam Bittner:
Please try the Civilization 4 demo, e.g. from here:
http://www.fileplanet.com/158817/150000/fileinfo/Civilization-4-Demo
(Before running the demo, make sure to set your Wine installation to use the native msxml3.dll delivered with Wine and also copy the native d3dx9_31.dll, _32, and _36.dlls from a Windows installation or the Internet into Wine's windows/system32 folder).


Also, could someone please post a patch that affected users could at least apply on their own as long as a general fix appears to be out of reach?
Comment 42 Michael Fu 2008-08-06 22:30:01 UTC
*** Bug 17019 has been marked as a duplicate of this bug. ***
Comment 43 J K 2008-09-04 11:32:09 UTC
I'm running Ubuntu 8.04.1 with all updates, Wine 1.0, P4, Intel915 IG;

This occurs when running World of Warcraft from the command: wine wow -opengl

fixme:win:EnumDisplayDevicesW ((null),0,0x32eda4,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32ec94,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f42c,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f5a8,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f5a0,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f57c,0x00000000), stub!
fixme:d3d:WineD3D_ChoosePixelFormat Add OpenGL context recreation support to SetDepthStencilSurface
err:d3d:WineD3D_ChoosePixelFormat Can't find a suitable iPixelFormat
fixme:d3d:WineD3D_ChoosePixelFormat Add OpenGL context recreation support to SetDepthStencilSurface
fixme:d3d9:IDirect3DDevice9Impl_CreateQuery (0x138718) call to IWineD3DDevice_CreateQuery failed
fixme:d3d:IWineD3DDeviceImpl_CreateQuery (0x137640) Event query: Unimplemented, but pretending to be supported
fixme:win:EnumDisplayDevicesW ((null),0,0x32f144,0x00000000), stub!
fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_CONNECT_TIMEOUT (5000): STUB
fixme:wininet:InternetSetOptionW INTERNET_OPTION_SEND/RECEIVE_TIMEOUT
fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_CONNECT_TIMEOUT (5000): STUB
fixme:wininet:InternetSetOptionW INTERNET_OPTION_SEND/RECEIVE_TIMEOUT
fixme:reg:GetNativeSystemInfo (0x37402f24) using GetSystemInfo()
fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_CONTEXT_VALUE; STUB
fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_CONTEXT_VALUE; STUB
fixme:imm:ImmReleaseContext (0x20024, 0x136440): stub
fixme:winsock:WSAIoctl unsupported WS_IOCTL cmd (9800000c)
fixme:win:EnumDisplayDevicesW ((null),0,0x32d194,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32d200,0x00000000), stub!
Mesa 7.0.3-rc2 implementation error: i915_program_error: Exceeded max nr indirect texture lookups
Please report at bugzilla.freedesktop.org
DRM_I830_CMDBUFFER: -22
Comment 44 Eric Anholt 2008-10-05 00:19:26 UTC
This may be fixed in mesa master from the #17865 fix.  (If not, individual bugs per broken application would be useful)
Comment 45 haihao 2008-10-15 19:41:44 UTC
*** Bug 18074 has been marked as a duplicate of this bug. ***
Comment 46 haihao 2008-10-15 19:46:26 UTC
Hi, 
  Could you try Eric's fix
commit 91d0020eecb78ef2984fd0afafc5d555c0e957d8
Author: Eric Anholt <eric@anholt.net>
Date:   Sat Oct 4 18:20:35 2008 -0700

    i915: Refine the texture indirect lookup accounting.

If it works, I will close this bug.
Comment 47 David Flatz 2008-11-12 05:04:43 UTC
Hi.

I just applied the patch suggested in Comment #46.

I now get the same error message as in bug 18074 (Exceeded max temporary reg).

I'm running wine 1.1.7 with mesa 7.2 plus that patch.
Comment 48 Eric Anholt 2008-12-19 16:13:30 UTC
One reporter acked that the patch fixed it for him, at least.
Comment 49 Adam Bittner 2008-12-20 09:55:42 UTC
Could someone please explain or point me to a guide of how to update my intel driver? I'm running ubuntu 8.04.1.
Thank you
Comment 50 Francois Gouget 2009-04-23 08:00:58 UTC
*** Bug 21355 has been marked as a duplicate of this bug. ***
Comment 51 marek 2010-12-21 00:31:02 UTC
Hi, 
shall I reopen the bug? 
I have very much same symptoms: 
$ MESA_DEBUG=verbose braid -windowed -half
Mesa: User error: GL_INVALID_OPERATION in glProgramStringARB(invalid ARB fragment program option)

Mesa: 19 similar GL_INVALID_OPERATION errors
Mesa: User error: GL_INVALID_VALUE in glDrawBuffersARB(n)
i915_program_error: Exceeded max nr indirect texture lookups (8 out of 4)
i915_program_error: Exceeded max nr indirect texture lookups (8 out of 4)
i915_program_error: Exceeded max ALU instructions (83 out of 64)


intel gma945, intel atom, kernel 2.6.36, archlinux testing, 
testing/intel-dri 7.9.99.git20101217-1 [8.87 M]
    Mesa DRI drivers for Intel
testing/libgl 7.9.99.git20101217-1 [2.94 M]
    Mesa 3-D graphics library and DRI software rasterizer


Bug details and other users' comments are described in this bug: 
https://bugs.freedesktop.org/show_bug.cgi?id=32447

Thank you, Marek
Comment 52 Eric Anholt 2011-07-13 10:36:26 UTC
We had a report that this has been fixed in one application, which was about actually counting the maximum indirections correctly.  I'm regarding that thing as fixed.

This error message comes from a class of failures related to either 1) applications trying to use more than the hardware can do. or 2) the driver failing at optimizing to make what the application asked for fit in the limits.

If you've still got this message, we'll be fixing it by looking at an application at a time.  So, if you want your application fixed, open your own bug report, with the application in the subject.  It's also more likely to get fixed if you've got something native to linux, or at least freely available with instructions on installing it.

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.