DPDK patches and discussions
 help / color / mirror / Atom feed
From: <eagostini@nvidia.com>
To: <dev@dpdk.org>
Cc: Elena Agostini <eagostini@nvidia.com>
Subject: [PATCH] gpu/cuda: add more NVIDIA GPU devices
Date: Wed, 13 Apr 2022 17:38:48 +0000	[thread overview]
Message-ID: <20220413173848.135080-1-eagostini@nvidia.com> (raw)

From: Elena Agostini <eagostini@nvidia.com>

Add more NVIDIA GPU devices to the gpu/cuda driver list
compatible with GPUDirect RDMA.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
 drivers/gpu/cuda/cuda.c    | 173 +++++++++++++++++++++++++++++++------
 drivers/gpu/cuda/devices.h |  74 ++++++++++++++++
 2 files changed, 220 insertions(+), 27 deletions(-)
 create mode 100644 drivers/gpu/cuda/devices.h

diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c
index 9e87c40603..5b8476ac20 100644
--- a/drivers/gpu/cuda/cuda.c
+++ b/drivers/gpu/cuda/cuda.c
@@ -16,6 +16,7 @@
 #include <cudaTypedefs.h>
 
 #include "common.h"
+#include "devices.h"
 
 #define CUDA_DRIVER_MIN_VERSION 11040
 #define CUDA_API_MIN_VERSION 3020
@@ -53,24 +54,6 @@ static unsigned int cuda_api_version;
 static int cuda_driver_version;
 static gdr_t gdrc_h;
 
-/* NVIDIA GPU vendor */
-#define NVIDIA_GPU_VENDOR_ID (0x10de)
-
-/* NVIDIA GPU device IDs */
-#define NVIDIA_GPU_A100_40GB_DEVICE_ID (0x20f1)
-#define NVIDIA_GPU_A100_80GB_DEVICE_ID (0x20b5)
-#define NVIDIA_GPU_A100_80GB_DPU_DEVICE_ID (0x20b8)
-
-#define NVIDIA_GPU_A30_24GB_DEVICE_ID (0x20b7)
-#define NVIDIA_GPU_A30_24GB_DPU_DEVICE_ID (0x20b9)
-#define NVIDIA_GPU_A10_24GB_DEVICE_ID (0x2236)
-
-#define NVIDIA_GPU_V100_32GB_SXM_DEVICE_ID (0x1db5)
-#define NVIDIA_GPU_V100_32GB_PCIE_DEVICE_ID (0x1db6)
-#define NVIDIA_GPU_V100_16GB_DEVICE_ID (0x1db4)
-
-#define NVIDIA_GPU_T4_16GB_DEVICE_ID (0x1eb8)
-
 #define CUDA_MAX_ALLOCATION_NUM 512
 
 #define GPU_PAGE_SHIFT 16
