Skip to contentSkip to conversation

tests/amd_basic: WIP fix eviction test failure

PATCH Superseded Jesse Zhang 2 participants 5 messages Mar 26, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/amd_basic: WIP fix eviction test failure

Test case name:igt@amdgpu/amd_basic@eviction-test-with-ip-dma@eviction_test
Fail error: "Starting subtest: eviction-test-with-IP-DMA
Starting dynamic subtest: eviction_test
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: Test assertion failure function amdgpu_test_exec_cs_helper, file ../lib/amdgpu/amd_command_submission.c:77:
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: Failed assertion: r == 0
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: Last errno: 12, Cannot allocate memory
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: error: -12 != 0
Dynamic subtest eviction_test failed.

There is a case where the system size and gtt memory are smaller.
When evicting vram to gtt or system memory, there is not enough gtt or memory system memory available for allocation. Therefore, try to reduce the use of gtt during initialization to meet the requirements for evicting vram.

V2: Added dump to the file to get the values for gtt and vram heaps (Vitaly)
Remove the space and empty line (Kamil)

Cc Vitaly Prosyak <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian Koenig <[email protected]>
Cc Kamil Konieczny <[email protected]>
---
 tests/amdgpu/amd_basic.c | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)
tests/amdgpu/amd_basic.c +31 -4
index 70e45649d..0b4159222 100644
@@ -336,6 +336,7 @@ amdgpu_bo_eviction_test(amdgpu_device_handle device_handle)
 	struct amdgpu_heap_info vram_info, gtt_info;
 	int r, loop1, loop2;
 
+	FILE * file = NULL;
 
 	uint64_t gtt_flags[2] = {0, AMDGPU_GEM_CREATE_CPU_GTT_USWC};
 
@@ -358,6 +359,36 @@ amdgpu_bo_eviction_test(amdgpu_device_handle device_handle)
 				   0, &vram_info);
 	igt_assert_eq(r, 0);
 
+	r = amdgpu_query_heap_info(device_handle, AMDGPU_GEM_DOMAIN_GTT,
+				   0, &gtt_info);
+	igt_assert_eq(r, 0);
+
+	file = fopen("gtt_vram.txt", "w");
+
+	fprintf(file, "gtt_info.heap_size %ld, gtt_info.max_allocation %ld  gtt_info.heap_usage %ld\n",
+			gtt_info.heap_size, gtt_info.max_allocation, gtt_info.heap_usage);
+
+	fprintf(file, "gtt_info.heap_size %ld mb, gtt_info.max_allocation %ld mb gtt_info.heap_usage %ld mb\n",
+			gtt_info.heap_size>>20, gtt_info.max_allocation>>20, gtt_info.heap_usage>>20);
+
+	fprintf(file, "vram_info.heap_size %ld, vram_info.max_allocation %ld vram_info.heap_usage %ld\n",
+			vram_info.heap_size, vram_info.max_allocation, vram_info.heap_usage);
+
+	fprintf(file, "vram_info.heap_size %ld mb, vram_info.max_allocation %ld mb vram_info.heap_usage %ld mb\n",
+			vram_info.heap_size>>20, vram_info.max_allocation>>20, vram_info.heap_usage>>20);
+
+	fclose(file);
+
+	/* For smaller gtt memory sizes, reduce gtt usage on initialization
+	 * to satisfy eviction vram requirements. Example:
+	 * gtt_info.heap_size 3036569600, gtt_info.max_allocation 2114244608  gtt_info.heap_usage 12845056
+	 * gtt_info.heap_size 2895 mb, gtt_info.max_allocation 2016 mb gtt_info.heap_usage 12 mb
+	 * vram_info.heap_size 2114244608, vram_info.max_allocation 2114244608 vram_info.heap_usage 26951680
+	 * vram_info.heap_size 2016 mb, vram_info.max_allocation 2016 mb vram_info.heap_usage 25 mb
+	 */
+	if (gtt_info.heap_size - gtt_info.max_allocation < vram_info.max_allocation)
+		gtt_info.max_allocation /=3;
+
 	r = amdgpu_bo_alloc_wrap(device_handle, vram_info.max_allocation, 4096,
 				 AMDGPU_GEM_DOMAIN_VRAM, 0, &ring_context->boa_vram[0]);
 	igt_assert_eq(r, 0);
