All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Print node id in peer map failure message
@ 2022-02-16  1:42 Harish Kasiviswanathan
  2022-02-16 17:08 ` Felix Kuehling
  0 siblings, 1 reply; 5+ messages in thread
From: Harish Kasiviswanathan @ 2022-02-16  1:42 UTC (permalink / raw)
  To: amd-gfx; +Cc: Harish Kasiviswanathan

Print alloc node, peer node and memory domain when peer map fails. This
is more useful

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 965af2a08bc0..4d62784c7cc3 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -1215,8 +1215,9 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
 			peer_pdd->dev->adev, (struct kgd_mem *)mem,
 			peer_pdd->drm_priv, &table_freed);
 		if (err) {
-			pr_err("Failed to map to gpu %d/%d\n",
-			       i, args->n_devices);
+			pr_err("Failed to map peer:%d alloc:%d domain:%d\n",
+			       peer_pdd->dev->id, dev->id,
+			       ((struct kgd_mem *)mem)->domain);
 			goto map_memory_to_gpu_failed;
 		}
 		args->n_success = i+1;
-- 
2.25.1


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

* Re: [PATCH] drm/amdgpu: Print node id in peer map failure message
  2022-02-16  1:42 [PATCH] drm/amdgpu: Print node id in peer map failure message Harish Kasiviswanathan
@ 2022-02-16 17:08 ` Felix Kuehling
  2022-02-22 18:55   ` [PATCH v2] drm/amdkfd: Print bdf " Harish Kasiviswanathan
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Kuehling @ 2022-02-16 17:08 UTC (permalink / raw)
  To: amd-gfx, Kasiviswanathan, Harish

Am 2022-02-15 um 20:42 schrieb Harish Kasiviswanathan:
> Print alloc node, peer node and memory domain when peer map fails. This
> is more useful
>
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 965af2a08bc0..4d62784c7cc3 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -1215,8 +1215,9 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
>   			peer_pdd->dev->adev, (struct kgd_mem *)mem,
>   			peer_pdd->drm_priv, &table_freed);
>   		if (err) {
> -			pr_err("Failed to map to gpu %d/%d\n",
> -			       i, args->n_devices);
> +			pr_err("Failed to map peer:%d alloc:%d domain:%d\n",
> +			       peer_pdd->dev->id, dev->id,

Not sure if the dev->id is the most descriptive way to name the GPU 
because none of our user mode tools really expose that number. If you 
use dev_err instead of pr_err, you get a nicer way of printing one of 
the devices for free (probably the dev->adev->dev). For the peer you 
could manually print the PCI B:D.F.

Regards,
   Felix


> +			       ((struct kgd_mem *)mem)->domain);
>   			goto map_memory_to_gpu_failed;
>   		}
>   		args->n_success = i+1;

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

* [PATCH v2] drm/amdkfd: Print bdf in peer map failure message
  2022-02-16 17:08 ` Felix Kuehling
@ 2022-02-22 18:55   ` Harish Kasiviswanathan
  2022-02-22 18:58     ` Alex Deucher
  2022-02-22 20:01     ` Felix Kuehling
  0 siblings, 2 replies; 5+ messages in thread
From: Harish Kasiviswanathan @ 2022-02-22 18:55 UTC (permalink / raw)
  To: amd-gfx; +Cc: Harish Kasiviswanathan

Print alloc node, peer node and memory domain when peer map fails. This
is more useful

v2: use dev_err instead of pr_err
    use bdf for identify peer gpu

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 965af2a08bc0..9141b674947d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -1215,8 +1215,15 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
 			peer_pdd->dev->adev, (struct kgd_mem *)mem,
 			peer_pdd->drm_priv, &table_freed);
 		if (err) {
-			pr_err("Failed to map to gpu %d/%d\n",
-			       i, args->n_devices);
+			struct pci_dev *pdev = peer_pdd->dev->adev->pdev;
+
+			dev_err(dev->adev->dev,
+			       "Failed to map peer:%04x:%02x:%02x.%d mem_domain:%d\n",
+			       pci_domain_nr(pdev->bus),
+			       pdev->bus->number,
+			       PCI_SLOT(pdev->devfn),
+			       PCI_FUNC(pdev->devfn),
+			       ((struct kgd_mem *)mem)->domain);
 			goto map_memory_to_gpu_failed;
 		}
 		args->n_success = i+1;
-- 
2.25.1


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

* Re: [PATCH v2] drm/amdkfd: Print bdf in peer map failure message
  2022-02-22 18:55   ` [PATCH v2] drm/amdkfd: Print bdf " Harish Kasiviswanathan