@@ -82,31 +65,79 @@ RTE_LOG_REGISTER_DEFAULT(cuda_logtype, NOTICE);
 static const struct rte_pci_id pci_id_cuda_map[] = {
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_A100_40GB_DEVICE_ID)
+				NVIDIA_GPU_A40_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_A100_80GB_DEVICE_ID)
+				NVIDIA_GPU_A30_24GB_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_A100_80GB_DPU_DEVICE_ID)
+				NVIDIA_GPU_A30X_24GB_DPU_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_A30_24GB_DEVICE_ID)
+				NVIDIA_GPU_A10_24GB_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_A30_24GB_DPU_DEVICE_ID)
+				NVIDIA_GPU_A10G_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_A10_24GB_DEVICE_ID)
+				NVIDIA_GPU_A10M_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_A100_40GB_SXM4_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_A100_40GB_PCIE_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_A100_80GB_SXM4_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_A100_80GB_PCIE_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_A100X_80GB_DPU_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_GA100_PG506_207)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_GA100_PCIE)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_GA100_PG506_217)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_16GB_SXM2_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_16GB_DGXS_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_16GB_FHHL_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_V100_32GB_SXM_DEVICE_ID)
+				NVIDIA_GPU_V100_16GB_PCIE_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_32GB_SXM2_DEVICE_ID)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
@@ -114,11 +145,99 @@ static const struct rte_pci_id pci_id_cuda_map[] = {
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_V100_16GB_DEVICE_ID)
+				NVIDIA_GPU_V100_32GB_DGXS_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_32GB_SXM3_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_32GB_SXM3_H_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100_SXM2)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_V100S_PCIE)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_TITAN_V_CEO_ED)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_GV100GL_PG500_216)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_GV100GL_PG503_216)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_TU102_TITAN_RTX)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_TU102GL_QUADRO_RTX)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_GV100_QUADRO_DEVICE_ID)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_4000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_5000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_6000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_8000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A4000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A6000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A5000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A4500)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A5500)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A2000)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_QUADRO_RTX_A2000_12GB)
+	},
+	{
+		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
+				NVIDIA_GPU_T4G)
 	},
 	{
 		RTE_PCI_DEVICE(NVIDIA_GPU_VENDOR_ID,
-				NVIDIA_GPU_T4_16GB_DEVICE_ID)
+				NVIDIA_GPU_T4)
 	},
 	{
 		.device_id = 0
diff --git a/drivers/gpu/cuda/devices.h b/drivers/gpu/cuda/devices.h
new file mode 100644
index 0000000000..7e90502718
--- /dev/null
+++ b/drivers/gpu/cuda/devices.h
@@ -0,0 +1,74 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 NVIDIA Corporation & Affiliates
+ */
+
+#ifndef CUDA_DEVICES_H
+#define CUDA_DEVICES_H
+
+/* NVIDIA GPU vendor */
+#define NVIDIA_GPU_VENDOR_ID (0x10de)
+
+/* NVIDIA GPU device IDs */
+
+#define NVIDIA_GPU_A40_DEVICE_ID (0x2235)
+#define NVIDIA_GPU_A30_24GB_DEVICE_ID (0x20b7)
+#define NVIDIA_GPU_A30X_24GB_DPU_DEVICE_ID (0x20b9)
+#define NVIDIA_GPU_A10_24GB_DEVICE_ID (0x2236)
+#define NVIDIA_GPU_A10G_DEVICE_ID (0x2237)
+#define NVIDIA_GPU_A10M_DEVICE_ID (0x2238)
+
+#define NVIDIA_GPU_A100_40GB_SXM4_DEVICE_ID (0x20b0)
+#define NVIDIA_GPU_A100_40GB_PCIE_DEVICE_ID (0x20b1)
+#define NVIDIA_GPU_A100_80GB_SXM4_DEVICE_ID (0x20b2)
+#define NVIDIA_GPU_A100_80GB_PCIE_DEVICE_ID (0x20b5)
+#define NVIDIA_GPU_A100X_80GB_DPU_DEVICE_ID (0x20b8)
+
+#define NVIDIA_GPU_GA100_PG506_207 (0x20f0)
+#define NVIDIA_GPU_GA100_PCIE (0x20f1)
+#define NVIDIA_GPU_GA100_PG506_217 (0x20f2)
+
+#define NVIDIA_GPU_V100_16GB_SXM2_DEVICE_ID (0x1db1)
+#define NVIDIA_GPU_V100_16GB_DGXS_DEVICE_ID (0x1db2)
+#define NVIDIA_GPU_V100_16GB_FHHL_DEVICE_ID (0x1db3)
+#define NVIDIA_GPU_V100_16GB_PCIE_DEVICE_ID (0x1db4)
+
+#define NVIDIA_GPU_V100_32GB_SXM2_DEVICE_ID (0x1db5)
+#define NVIDIA_GPU_V100_32GB_PCIE_DEVICE_ID (0x1db6)
+
+
+
+#define NVIDIA_GPU_V100_32GB_DGXS_DEVICE_ID (0x1db7)
+#define NVIDIA_GPU_V100_32GB_SXM3_DEVICE_ID (0x1db8)
+#define NVIDIA_GPU_V100_32GB_SXM3_H_DEVICE_ID (0x131d)
+
+#define NVIDIA_GPU_V100_SXM2 (0x1df5)
+#define NVIDIA_GPU_V100S_PCIE (0x1df6)
+
+
+#define NVIDIA_GPU_TITAN_V_CEO_ED (0x12eb)
+
+#define NVIDIA_GPU_GV100GL_PG500_216 (0x1df0)
+#define NVIDIA_GPU_GV100GL_PG503_216 (0x1df2)
+
+#define NVIDIA_GPU_TU102_TITAN_RTX (0x1e02)
+#define NVIDIA_GPU_TU102GL_QUADRO_RTX (0x1e78)
+
+#define NVIDIA_GPU_GV100_QUADRO_DEVICE_ID (0x1dba)
+#define NVIDIA_GPU_QUADRO_RTX_4000 (0x1eb1)
+#define NVIDIA_GPU_QUADRO_RTX_5000 (0x1eb0)
+#define NVIDIA_GPU_QUADRO_RTX_6000 (0x13d9)
+#define NVIDIA_GPU_QUADRO_RTX_8000 (0x13d8)
+#define NVIDIA_GPU_QUADRO_RTX_A4000 (0x24b0)
+#define NVIDIA_GPU_QUADRO_RTX_A6000 (0x2230)
+#define NVIDIA_GPU_QUADRO_RTX_A5000 (0x2231)
+#define NVIDIA_GPU_QUADRO_RTX_A4500 (0x2232)
+#define NVIDIA_GPU_QUADRO_RTX_A5500 (0x2233)
+#define NVIDIA_GPU_QUADRO_RTX_A2000 (0x2531)
+#define NVIDIA_GPU_QUADRO_RTX_A2000_12GB (0x2571)
+
+#define NVIDIA_GPU_T4G (0x1eb4)
+#define NVIDIA_GPU_T4 (0x1eb8)
+
+/* Quadro */
+
+#endif /* CUDA_DEVICES_H */
-- 
2.25.1


             reply	other threads:[~2022-04-13 18:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 17:38 eagostini [this message]
2022-04-14  8:00 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220413173848.135080-1-eagostini@nvidia.com \
    --to=eagostini@nvidia.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).