Bug 79237 - igt/gem_userptr_blits fails
Summary: igt/gem_userptr_blits fails
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: Other All
: high normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-26 03:52 UTC by Guo Jinxian
Modified: 2016-10-19 09:24 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (80.64 KB, text/plain)
2014-05-26 03:52 UTC, Guo Jinxian
no flags Details
dmesg (125.82 KB, text/plain)
2014-05-26 04:29 UTC, Guo Jinxian
no flags Details
dmesg (99.25 KB, text/plain)
2014-07-14 09:20 UTC, Guo Jinxian
no flags Details
dmesg (108.37 KB, text/plain)
2014-07-21 03:18 UTC, Guo Jinxian
no flags Details

Description Guo Jinxian 2014-05-26 03:52:17 UTC
Created attachment 99819 [details]
dmesg

==System Environment==
--------------------------
Regression: Yes. 
It's a igt regression issue, the result before was skipped

Non-working platforms: SNB BDW

==kernel==
--------------------------
origin/drm-intel-nightly: c37f30ddc2921eccbf0be87c7742b56fbde53a81(fails)
    drm-intel-nightly: 2014y-05m-23d-13h-57m-55s integration manifest
origin/drm-intel-next-queued: f83d6518a13020e3cf7abbcc6b4e6d34459d9a9f(fails)
    ddrm/i915: Kill private_default_ctx off    
origin/drm-intel-fixes: c1240bd2842f6ec26d7dc1d9c845a197a41d33fe(skips)
    drm/i915: Prevent negative relocation deltas from wrapping

==Bug detailed description==
-----------------------------
igt/gem_userptr_blits fails

Output:
 ./gem_userptr_blits
