All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Let BO created in its allowed_domain
@ 2021-09-17  7:04 xinhui pan
  2021-09-17  7:06 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: xinhui pan @ 2021-09-17  7:04 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, christian.koenig, xinhui pan

For any user BO, it is allowed to alloc memory in both GTT and VRAM
domain. That means one VRAM BO could be eviced to GTT.

Now if device is already lack of VRAM, this BO could alloc memory from
GTT directly without evicting other VRAM BO. In this way we can reduce
memory evictions.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 66bb8a53bb20..9a547bb38cda 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -579,7 +579,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
 			  AMDGPU_GEM_DOMAIN_GDS))
 		amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
 	else
-		amdgpu_bo_placement_from_domain(bo, bp->domain);
+		amdgpu_bo_placement_from_domain(bo, bo->allowed_domains);
 	if (bp->type == ttm_bo_type_kernel)
 		bo->tbo.priority = 1;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: Let BO created in its allowed_domain
  2021-09-17  7:04 [PATCH] drm/amdgpu: Let BO created in its allowed_domain xinhui pan
@ 2021-09-17  7:06 ` Christian König
  2021-09-17  7:35   ` Pan, Xinhui
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2021-09-17  7:06 UTC (permalink / raw)
  To: xinhui pan, amd-gfx; +Cc: alexander.deucher

Am 17.09.21 um 09:04 schrieb xinhui pan:
> For any user BO, it is allowed to alloc memory in both GTT and VRAM
> domain. That means one VRAM BO could be eviced to GTT.
>
> Now if device is already lack of VRAM, this BO could alloc memory from
> GTT directly without evicting other VRAM BO. In this way we can reduce
> memory evictions.

NAK, that is intentional pressure on VRAM during allocation of new memory.

Christian.

>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 66bb8a53bb20..9a547bb38cda 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -579,7 +579,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
>   			  AMDGPU_GEM_DOMAIN_GDS))
>   		amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
>   	else
> -		amdgpu_bo_placement_from_domain(bo, bp->domain);
> +		amdgpu_bo_placement_from_domain(bo, bo->allowed_domains);
>   	if (bp->type == ttm_bo_type_kernel)
>   		bo->tbo.priority = 1;
>   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: Let BO created in its allowed_domain
  2021-09-17  7:06 ` Christian König
@ 2021-09-17  7:35   ` Pan, Xinhui
  2021-09-17  7:42     ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Pan, Xinhui @ 2021-09-17  7:35 UTC (permalink / raw)
  To: amd-gfx, Koenig,  Christian; +Cc: Deucher, Alexander

[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]

[AMD Official Use Only]

Why? just to evict some inactive vram BOs?
________________________________
From: Koenig, Christian <Christian.Koenig@amd.com>
Sent: Friday, September 17, 2021 3:06:16 PM
To: Pan, Xinhui <Xinhui.Pan@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Let BO created in its allowed_domain

Am 17.09.21 um 09:04 schrieb xinhui pan:
> For any user BO, it is allowed to alloc memory in both GTT and VRAM
> domain. That means one VRAM BO could be eviced to GTT.
>
> Now if device is already lack of VRAM, this BO could alloc memory from
> GTT directly without evicting other VRAM BO. In this way we can reduce
> memory evictions.

NAK, that is intentional pressure on VRAM during allocation of new memory.

Christian.

>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 66bb8a53bb20..9a547bb38cda 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -579,7 +579,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
>                          AMDGPU_GEM_DOMAIN_GDS))
>                amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
>        else
> -             amdgpu_bo_placement_from_domain(bo, bp->domain);
> +             amdgpu_bo_placement_from_domain(bo, bo->allowed_domains);
>        if (bp->type == ttm_bo_type_kernel)
>                bo->tbo.priority = 1;
>


[-- Attachment #2: Type: text/html, Size: 3203 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: Let BO created in its allowed_domain
  2021-09-17  7:35   ` Pan, Xinhui
@ 2021-09-17  7:42     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2021-09-17  7:42 UTC (permalink / raw)
  To: Pan, Xinhui, amd-gfx; +Cc: Deucher, Alexander

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

Exactly that, yes. The idea is that we want to create at least some 
pressure on VRAM when VRAM|GTT is specified.

Essentially we would like to have that for CS as well, but it's just 
hard to find the right balance between no pressure and the full pressure 
of VRAM placement for VRAM|GTT BOs.

It's on my todo list to tackle that and I'm currently working on an 
userspace tool to better simulate those setups, but it's just a side 
project.

Christian.

Am 17.09.21 um 09:35 schrieb Pan, Xinhui:
>
> [AMD Official Use Only]
>
>
> Why? just to evict some inactive vram BOs?
> ------------------------------------------------------------------------
> *From:* Koenig, Christian <Christian.Koenig@amd.com>
> *Sent:* Friday, September 17, 2021 3:06:16 PM
> *To:* Pan, Xinhui <Xinhui.Pan@amd.com>; amd-gfx@lists.freedesktop.org 
> <amd-gfx@lists.freedesktop.org>
> *Cc:* Deucher, Alexander <Alexander.Deucher@amd.com>
> *Subject:* Re: [PATCH] drm/amdgpu: Let BO created in its allowed_domain
> Am 17.09.21 um 09:04 schrieb xinhui pan:
> > For any user BO, it is allowed to alloc memory in both GTT and VRAM
> > domain. That means one VRAM BO could be eviced to GTT.
> >
> > Now if device is already lack of VRAM, this BO could alloc memory from
> > GTT directly without evicting other VRAM BO. In this way we can reduce
> > memory evictions.
>
> NAK, that is intentional pressure on VRAM during allocation of new memory.
>
> Christian.
>
> >
> > Signed-off-by: xinhui pan <xinhui.pan@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > index 66bb8a53bb20..9a547bb38cda 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > @@ -579,7 +579,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
> >                          AMDGPU_GEM_DOMAIN_GDS))
> >                amdgpu_bo_placement_from_domain(bo, 
> AMDGPU_GEM_DOMAIN_CPU);
> >        else
> > -             amdgpu_bo_placement_from_domain(bo, bp->domain);
> > +             amdgpu_bo_placement_from_domain(bo, bo->allowed_domains);
> >        if (bp->type == ttm_bo_type_kernel)
> >                bo->tbo.priority = 1;
> >
>


[-- Attachment #2: Type: text/html, Size: 5360 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-17  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17  7:04 [PATCH] drm/amdgpu: Let BO created in its allowed_domain xinhui pan
2021-09-17  7:06 ` Christian König
2021-09-17  7:35   ` Pan, Xinhui
2021-09-17  7:42     ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.