@@ -365,10 +396,6 @@ amdgpu_bo_eviction_test(amdgpu_device_handle device_handle)
 				 AMDGPU_GEM_DOMAIN_VRAM, 0, &ring_context->boa_vram[1]);
 	igt_assert_eq(r, 0);
 
-	r = amdgpu_query_heap_info(device_handle, AMDGPU_GEM_DOMAIN_GTT,
-				   0, &gtt_info);
-	igt_assert_eq(r, 0);
-
 	r = amdgpu_bo_alloc_wrap(device_handle, gtt_info.max_allocation, 4096,
 				 AMDGPU_GEM_DOMAIN_GTT, 0, &ring_context->boa_gtt[0]);
 	igt_assert_eq(r, 0);
Signature · 1 line
2.25.1
#1 lore raw

[AMD Official Use Only - General]

Please ignore this patch, I will send out new patch soon. Thanks
Jesse

-----Original Message-----
From: Jesse Zhang <[email protected]>
Sent: Tuesday, March 26, 2024 10:10 AM
To: [email protected]
Cc: Prosyak, Vitaly <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Kamil Konieczny <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH i-g-t V2] tests/amd_basic: WIP fix eviction test failure

Test case name:igt@amdgpu/amd_basic@eviction-test-with-ip-dma@eviction_test
Fail error: "Starting subtest: eviction-test-with-IP-DMA Starting dynamic subtest: eviction_test
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: Test assertion failure function amdgpu_test_exec_cs_helper, file ../lib/amdgpu/amd_command_submission.c:77:
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: Failed assertion: r == 0
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: Last errno: 12, Cannot allocate memory
(amd_basic:9425) amdgpu/amd_command_submission-CRITICAL: error: -12 != 0 Dynamic subtest eviction_test failed.

There is a case where the system size and gtt memory are smaller.
When evicting vram to gtt or system memory, there is not enough gtt or memory system memory available for allocation. Therefore, try to reduce the use of gtt during initialization to meet the requirements for evicting vram.

V2: Added dump to the file to get the values for gtt and vram heaps (Vitaly)
Remove the space and empty line (Kamil)

Cc Vitaly Prosyak <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian Koenig <[email protected]>
Cc Kamil Konieczny <[email protected]>
---
 tests/amdgpu/amd_basic.c | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)
tests/amdgpu/amd_basic.c +34 -0
@@ -336,6 +336,7 @@ amdgpu_bo_eviction_test(amdgpu_device_handle device_handle)
        struct amdgpu_heap_info vram_info, gtt_info;
        int r, loop1, loop2;
 
+       FILE * file = NULL;
 
        uint64_t gtt_flags[2] = {0, AMDGPU_GEM_CREATE_CPU_GTT_USWC};
 
@@ -358,6 +359,36 @@ amdgpu_bo_eviction_test(amdgpu_device_handle device_handle)
                                   0, &vram_info);
        igt_assert_eq(r, 0);
 
+       r = amdgpu_query_heap_info(device_handle, AMDGPU_GEM_DOMAIN_GTT,
+                                  0, &gtt_info);
+       igt_assert_eq(r, 0);
+
+       file = fopen("gtt_vram.txt", "w");
+
+       fprintf(file, "gtt_info.heap_size %ld, gtt_info.max_allocation %ld  gtt_info.heap_usage %ld\n",
+                       gtt_info.heap_size, gtt_info.max_allocation, gtt_info.heap_usage);
+
+       fprintf(file, "gtt_info.heap_size %ld mb, gtt_info.max_allocation %ld mb gtt_info.heap_usage %ld mb\n",
+                       gtt_info.heap_size>>20, gtt_info.max_allocation>>20,
+gtt_info.heap_usage>>20);
+
+       fprintf(file, "vram_info.heap_size %ld, vram_info.max_allocation %ld vram_info.heap_usage %ld\n",
+                       vram_info.heap_size, vram_info.max_allocation,
+vram_info.heap_usage);
+
+       fprintf(file, "vram_info.heap_size %ld mb, vram_info.max_allocation %ld mb vram_info.heap_usage %ld mb\n",
+                       vram_info.heap_size>>20, vram_info.max_allocation>>20,
+vram_info.heap_usage>>20);
+
+       fclose(file);
+
+       /* For smaller gtt memory sizes, reduce gtt usage on initialization
+        * to satisfy eviction vram requirements. Example:
+        * gtt_info.heap_size 3036569600, gtt_info.max_allocation 2114244608  gtt_info.heap_usage 12845056
+        * gtt_info.heap_size 2895 mb, gtt_info.max_allocation 2016 mb gtt_info.heap_usage 12 mb
+        * vram_info.heap_size 2114244608, vram_info.max_allocation 2114244608 vram_info.heap_usage 26951680
+        * vram_info.heap_size 2016 mb, vram_info.max_allocation 2016 mb vram_info.heap_usage 25 mb
+        */
+       if (gtt_info.heap_size - gtt_info.max_allocation < vram_info.max_allocation)
+               gtt_info.max_allocation /=3;
+
        r = amdgpu_bo_alloc_wrap(device_handle, vram_info.max_allocation, 4096,
                                 AMDGPU_GEM_DOMAIN_VRAM, 0, &ring_context->boa_vram[0]);
        igt_assert_eq(r, 0);
