diff mbox series

[libdrm,v2,2/2] amdgpu/test: Fix deadlock tests for AI and RV v2

Message ID 1538145908-3153-2-git-send-email-andrey.grodzovsky@amd.com (mailing list archive)
State New, archived
Headers show
Series [libdrm,v2,1/2] amdgpu/test: Allow BO mapping flags to be passed in tests | expand

Commit Message

Andrey Grodzovsky Sept. 28, 2018, 2:45 p.m. UTC
Seems like AI and RV requires uncashed memory mapping to be able
to pickup value written to memory by CPU after the WAIT_REG_MEM
command was already launched.
.
Enable the test for AI and RV.

v2:
Update commit description.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 tests/amdgpu/deadlock_tests.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Marek Olšák Oct. 2, 2018, 8:47 p.m. UTC | #1
For the series:

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

Marek
On Fri, Sep 28, 2018 at 10:46 AM Andrey Grodzovsky
<andrey.grodzovsky@amd.com> wrote:
>
> Seems like AI and RV requires uncashed memory mapping to be able
> to pickup value written to memory by CPU after the WAIT_REG_MEM
> command was already launched.
> .
> Enable the test for AI and RV.
>
> v2:
> Update commit description.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> ---
>  tests/amdgpu/deadlock_tests.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
> index 304482d..292ec4e 100644
> --- a/tests/amdgpu/deadlock_tests.c
> +++ b/tests/amdgpu/deadlock_tests.c
> @@ -80,6 +80,8 @@ static  uint32_t  minor_version;
>  static pthread_t stress_thread;
>  static uint32_t *ptr;
>
> +int use_uc_mtype = 0;
> +
>  static void amdgpu_deadlock_helper(unsigned ip_type);
>  static void amdgpu_deadlock_gfx(void);
>  static void amdgpu_deadlock_compute(void);
> @@ -92,13 +94,14 @@ CU_BOOL suite_deadlock_tests_enable(void)
>                                              &minor_version, &device_handle))
>                 return CU_FALSE;
>
> -       if (device_handle->info.family_id == AMDGPU_FAMILY_AI ||
> -           device_handle->info.family_id == AMDGPU_FAMILY_SI ||
> -           device_handle->info.family_id == AMDGPU_FAMILY_RV) {
> +       if (device_handle->info.family_id == AMDGPU_FAMILY_SI) {
>                 printf("\n\nCurrently hangs the CP on this ASIC, deadlock suite disabled\n");
>                 enable = CU_FALSE;
>         }
>
> +       if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
> +               use_uc_mtype = 1;
> +
>         if (amdgpu_device_deinitialize(device_handle))
>                 return CU_FALSE;
>
> @@ -183,8 +186,8 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
>         r = amdgpu_cs_ctx_create(device_handle, &context_handle);
>         CU_ASSERT_EQUAL(r, 0);
>
> -       r = amdgpu_bo_alloc_and_map(device_handle, 4096, 4096,
> -                       AMDGPU_GEM_DOMAIN_GTT, 0,
> +       r = amdgpu_bo_alloc_and_map_raw(device_handle, 4096, 4096,
> +                       AMDGPU_GEM_DOMAIN_GTT, 0, use_uc_mtype ? AMDGPU_VM_MTYPE_UC : 0,
>                                                     &ib_result_handle, &ib_result_cpu,
>                                                     &ib_result_mc_address, &va_handle);
>         CU_ASSERT_EQUAL(r, 0);
> --
> 2.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König Oct. 3, 2018, 2:34 p.m. UTC | #2
Thanks for keeping working on this.

Series is Reviewed-by: Christian König <christian.koenig@amd.com> as well.

Do you now have commit rights?

Christian.

Am 02.10.2018 um 22:47 schrieb Marek Olšák:
> For the series:
>
> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
>
> Marek
> On Fri, Sep 28, 2018 at 10:46 AM Andrey Grodzovsky
> <andrey.grodzovsky@amd.com> wrote:
>> Seems like AI and RV requires uncashed memory mapping to be able
>> to pickup value written to memory by CPU after the WAIT_REG_MEM
>> command was already launched.
>> .
>> Enable the test for AI and RV.
>>
>> v2:
>> Update commit description.
>>
>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>> ---
>>   tests/amdgpu/deadlock_tests.c | 13 ++++++++-----
>>   1 file changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
>> index 304482d..292ec4e 100644
>> --- a/tests/amdgpu/deadlock_tests.c
>> +++ b/tests/amdgpu/deadlock_tests.c
>> @@ -80,6 +80,8 @@ static  uint32_t  minor_version;
>>   static pthread_t stress_thread;
>>   static uint32_t *ptr;
>>
>> +int use_uc_mtype = 0;
>> +
>>   static void amdgpu_deadlock_helper(unsigned ip_type);
>>   static void amdgpu_deadlock_gfx(void);
>>   static void amdgpu_deadlock_compute(void);
>> @@ -92,13 +94,14 @@ CU_BOOL suite_deadlock_tests_enable(void)
>>                                               &minor_version, &device_handle))
>>                  return CU_FALSE;
>>
>> -       if (device_handle->info.family_id == AMDGPU_FAMILY_AI ||
>> -           device_handle->info.family_id == AMDGPU_FAMILY_SI ||
>> -           device_handle->info.family_id == AMDGPU_FAMILY_RV) {
>> +       if (device_handle->info.family_id == AMDGPU_FAMILY_SI) {
>>                  printf("\n\nCurrently hangs the CP on this ASIC, deadlock suite disabled\n");
>>                  enable = CU_FALSE;
>>          }
>>
>> +       if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
>> +               use_uc_mtype = 1;
>> +
>>          if (amdgpu_device_deinitialize(device_handle))
>>                  return CU_FALSE;
>>
>> @@ -183,8 +186,8 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
>>          r = amdgpu_cs_ctx_create(device_handle, &context_handle);
>>          CU_ASSERT_EQUAL(r, 0);
>>
>> -       r = amdgpu_bo_alloc_and_map(device_handle, 4096, 4096,
>> -                       AMDGPU_GEM_DOMAIN_GTT, 0,
>> +       r = amdgpu_bo_alloc_and_map_raw(device_handle, 4096, 4096,
>> +                       AMDGPU_GEM_DOMAIN_GTT, 0, use_uc_mtype ? AMDGPU_VM_MTYPE_UC : 0,
>>                                                      &ib_result_handle, &ib_result_cpu,
>>                                                      &ib_result_mc_address, &va_handle);
>>          CU_ASSERT_EQUAL(r, 0);
>> --
>> 2.7.4
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Marek Olšák Oct. 3, 2018, 6:22 p.m. UTC | #3
Yes, Andrey has commit rights.

Marek

On Wed, Oct 3, 2018 at 10:34 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Thanks for keeping working on this.
>
> Series is Reviewed-by: Christian König <christian.koenig@amd.com> as well.
>
> Do you now have commit rights?
>
> Christian.
>
> Am 02.10.2018 um 22:47 schrieb Marek Olšák:
> > For the series:
> >
> > Reviewed-by: Marek Olšák <marek.olsak@amd.com>
> >
> > Marek
> > On Fri, Sep 28, 2018 at 10:46 AM Andrey Grodzovsky
> > <andrey.grodzovsky@amd.com> wrote:
> >> Seems like AI and RV requires uncashed memory mapping to be able
> >> to pickup value written to memory by CPU after the WAIT_REG_MEM
> >> command was already launched.
> >> .
> >> Enable the test for AI and RV.
> >>
> >> v2:
> >> Update commit description.
> >>
> >> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> >> ---
> >>   tests/amdgpu/deadlock_tests.c | 13 ++++++++-----
> >>   1 file changed, 8 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
> >> index 304482d..292ec4e 100644
> >> --- a/tests/amdgpu/deadlock_tests.c
> >> +++ b/tests/amdgpu/deadlock_tests.c
> >> @@ -80,6 +80,8 @@ static  uint32_t  minor_version;
> >>   static pthread_t stress_thread;
> >>   static uint32_t *ptr;
> >>
> >> +int use_uc_mtype = 0;
> >> +
> >>   static void amdgpu_deadlock_helper(unsigned ip_type);
> >>   static void amdgpu_deadlock_gfx(void);
> >>   static void amdgpu_deadlock_compute(void);
> >> @@ -92,13 +94,14 @@ CU_BOOL suite_deadlock_tests_enable(void)
> >>                                               &minor_version, &device_handle))
> >>                  return CU_FALSE;
> >>
> >> -       if (device_handle->info.family_id == AMDGPU_FAMILY_AI ||
> >> -           device_handle->info.family_id == AMDGPU_FAMILY_SI ||
> >> -           device_handle->info.family_id == AMDGPU_FAMILY_RV) {
> >> +       if (device_handle->info.family_id == AMDGPU_FAMILY_SI) {
> >>                  printf("\n\nCurrently hangs the CP on this ASIC, deadlock suite disabled\n");
> >>                  enable = CU_FALSE;
> >>          }
> >>
> >> +       if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
> >> +               use_uc_mtype = 1;
> >> +
> >>          if (amdgpu_device_deinitialize(device_handle))
> >>                  return CU_FALSE;
> >>
> >> @@ -183,8 +186,8 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
> >>          r = amdgpu_cs_ctx_create(device_handle, &context_handle);
> >>          CU_ASSERT_EQUAL(r, 0);
> >>
> >> -       r = amdgpu_bo_alloc_and_map(device_handle, 4096, 4096,
> >> -                       AMDGPU_GEM_DOMAIN_GTT, 0,
> >> +       r = amdgpu_bo_alloc_and_map_raw(device_handle, 4096, 4096,
> >> +                       AMDGPU_GEM_DOMAIN_GTT, 0, use_uc_mtype ? AMDGPU_VM_MTYPE_UC : 0,
> >>                                                      &ib_result_handle, &ib_result_cpu,
> >>                                                      &ib_result_mc_address, &va_handle);
> >>          CU_ASSERT_EQUAL(r, 0);
> >> --
> >> 2.7.4
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Andrey Grodzovsky Oct. 10, 2018, 2:24 p.m. UTC | #4
Sorry for late response, just back from vacation.

Indeed I do have commit rights, I am back now and will finalize

this work soon.

Thanks for the reviews.

Andrey


On 10/03/2018 02:22 PM, Marek Olšák wrote:
> Yes, Andrey has commit rights.
>
> Marek
>
> On Wed, Oct 3, 2018 at 10:34 AM Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Thanks for keeping working on this.
>>
>> Series is Reviewed-by: Christian König <christian.koenig@amd.com> as well.
>>
>> Do you now have commit rights?
>>
>> Christian.
>>
>> Am 02.10.2018 um 22:47 schrieb Marek Olšák:
>>> For the series:
>>>
>>> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
>>>
>>> Marek
>>> On Fri, Sep 28, 2018 at 10:46 AM Andrey Grodzovsky
>>> <andrey.grodzovsky@amd.com> wrote:
>>>> Seems like AI and RV requires uncashed memory mapping to be able
>>>> to pickup value written to memory by CPU after the WAIT_REG_MEM
>>>> command was already launched.
>>>> .
>>>> Enable the test for AI and RV.
>>>>
>>>> v2:
>>>> Update commit description.
>>>>
>>>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>>>> ---
>>>>    tests/amdgpu/deadlock_tests.c | 13 ++++++++-----
>>>>    1 file changed, 8 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
>>>> index 304482d..292ec4e 100644
>>>> --- a/tests/amdgpu/deadlock_tests.c
>>>> +++ b/tests/amdgpu/deadlock_tests.c
>>>> @@ -80,6 +80,8 @@ static  uint32_t  minor_version;
>>>>    static pthread_t stress_thread;
>>>>    static uint32_t *ptr;
>>>>
>>>> +int use_uc_mtype = 0;
>>>> +
>>>>    static void amdgpu_deadlock_helper(unsigned ip_type);
>>>>    static void amdgpu_deadlock_gfx(void);
>>>>    static void amdgpu_deadlock_compute(void);
>>>> @@ -92,13 +94,14 @@ CU_BOOL suite_deadlock_tests_enable(void)
>>>>                                                &minor_version, &device_handle))
>>>>                   return CU_FALSE;
>>>>
>>>> -       if (device_handle->info.family_id == AMDGPU_FAMILY_AI ||
>>>> -           device_handle->info.family_id == AMDGPU_FAMILY_SI ||
>>>> -           device_handle->info.family_id == AMDGPU_FAMILY_RV) {
>>>> +       if (device_handle->info.family_id == AMDGPU_FAMILY_SI) {
>>>>                   printf("\n\nCurrently hangs the CP on this ASIC, deadlock suite disabled\n");
>>>>                   enable = CU_FALSE;
>>>>           }
>>>>
>>>> +       if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
>>>> +               use_uc_mtype = 1;
>>>> +
>>>>           if (amdgpu_device_deinitialize(device_handle))
>>>>                   return CU_FALSE;
>>>>
>>>> @@ -183,8 +186,8 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
>>>>           r = amdgpu_cs_ctx_create(device_handle, &context_handle);
>>>>           CU_ASSERT_EQUAL(r, 0);
>>>>
>>>> -       r = amdgpu_bo_alloc_and_map(device_handle, 4096, 4096,
>>>> -                       AMDGPU_GEM_DOMAIN_GTT, 0,
>>>> +       r = amdgpu_bo_alloc_and_map_raw(device_handle, 4096, 4096,
>>>> +                       AMDGPU_GEM_DOMAIN_GTT, 0, use_uc_mtype ? AMDGPU_VM_MTYPE_UC : 0,
>>>>                                                       &ib_result_handle, &ib_result_cpu,
>>>>                                                       &ib_result_mc_address, &va_handle);
>>>>           CU_ASSERT_EQUAL(r, 0);
>>>> --
>>>> 2.7.4
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index 304482d..292ec4e 100644
--- a/tests/amdgpu/deadlock_tests.c
+++ b/tests/amdgpu/deadlock_tests.c
@@ -80,6 +80,8 @@  static  uint32_t  minor_version;
 static pthread_t stress_thread;
 static uint32_t *ptr;
 
+int use_uc_mtype = 0;
+
 static void amdgpu_deadlock_helper(unsigned ip_type);
 static void amdgpu_deadlock_gfx(void);
 static void amdgpu_deadlock_compute(void);
@@ -92,13 +94,14 @@  CU_BOOL suite_deadlock_tests_enable(void)
 					     &minor_version, &device_handle))
 		return CU_FALSE;
 
