Bug 99108 - WebGL conformance/textures/misc/texture-size-limit.html fails
Summary: WebGL conformance/textures/misc/texture-size-limit.html fails
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-16 12:23 UTC by xinghua
Modified: 2019-09-25 18:59 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xinghua 2016-12-16 12:23:33 UTC
Desktop: BroadWell+ Ubuntu16.04
Steps:
1. Install latest unstable google chrome, details:
   add "deb http://dl.google.com/linux/chrome/deb/ stable main" to your computer software source list(/etc/apt/sources.list).
   sudo apt-get update
   sudo apt-get install google-chrome-unstable

2. Run chrome in the terminal, you can specify the latest TOT Mesa driver and run with some options,
   [LD_LIBRARY_PATH=<mesa_lib>:$LD_LIBRARY_PATH LIBGL_DRIVERS_PATH=<mesa_lib>/dri] google-chrome-unstable

3. Open the link, https://www.khronos.org/registry/webgl/sdk/tests/conformance/textures/misc/texture-size-limit.html?webglVersion=2&quiet=0

Result: There are some failure cases. The driver returns GL_OUT_OF_MEMORY error. 

Expected: These cases pass on Mesa driver.

Notes: This issue cannot be reproduced on SkyLake machine.
Comment 1 xinghua 2016-12-16 12:24:41 UTC
The failure case may be related with https://bugs.freedesktop.org/show_bug.cgi?id=98297
This bug changes "MaxTextureLevels" from 14 to 15. It means that buffer object size for GL_TEXTURE_CUBE_MAP is from 2425421824 to 9682681856. This size is too large that may cause mmap failure.
// intel_bufmgr_gem.c
static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
{
	...
	if (!bo_gem->mem_virtual) {
		struct drm_i915_gem_mmap mmap_arg;

		memclear(mmap_arg);
		mmap_arg.handle = bo_gem->gem_handle;
		mmap_arg.size = bo->size;
		ret = drmIoctl(bufmgr_gem->fd,
			       DRM_IOCTL_I915_GEM_MMAP,
			       &mmap_arg);
		...
    }
	...
}

drmIoctl call would fail, if call texImage2D continuously with same target but different format and type as below,

gl.texImage2D(TEXTURE_CUBE_MAP_POSITIVE_X, 14, RGB, 1, 1, 0, RGB, UNSIGNED_SHORT_5_6_5, Unit16Array);
gl.texImage2D(TEXTURE_CUBE_MAP_POSITIVE_X, 14, RGBA, 1, 1, 0, RGBA, UNSIGNED_BYTE, Unit8Array);

It will create two buffer objects, their size all 9682681856. out_of_memory issue will frequently happen when mapping buf2 but buf1 does not be released.
I am not sure this issue should be covered by application, or resolved by driver. Please help to check it, thank you.
Comment 2 Mark Janes 2016-12-16 18:27:15 UTC
How much system memory is available on the broadwell that you used?

I got OOM on systems with 2GB due to the patch referenced here:

https://bugs.freedesktop.org/show_bug.cgi?id=99048
Comment 3 Yang Gu 2016-12-17 01:10:00 UTC
32GB. However, our 32GB SKL is OK with same test.
Comment 4 xinghua 2018-08-29 09:14:52 UTC
Hi, the issue cannot be reproduced now. Had you provide a solution to fix it? Or had you made some optimization, and implicitly resolved it?
Comment 5 Mark Janes 2018-09-22 19:59:53 UTC
xinghua:  I'm not aware of a fix for this, but it seems like it is dependent on the kernel version.  It would help if you could reproduce this on old/new mesa and bisect.
Comment 6 GitLab Migration User 2019-09-25 18:59:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1555.


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.