@@ -365,10 +396,6 @@ amdgpu_bo_eviction_test(amdgpu_device_handle device_handle)
                                 AMDGPU_GEM_DOMAIN_VRAM, 0, &ring_context->boa_vram[1]);
        igt_assert_eq(r, 0);

- r = amdgpu_query_heap_info(device_handle, AMDGPU_GEM_DOMAIN_GTT,
- 0, &gtt_info);
- igt_assert_eq(r, 0);
-

        r = amdgpu_bo_alloc_wrap(device_handle, gtt_info.max_allocation, 4096,
                                 AMDGPU_GEM_DOMAIN_GTT, 0, &ring_context->boa_gtt[0]);
        igt_assert_eq(r, 0);

--
2.25.1

#2 lore raw

✓ CI.xeBAT: success for tests/amd_basic: WIP fix eviction test failure

In reply to Jesse Zhang
== Series Details ==

== Series Details ==

Series: tests/amd_basic: WIP fix eviction test failure
URL : https://patchwork.freedesktop.org/series/131613/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_7782_BAT -> XEIGTPW_10910_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (4 -> 3)
------------------------------

Missing (1): bat-dg2-oem2

Changes
-------

No changes found

Build changes
-------------

* IGT: IGT_7782 -> IGTPW_10910
* Linux: xe-988-d1ecfbbbb194e8f7941bd84f77f7c938b461ce14 -> xe-991-4a8fabcf2f1aadbbb777a94edd01549c2aa95caf

IGTPW_10910: 10910
IGT_7782: a404f73182948e843640d00cc279883391cf6ef4 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-988-d1ecfbbbb194e8f7941bd84f77f7c938b461ce14: d1ecfbbbb194e8f7941bd84f77f7c938b461ce14 xe-991-4a8fabcf2f1aadbbb777a94edd01549c2aa95caf: 4a8fabcf2f1aadbbb777a94edd01549c2aa95caf

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10910/index.html

#3 lore raw

✗ Fi.CI.BUILD: failure for tests/amd_basic: WIP fix eviction test failure (rev2)

In reply to Jesse Zhang
== Series Details ==

== Series Details ==

Series: tests/amd_basic: WIP fix eviction test failure (rev2)
URL : https://patchwork.freedesktop.org/series/131613/
State : failure

== Summary ==

Applying: tests/amd_basic: WIP fix eviction test failure Patch failed at 0001 tests/amd_basic: WIP fix eviction test failure When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

#4 lore raw

✗ Fi.CI.BAT: failure for tests/amd_basic: WIP fix eviction test failure

In reply to Jesse Zhang
== Series Details ==

== Series Details ==

Series: tests/amd_basic: WIP fix eviction test failure
URL : https://patchwork.freedesktop.org/series/131613/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_14482 -> IGTPW_10910
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_10910 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes
introduced in IGTPW_10910, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/index.html

Participating hosts (37 -> 33)
------------------------------

Additional (1): bat-arls-4
Missing (5): bat-dg1-7 fi-snb-2520m bat-dg2-11 bat-jsl-1 bat-mtlp-8

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_10910:

### IGT changes ###

#### Possible regressions ####