@ 2022-02-22 18:58     ` Alex Deucher
  2022-02-22 20:01     ` Felix Kuehling
  1 sibling, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2022-02-22 18:58 UTC (permalink / raw)
  To: Harish Kasiviswanathan; +Cc: amd-gfx list

On Tue, Feb 22, 2022 at 1:56 PM Harish Kasiviswanathan
<Harish.Kasiviswanathan@amd.com> wrote:
>
> Print alloc node, peer node and memory domain when peer map fails. This
> is more useful
>
> v2: use dev_err instead of pr_err
>     use bdf for identify peer gpu
>
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 965af2a08bc0..9141b674947d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -1215,8 +1215,15 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
>                         peer_pdd->dev->adev, (struct kgd_mem *)mem,
>                         peer_pdd->drm_priv, &table_freed);
>                 if (err) {
> -                       pr_err("Failed to map to gpu %d/%d\n",
> -                              i, args->n_devices);
> +                       struct pci_dev *pdev = peer_pdd->dev->adev->pdev;
> +
> +                       dev_err(dev->adev->dev,
> +                              "Failed to map peer:%04x:%02x:%02x.%d mem_domain:%d\n",
> +                              pci_domain_nr(pdev->bus),
> +                              pdev->bus->number,
> +                              PCI_SLOT(pdev->devfn),
> +                              PCI_FUNC(pdev->devfn),
> +                              ((struct kgd_mem *)mem)->domain);
>                         goto map_memory_to_gpu_failed;
>                 }
>                 args->n_success = i+1;
> --
> 2.25.1
>

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

* Re: [PATCH v2] drm/amdkfd: Print bdf in peer map failure message
  2022-02-22 18:55   ` [PATCH v2] drm/amdkfd: Print bdf " Harish Kasiviswanathan
  2022-02-22 18:58     ` Alex Deucher
@ 2022-02-22 20:01     ` Felix Kuehling
  1 sibling, 0 replies; 5+ messages in thread
From: Felix Kuehling @ 2022-02-22 20:01 UTC (permalink / raw)
  To: Harish Kasiviswanathan, amd-gfx

Am 2022-02-22 um 13:55 schrieb Harish Kasiviswanathan:
> Print alloc node, peer node and memory domain when peer map fails. This
> is more useful
>
> v2: use dev_err instead of pr_err
>      use bdf for identify peer gpu
>
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 965af2a08bc0..9141b674947d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -1215,8 +1215,15 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
>   			peer_pdd->dev->adev, (struct kgd_mem *)mem,
>   			peer_pdd->drm_priv, &table_freed);
>   		if (err) {
> -			pr_err("Failed to map to gpu %d/%d\n",
> -			       i, args->n_devices);
> +			struct pci_dev *pdev = peer_pdd->dev->adev->pdev;
> +
> +			dev_err(dev->adev->dev,
> +			       "Failed to map peer:%04x:%02x:%02x.%d mem_domain:%d\n",
> +			       pci_domain_nr(pdev->bus),
> +			       pdev->bus->number,
> +			       PCI_SLOT(pdev->devfn),
> +			       PCI_FUNC(pdev->devfn),
> +			       ((struct kgd_mem *)mem)->domain);
>   			goto map_memory_to_gpu_failed;
>   		}
>   		args->n_success = i+1;

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

end of thread, other threads:[~2022-02-22 20:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  1:42 [PATCH] drm/amdgpu: Print node id in peer map failure message Harish Kasiviswanathan
2022-02-16 17:08 ` Felix Kuehling
2022-02-22 18:55   ` [PATCH v2] drm/amdkfd: Print bdf " Harish Kasiviswanathan
2022-02-22 18:58     ` Alex Deucher
2022-02-22 20:01     ` Felix Kuehling

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.