-	if (device_handle->info.family_id == AMDGPU_FAMILY_AI ||
-	    device_handle->info.family_id == AMDGPU_FAMILY_SI ||
-	    device_handle->info.family_id == AMDGPU_FAMILY_RV) {
+	if (device_handle->info.family_id == AMDGPU_FAMILY_SI) {
 		printf("\n\nCurrently hangs the CP on this ASIC, deadlock suite disabled\n");
 		enable = CU_FALSE;
 	}
 
+	if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
+		use_uc_mtype = 1;
+
 	if (amdgpu_device_deinitialize(device_handle))
 		return CU_FALSE;
 
@@ -183,8 +186,8 @@  static void amdgpu_deadlock_helper(unsigned ip_type)
 	r = amdgpu_cs_ctx_create(device_handle, &context_handle);
 	CU_ASSERT_EQUAL(r, 0);
 
-	r = amdgpu_bo_alloc_and_map(device_handle, 4096, 4096,
-			AMDGPU_GEM_DOMAIN_GTT, 0,
+	r = amdgpu_bo_alloc_and_map_raw(device_handle, 4096, 4096,
+			AMDGPU_GEM_DOMAIN_GTT, 0, use_uc_mtype ? AMDGPU_VM_MTYPE_UC : 0,
 						    &ib_result_handle, &ib_result_cpu,
 						    &ib_result_mc_address, &va_handle);
 	CU_ASSERT_EQUAL(r, 0);