* igt@kms_flip@basic-flip-vs-modeset@c-dp1:
- bat-adlp-9: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14482/bat-adlp-9/igt@kms_flip@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/bat-adlp-9/igt@kms_flip@[email protected]

Known issues
------------

Here are the changes found in IGTPW_10910 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_huc_copy@huc-copy:
- fi-cfl-8109u: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/fi-cfl-8109u/igt@[email protected]

* igt@gem_lmem_swapping@verify-random:
- fi-cfl-8109u: NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/fi-cfl-8109u/igt@[email protected]

* igt@kms_flip@basic-flip-vs-modeset@d-dp1:
- bat-adlp-9: [PASS][5] -> [FAIL][6] ([i915#6121])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14482/bat-adlp-9/igt@kms_flip@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/bat-adlp-9/igt@kms_flip@[email protected]

* igt@kms_pm_backlight@basic-brightness:
- fi-cfl-8109u: NOTRUN -> [SKIP][7] +11 other tests skip
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/fi-cfl-8109u/igt@[email protected]

#### Possible fixes ####

* igt@gem_lmem_swapping@basic@lmem0:
- bat-dg2-14: [FAIL][8] ([i915#10378]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14482/bat-dg2-14/igt@gem_lmem_swapping@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/bat-dg2-14/igt@gem_lmem_swapping@[email protected]

* igt@i915_selftest@live@execlists:
- bat-dg2-14: [ABORT][10] ([i915#10366]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14482/bat-dg2-14/igt@i915_selftest@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/bat-dg2-14/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@mman:
- bat-dg2-8: [ABORT][12] ([i915#10366]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14482/bat-dg2-8/igt@i915_selftest@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/bat-dg2-8/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@i915_module_load@load:
- fi-kbl-7567u: [DMESG-WARN][14] ([i915#180] / [i915#1982] / [i915#8585]) -> [DMESG-WARN][15] ([i915#180] / [i915#8585])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14482/fi-kbl-7567u/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/fi-kbl-7567u/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#10196]: https://gitlab.freedesktop.org/drm/intel/issues/10196
[i915#10197]: https://gitlab.freedesktop.org/drm/intel/issues/10197
[i915#10200]: https://gitlab.freedesktop.org/drm/intel/issues/10200
[i915#10202]: https://gitlab.freedesktop.org/drm/intel/issues/10202
[i915#10206]: https://gitlab.freedesktop.org/drm/intel/issues/10206
[i915#10207]: https://gitlab.freedesktop.org/drm/intel/issues/10207
[i915#10208]: https://gitlab.freedesktop.org/drm/intel/issues/10208
[i915#10209]: https://gitlab.freedesktop.org/drm/intel/issues/10209
[i915#10211]: https://gitlab.freedesktop.org/drm/intel/issues/10211
[i915#10212]: https://gitlab.freedesktop.org/drm/intel/issues/10212
[i915#10213]: https://gitlab.freedesktop.org/drm/intel/issues/10213
[i915#10214]: https://gitlab.freedesktop.org/drm/intel/issues/10214
[i915#10216]: https://gitlab.freedesktop.org/drm/intel/issues/10216
[i915#10366]: https://gitlab.freedesktop.org/drm/intel/issues/10366
[i915#10378]: https://gitlab.freedesktop.org/drm/intel/issues/10378
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#6121]: https://gitlab.freedesktop.org/drm/intel/issues/6121
[i915#8585]: https://gitlab.freedesktop.org/drm/intel/issues/8585
[i915#8809]: https://gitlab.freedesktop.org/drm/intel/issues/8809
[i915#9318]: https://gitlab.freedesktop.org/drm/intel/issues/9318
[i915#9732]: https://gitlab.freedesktop.org/drm/intel/issues/9732
[i915#9812]: https://gitlab.freedesktop.org/drm/intel/issues/9812
[i915#9886]: https://gitlab.freedesktop.org/drm/intel/issues/9886

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7782 -> IGTPW_10910

CI-20190529: 20190529
CI_DRM_14482: 4a8fabcf2f1aadbbb777a94edd01549c2aa95caf @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10910: 10910
IGT_7782: a404f73182948e843640d00cc279883391cf6ef4 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

Testlist changes
----------------

-igt@kms_vrr@seamless-rr-switch-virtual

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10910/index.html