IGT-Version: 1.6-gff3c122 (x86_64) (Linux: 3.15.0-rc3_drm-intel-next-queued_f83d65_20140525+ x86_64)
Aperture size is 4096 MiB
Total RAM is 3865 MiB
Subtest input-checking: SUCCESS
Subtest usage-restrictions: SUCCESS
Subtest invalid-mapping: SUCCESS
Subtest forbidden-operations: SUCCESS
Testing unsynchronized mappings...
Subtest create-destroy-unsync: SUCCESS
Subtest unsync-overlap: SUCCESS
Subtest unsync-unmap: SUCCESS
Subtest unsync-unmap-cycles: SUCCESS
Subtest unsync-unmap-after-close: SUCCESS
Using 2x2730 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Cyclic blits gpu->cpu, backward...
Random blits...
Subtest coherency-unsync: SUCCESS
gem_userptr_blits: gem_userptr_blits.c:650: sigbus: Assertion `0' failed.
Aborted

==Reproduce steps==
---------------------------- 
1.  ./gem_userptr_blits


==Bisect results==
----------------------------
commit 9911f3f0cf202444f1ef2399f5961605880b7360
Author:     Chris Wilson <chris@chris-wilson.co.uk>
AuthorDate: Thu May 22 10:20:33 2014 +0100
Commit:     Chris Wilson <chris@chris-wilson.co.uk>
CommitDate: Thu May 22 10:22:04 2014 +0100

    igt/gem_userptr_blits: Fix up last minute API changes

    When the patch was merged, the ioctl numbers had to be adjusted to leave
    no holes. Also there was a final piece of munging of the API to
    downgrade unsynced userptr for export over dma-buf.

    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 1 Guo Jinxian 2014-05-26 04:29:42 UTC
Created attachment 99821 [details]
dmesg

Test costs long time sometimes.

time ./gem_userptr_blits
IGT-Version: 1.6-gff3c122 (x86_64) (Linux: 3.15.0-rc3_drm-intel-next-queued_f83d65_20140525+ x86_64)
Aperture size is 2048 MiB
Total RAM is 7901 MiB
Subtest input-checking: SUCCESS
Subtest usage-restrictions: SUCCESS
Subtest invalid-mapping: SUCCESS
Subtest forbidden-operations: SUCCESS
Testing unsynchronized mappings...
Subtest create-destroy-unsync: SUCCESS
Subtest unsync-overlap: SUCCESS
Subtest unsync-unmap: SUCCESS
Subtest unsync-unmap-cycles: SUCCESS
Subtest unsync-unmap-after-close: SUCCESS
Using 2x1365 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Cyclic blits gpu->cpu, backward...
Random blits...
Subtest coherency-unsync: SUCCESS
Subtest dmabuf-unsync: SUCCESS
Subtest forked-unsync-normal: SUCCESS
Subtest forked-unsync-interruptible: SUCCESS
Subtest forked-unsync-swapping-normal: SUCCESS
Subtest forked-unsync-swapping-interruptible: SUCCESS
Subtest forked-unsync-multifd-normal: SUCCESS
Subtest forked-unsync-multifd-interruptible: SUCCESS
Subtest forked-unsync-swapping-multifd-normal: SUCCESS
Subtest forked-unsync-swapping-multifd-interruptible: SUCCESS
child 0 died with signal 9, Killed
Subtest forked-unsync-mempressure-normal: FAIL
Test assertion failure function __igt_fork, file igt_core.c:889:
Last errno: 12, Cannot allocate memory
Failed assertion: 0
Subtest forked-unsync-mempressure-interruptible: FAIL
Test requirement not met in function forking_evictions, file eviction_common.c:181:
Last errno: 12, Cannot allocate memory
Test requirement: (!(intel_get_total_ram_mb() / 4 < intel_get_total_swap_mb()))
Subtest forked-unsync-swapping-mempressure-normal: SKIP
Test requirement not met in function forking_evictions, file eviction_common.c:181:
Last errno: 12, Cannot allocate memory
Test requirement: (!(intel_get_total_ram_mb() / 4 < intel_get_total_swap_mb()))
Subtest forked-unsync-swapping-mempressure-interruptible: SKIP
Test assertion failure function __igt_fork, file igt_core.c:889:
Last errno: 12, Cannot allocate memory
Failed assertion: 0
Subtest forked-unsync-multifd-mempressure-normal: FAIL
Test assertion failure function __igt_fork, file igt_core.c:889:
Last errno: 12, Cannot allocate memory
Failed assertion: 0
Subtest forked-unsync-multifd-mempressure-interruptible: FAIL
Test requirement not met in function forking_evictions, file eviction_common.c:181:
Last errno: 12, Cannot allocate memory
Test requirement: (!(intel_get_total_ram_mb() / 4 < intel_get_total_swap_mb()))
Subtest forked-unsync-swapping-multifd-mempressure-normal: SKIP
Test requirement not met in function forking_evictions, file eviction_common.c:181:
Last errno: 12, Cannot allocate memory
Test requirement: (!(intel_get_total_ram_mb() / 4 < intel_get_total_swap_mb()))
Subtest forked-unsync-swapping-multifd-mempressure-interruptible: SKIP

Subtest swapping-unsync-normal: SUCCESS
Subtest minor-unsync-normal: SUCCESS
Subtest major-unsync-normal: SUCCESS

Subtest swapping-unsync-interruptible: SUCCESS
Subtest minor-unsync-interruptible: SUCCESS
Subtest major-unsync-interruptible: SUCCESS
Testing synchronized mappings...
Subtest create-destroy-sync: SUCCESS
Subtest sync-overlap: SUCCESS
Subtest sync-unmap: SUCCESS
Subtest sync-unmap-cycles: SUCCESS
Subtest sync-unmap-after-close: SUCCESS
Using 2x1365 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Cyclic blits gpu->cpu, backward...
Random blits...
Subtest coherency-sync: SUCCESS
Test assertion failure function check_bo, file gem_userptr_blits.c:599:
Last errno: 0, Success
Failed assertion: ptr1[i] == counter
Subtest dmabuf-sync: FAIL
Unhandled failure in child 0
gem_userptr_blits: igt_core.c:859: children_exit_handler: Assertion `ret == 0' failed.
Aborted (core dumped)

