Bug 72893 - OUT_OF_MEMORY error with maximum size mipmapped depth texture
Summary: OUT_OF_MEMORY error with maximum size mipmapped depth texture
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-20 00:01 UTC by Anuj Phogat
Modified: 2016-11-03 21:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Piglit patch to reproduce the error (2.27 KB, patch)
2013-12-20 00:13 UTC, Anuj Phogat
Details | Splinter Review

Description Anuj Phogat 2013-12-20 00:01:24 UTC
Failure is observed in Khronos' OpenGL CTS test depth_texture_mipmap.test on IVB. I haven't tested on other intel platforms. Test passes on proprietary linux drivers of NVIDIA and AMD. 

Driver fails to map texture memory for a texture with target= GL_TEXTURE_2D, width=8192, height=8192, internalformat = {GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT32} and GL_TEXTURE_MIN_FILTER = GL_NEAREST_MIPMAP_LINEAR.

intel_miptree_map_gtt() => drm_intel_gem_bo_map_gtt( ) => drmIoctl() returns -1 strerror(errno) = 0x3e36b7b117 "Argument list too long"
dstMap = 0x0 in store_texsubimage(), which results in error "GL_OUT_OF_MEMORY in glTexSubImage".

OUT_OF_MEMORY error can be easily reproduced by doing minor modifications to max-texture-size.c piglit test. I will later attach the patch to make these changes. 

stacktrace:
#0  map_gtt (bo=0xc3ff90) at intel_bufmgr_gem.c:1249
#1  0x00007ffff6d19bc2 in drm_intel_gem_bo_map_gtt (bo=0xc3ff90) at intel_bufmgr_gem.c:1288
#2  0x00007ffff66a28a9 in intel_miptree_map_raw (brw=0x7ffff62c1040, mt=0xc3fce0) at intel_mipmap_tree.c:1713
#3  0x00007ffff66a298e in intel_miptree_map_gtt (brw=0x7ffff62c1040, mt=0xc3fce0, map=0x8f16f0,	level=0, slice=0) at intel_mipmap_tree.c:1747
#4  0x00007ffff66a4293 in intel_miptree_map_singlesample (brw=0x7ffff62c1040, mt=0xc3fce0, level=0, slice=0, x=0, y=0, w=8192, h=8192, mode=6, out_ptr=0x7fffffffd9b0, out_stride=0x7fffffffd9ac)
    at intel_mipmap_tree.c:2286
#5  0x00007ffff66a47cd in intel_miptree_map (brw=0x7ffff62c1040, mt=0xc3fce0, level=0, slice=0,	x=0, y=0, w=8192, h=8192, mode=6, out_ptr=0x7fffffffd9b0, out_stride=0x7fffffffd9ac)
    at intel_mipmap_tree.c:2431
#6  0x00007ffff66ab0dc in intel_map_texture_image (ctx=0x7ffff62c1040, tex_image=0xc4adb0, slice=0, x=0, y=0, w=8192, h=8192, mode=6, map=0x7fffffffd9b0, stride=0x7fffffffd9ac) at intel_tex.c:222
#7  0x00007ffff648edee in store_texsubimage (ctx=0x7ffff62c1040, texImage=0xc4adb0, xoffset=0, yoffset=0, zoffset=0, width=8192, height=8192, depth=1, format=6402, type=5126, 
    pixels=0x7fffb4f68010, packing=0x7ffff62d0230, caller=0x7ffff67aa802 "glTexImage") at main/texstore.c:4015
#8  0x00007ffff648effc in _mesa_store_teximage (ctx=0x7ffff62c1040, dims=2, texImage=0xc4adb0, format=6402, type=5126, pixels=0x7fffb4f68010, packing=0x7ffff62d0230) at main/texstore.c:4071
#9  0x00007ffff66abe5c in intelTexImage (ctx=0x7ffff62c1040, dims=2, texImage=0xc4adb0,	format=6402, type=5126,	pixels=0x7fffb4f68010, unpack=0x7ffff62d0230) at intel_tex_image.c:198
#10 0x00007ffff647624b in teximage (ctx=0x7ffff62c1040,	compressed=0 '\000', dims=2, target=3553, level=0, internalFormat=33190, width=8192, height=8192, depth=1, border=0, format=6402, type=5126, 
    imageSize=0, pixels=0x7fffb4f68010)	at main/teximage.c:3128
#11 0x00007ffff64763e1 in _mesa_TexImage2D (target=3553, level=0, internalFormat=33190,	width=8192, height=8192, border=0, format=6402,	type=5126, pixels=0x7fffb4f68010) at main/teximage.c:3167
#12 0x00007ffff7d4f799 in stub_glTexImage2D (target=3553, level=0, internalformat=33190, width=8192, height=8192, border=0, format=6402, type=5126, pixels=0x7fffb4f68010)
Comment 1 Anuj Phogat 2013-12-20 00:13:15 UTC
Created attachment 91011 [details] [review]
Piglit patch to reproduce the error

A quick way to reproduce the OUT_OF_MEMORY error using an existing piglit test. I'll later send out a non-hacky version of this patch to piglit mailing list.
Comment 2 Anuj Phogat 2014-01-08 02:07:11 UTC
I realized that OUT_OF_MEMORY error was generated only with this patch:
http://lists.freedesktop.org/archives/mesa-dev/2013-December/050312.html
An updated version of the patch is now on mesa-dev mailing list which makes it irrelevant for this bug.

Now the real issue here is an assertion failure in depth_texture_mipmap.test:
intel_mipmap_tree.c:2283: intel_miptree_map_singlesample: Assertion `mt->region->pitch < 32768' failed.

This failure can be reproduced using piglit patch posted in comment 1. Sorry for posting incorrect information in bug's description.
Comment 3 Anuj Phogat 2014-02-13 18:40:55 UTC
It seems like other drivers are also facing OUT_OF_MEMORY error with max size mipmapped depth texture test.There is a related khronos CTS bug for the failing test case: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=11440
Comment 4 Matt Turner 2016-11-03 02:26:51 UTC
(In reply to Anuj Phogat from comment #3)
> It seems like other drivers are also facing OUT_OF_MEMORY error with max
> size mipmapped depth texture test.There is a related khronos CTS bug for the
> failing test case: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=11440

That bug is now fixed with a change to the test. Is there anything to do for this bug?
Comment 5 Anuj Phogat 2016-11-03 16:55:03 UTC
There is nothing left to be fixed here. Assertion failure is fixed by Mesa commit  b3094d9 and the CTS test is fixed too. I'll mark the bug resolved.


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.