real    41m45.523s
user    0m6.311s
sys     29m14.948s
Comment 2 Chris Wilson 2014-05-26 05:27:27 UTC
Your failures are unclear here. There are at least 3 different problems you have conflated into this bug report. Please file the sigbus assertion, the insufficient memory to run tests, and the coherency failure as 3 individual bugs.
Comment 3 Guo Jinxian 2014-05-26 06:36:54 UTC
(In reply to comment #2)
> Your failures are unclear here. There are at least 3 different problems you
> have conflated into this bug report. Please file the sigbus assertion, the
> insufficient memory to run tests, and the coherency failure as 3 individual
> bugs.

Bug 79242 bug 79244 and bug 79245 were created to track different problems.
Comment 4 Chris Wilson 2014-07-11 10:00:51 UTC

*** This bug has been marked as a duplicate of bug 80208 ***
Comment 5 Guo Jinxian 2014-07-14 08:38:34 UTC
(In reply to comment #4)
> 
> *** This bug has been marked as a duplicate of bug 80208 ***

Bug 80208 had fixed, but this bug still able to reproduce on latest -nightly(271bff129a641b5b35d99c9eb0ceb866ca42f692),so reopen it.

Output:
root@x-byt06:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./gem_userptr_blits
IGT-Version: 1.7-ge74dd22 (x86_64) (Linux: 3.16.0-rc4_drm-intel-nightly_271bff_20140714+ x86_64)
Aperture size is 2048 MiB
Total RAM is 1894 MiB
Subtest input-checking: SUCCESS
Subtest usage-restrictions: SUCCESS
Subtest invalid-mapping: SUCCESS
Test assertion failure function test_forked_access, file gem_userptr_blits.c:583:
Failed assertion: memcmp(ptr1, ptr2, PAGE_SIZE) == 0
Subtest forked-access: FAIL
Subtest forbidden-operations: SUCCESS
Testing unsynchronized mappings...
Subtest create-destroy-unsync: SUCCESS
Subtest unsync-overlap: SUCCESS
Subtest unsync-unmap: SUCCESS
Subtest unsync-unmap-cycles: SUCCESS
Subtest unsync-unmap-after-close: SUCCESS
Using 2x1365 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Cyclic blits gpu->cpu, backward...
Random blits...
Subtest coherency-unsync: SUCCESS
Bus error
Comment 6 Chris Wilson 2014-07-14 08:57:25 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > 
> > *** This bug has been marked as a duplicate of bug 80208 ***
> 
> Bug 80208 had fixed, but this bug still able to reproduce on latest
> -nightly(271bff129a641b5b35d99c9eb0ceb866ca42f692),so reopen it.
> 
> Output:
> root@x-byt06:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests#
> ./gem_userptr_blits
> IGT-Version: 1.7-ge74dd22 (x86_64) (Linux:
> 3.16.0-rc4_drm-intel-nightly_271bff_20140714+ x86_64)
> Aperture size is 2048 MiB
> Total RAM is 1894 MiB
> Subtest input-checking: SUCCESS
> Subtest usage-restrictions: SUCCESS
> Subtest invalid-mapping: SUCCESS
> Test assertion failure function test_forked_access, file
> gem_userptr_blits.c:583:
> Failed assertion: memcmp(ptr1, ptr2, PAGE_SIZE) == 0
> Subtest forked-access: FAIL
> Subtest forbidden-operations: SUCCESS
> Testing unsynchronized mappings...
> Subtest create-destroy-unsync: SUCCESS
> Subtest unsync-overlap: SUCCESS
> Subtest unsync-unmap: SUCCESS
> Subtest unsync-unmap-cycles: SUCCESS
> Subtest unsync-unmap-after-close: SUCCESS
> Using 2x1365 1MiB buffers
> Verifying initialisation...
> Cyclic blits cpu->gpu, forward...
> Cyclic blits gpu->cpu, backward...
> Random blits...
> Subtest coherency-unsync: SUCCESS
> Bus error

Please attach the usual dmesg and run with IGT_LOG_LEVEL=debug to explain how it thinks you only have less than 2GiB of ram.
Comment 7 Guo Jinxian 2014-07-14 09:20:02 UTC
Created attachment 102758 [details]
dmesg

(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > 
> > > *** This bug has been marked as a duplicate of bug 80208 ***
> > 
> > Bug 80208 had fixed, but this bug still able to reproduce on latest
> > -nightly(271bff129a641b5b35d99c9eb0ceb866ca42f692),so reopen it.
> > 
> > Output:
> > root@x-byt06:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests#
> > ./gem_userptr_blits
> > IGT-Version: 1.7-ge74dd22 (x86_64) (Linux:
> > 3.16.0-rc4_drm-intel-nightly_271bff_20140714+ x86_64)
> > Aperture size is 2048 MiB
> > Total RAM is 1894 MiB
> > Subtest input-checking: SUCCESS
> > Subtest usage-restrictions: SUCCESS
> > Subtest invalid-mapping: SUCCESS
> > Test assertion failure function test_forked_access, file
> > gem_userptr_blits.c:583:
> > Failed assertion: memcmp(ptr1, ptr2, PAGE_SIZE) == 0
> > Subtest forked-access: FAIL
> > Subtest forbidden-operations: SUCCESS
> > Testing unsynchronized mappings...
> > Subtest create-destroy-unsync: SUCCESS
> > Subtest unsync-overlap: SUCCESS
> > Subtest unsync-unmap: SUCCESS
> > Subtest unsync-unmap-cycles: SUCCESS
> > Subtest unsync-unmap-after-close: SUCCESS
> > Using 2x1365 1MiB buffers
> > Verifying initialisation...
> > Cyclic blits cpu->gpu, forward...
> > Cyclic blits gpu->cpu, backward...
> > Random blits...
> > Subtest coherency-unsync: SUCCESS
> > Bus error
> 
> Please attach the usual dmesg and run with IGT_LOG_LEVEL=debug to explain
> how it thinks you only have less than 2GiB of ram.

I don't know how to use parameter "IGT_LOG_LEVEL=debug", and the device I used was 2GiB ram. but this bug is able to reproduce on other device too. Please check the output below and the dmesg in attachment.

root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./gem_userptr_blits
IGT-Version: 1.7-ge74dd22 (x86_64) (Linux: 3.16.0-rc4_drm-intel-nightly_271bff_20140714+ x86_64)
Aperture size is 2048 MiB
Total RAM is 3837 MiB
Subtest input-checking: SUCCESS
Subtest usage-restrictions: SUCCESS
Subtest invalid-mapping: SUCCESS
Test assertion failure function test_forked_access, file gem_userptr_blits.c:583:
Failed assertion: memcmp(ptr1, ptr2, PAGE_SIZE) == 0
Subtest forked-access: FAIL
Subtest forbidden-operations: SUCCESS
Testing unsynchronized mappings...
Subtest create-destroy-unsync: SUCCESS
Subtest unsync-overlap: SUCCESS
Subtest unsync-unmap: SUCCESS
Subtest unsync-unmap-cycles: SUCCESS
Subtest unsync-unmap-after-close: SUCCESS
Using 2x1365 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Cyclic blits gpu->cpu, backward...
Random blits...
Subtest coherency-unsync: SUCCESS
Bus error (core dumped)
root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# free -m
             total       used       free     shared    buffers     cached
Mem:          3837        159       3677          1         15         68
-/+ buffers/cache:         75       3761
Swap:         3905          0       3905
Comment 8 Chris Wilson 2014-07-14 09:32:54 UTC
(In reply to comment #7)
> > Please attach the usual dmesg and run with IGT_LOG_LEVEL=debug to explain
> > how it thinks you only have less than 2GiB of ram.
> 
> I don't know how to use parameter "IGT_LOG_LEVEL=debug", and the device I
> used was 2GiB ram. but this bug is able to reproduce on other device too.
> Please check the output below and the dmesg in attachment.

It's an environment variable, so use as:

$ IGT_LOG_LEVEL=debug ./gem_userptr_blits

The missing memory check should be performed by:

commit 52ac9a4b57f20f2dc019a973237f2f97ddb0ebf3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jul 14 10:30:36 2014 +0100

    igt/gem_userptr_blits: Add missing RAM check before coherency tests
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

That should be enough to stop it from running out of memory.
Comment 9 Guo Jinxian 2014-07-21 03:18:25 UTC
Created attachment 103165 [details]
dmesg

(In reply to comment #8)
> (In reply to comment #7)
> > > Please attach the usual dmesg and run with IGT_LOG_LEVEL=debug to explain
> > > how it thinks you only have less than 2GiB of ram.
> > 
> > I don't know how to use parameter "IGT_LOG_LEVEL=debug", and the device I
> > used was 2GiB ram. but this bug is able to reproduce on other device too.
> > Please check the output below and the dmesg in attachment.
> 
> It's an environment variable, so use as:
> 
> $ IGT_LOG_LEVEL=debug ./gem_userptr_blits
> 
> The missing memory check should be performed by:
> 
> commit 52ac9a4b57f20f2dc019a973237f2f97ddb0ebf3
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Mon Jul 14 10:30:36 2014 +0100
> 
>     igt/gem_userptr_blits: Add missing RAM check before coherency tests
>     
>     References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
>     Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> That should be enough to stop it from running out of memory.

Tested with igt 4d4f4b213ca95dad59bdf8080d7bb034aa2d307a, the result shows below:

[root@x-bdw01 tests]# IGT_LOG_LEVEL=debug ./gem_userptr_blits
IGT-Version: 1.7-g4d4f4b2 (x86_64) (Linux: 3.16.0-rc5_drm-intel-nightly_873440_20140721+ x86_64)
Aperture size is 4096 MiB
Total RAM is 3882 MiB
Subtest input-checking: SUCCESS
Subtest usage-restrictions: SUCCESS
Subtest invalid-mapping: SUCCESS
Test assertion failure function copy, file gem_userptr_blits.c:221:
Failed assertion: ret == error
Last errno: 5, Input/output error
child 0 failed with exit status 99
Subtest forked-access: FAIL
Subtest forbidden-operations: SUCCESS
Testing unsynchronized mappings...
Subtest create-destroy-unsync: SUCCESS
Subtest unsync-overlap: SUCCESS
Test assertion failure function copy, file gem_userptr_blits.c:221:
Failed assertion: ret == error
Last errno: 5, Input/output error
Subtest unsync-unmap: FAIL
Test assertion failure function copy, file gem_userptr_blits.c:221:
Failed assertion: ret == error
Last errno: 5, Input/output error
Subtest unsync-unmap-cycles: FAIL
Test assertion failure function copy, file gem_userptr_blits.c:221:
Failed assertion: ret == error
Last errno: 5, Input/output error
Subtest unsync-unmap-after-close: FAIL
Checking 2730 surfaces of size 1048576 bytes (total 2864013312) against RAM
Using 2x2730 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Test assertion failure function copy, file gem_userptr_blits.c:221:
Failed assertion: ret == error
Last errno: 5, Input/output error
Subtest coherency-unsync: FAIL
Segmentation fault (core dumped)
Comment 10 Chris Wilson 2014-07-21 06:05:14 UTC
(In reply to comment #9)
> Tested with igt 4d4f4b213ca95dad59bdf8080d7bb034aa2d307a, the result shows
> below:

Please always say which platform, it appears bdw (but is bdw gt3 or bdw gt1 etc?).

> Test assertion failure function copy, file gem_userptr_blits.c:221:
> Failed assertion: ret == error
> Last errno: 5, Input/output error
> Subtest coherency-unsync: FAIL

EIO -- you should attach the error state. However, please file a new bug for bdw userptr issues since bdw is not particularly stable and a bad choice for confirming whether a general igt issue in itself is fixed.
Comment 11 Guo Jinxian 2014-07-24 07:30:26 UTC
Test still failed on latest -nightly(af1aaba219fdd90ca1b30f9b8d8d19352224f170) on BYT

root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./gem_userptr_blits
IGT-Version: 1.7-g70e6ed9 (x86_64) (Linux: 3.16.0-rc6_drm-intel-nightly_af1aab_20140724+ x86_64)
Aperture size is 2048 MiB
Total RAM is 3837 MiB
Subtest input-checking: SUCCESS
Subtest usage-restrictions: SUCCESS
Subtest invalid-null-pointer: SUCCESS
Subtest invalid-gtt-mapping: SUCCESS
Test assertion failure function test_forked_access, file gem_userptr_blits.c:620:
Failed assertion: memcmp(ptr1, ptr2, PAGE_SIZE) == 0
Subtest forked-access: FAIL
Subtest forbidden-operations: SUCCESS
Testing unsynchronized mappings...
Subtest create-destroy-unsync: SUCCESS
Subtest unsync-overlap: SUCCESS
Subtest unsync-unmap: SUCCESS
Subtest unsync-unmap-cycles: SUCCESS
Subtest unsync-unmap-after-close: SUCCESS
Using 2x1365 1MiB buffers
Verifying initialisation...
Cyclic blits cpu->gpu, forward...
Cyclic blits gpu->cpu, backward...
Random blits...
Subtest coherency-unsync: SUCCESS
Bus error (core dumped)
Comment 12 Chris Wilson 2014-09-04 07:53:45 UTC
I've lost track of this bug. I am going to say that as of

commit 38f7786268101c29a61fd3c37776360af6012bdc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jul 18 09:39:44 2014 +0100

    drm/i915: Prevent recursive deadlock on releasing a busy userptr

it should be working on all platforms. Can you please open bugs for specific failures, if any remain?
Comment 13 Guo Jinxian 2014-09-10 08:46:33 UTC
(In reply to comment #12)
> I've lost track of this bug. I am going to say that as of
> 
> commit 38f7786268101c29a61fd3c37776360af6012bdc
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Fri Jul 18 09:39:44 2014 +0100
> 
>     drm/i915: Prevent recursive deadlock on releasing a busy userptr
> 
> it should be working on all platforms. Can you please open bugs for specific
> failures, if any remain?

Verified this because most of gem_userptr_blits cases are passed. I will report new bugs for specific failures if I met.
Comment 14 Jari Tahvanainen 2016-10-19 09:24:10 UTC
Closing as a verified+fixed.


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.