Skip to contentSkip to conversation

drm/amdkfd: introduce dummy cache info for property asic

PATCH In review Prike Liang 3 participants 9 messages Oct 20, 2022 – Oct 24, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdkfd: introduce dummy cache info for property asic

This dummy cache info will enable kfd base function support.

---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
 1 file changed, 52 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +52 -3
index cd5f8b219bf9..960046e43b7a 100644
@@ -795,6 +795,54 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
 	},
 };
 
+static struct kfd_gpu_cache_info dummy_cache_info[] = {
+	{
+		/* TCP L1 Cache per CU */
+		.cache_size = 16,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 1,
+	},
+	{
+		/* Scalar L1 Instruction Cache per SQC */
+		.cache_size = 32,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_INST_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* Scalar L1 Data Cache per SQC */
+		.cache_size = 16,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* GL1 Data Cache per SA */
+		.cache_size = 128,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 6,
+	},
+	{
+		/* L2 Data Cache per GPU (Total Tex Cache) */
+		.cache_size = 2048,
+		.cache_level = 2,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 6,
+	},
+};
+
 static void kfd_populated_cu_info_cpu(struct kfd_topology_device *dev,
 		struct crat_subtype_computeunit *cu)
 {
@@ -1514,8 +1562,6 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
 			num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
 			break;
 		case IP_VERSION(10, 3, 3):
-		case IP_VERSION(10, 3, 6): /* TODO: Double check these on production silicon */
-		case IP_VERSION(10, 3, 7): /* TODO: Double check these on production silicon */
 			pcache_info = yellow_carp_cache_info;
 			num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
 			break;
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
 				kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
 			break;
 		default:
-			return -EINVAL;
+			pcache_info = dummy_cache_info;
+			num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+			pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+			break;
 		}
 	}
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 drm/amdkfd: update gfx1037 Lx cache setting

Update the gfx1037 L1/L2/L3 cache setting.

---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 53 +++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +53 -0
index 960046e43b7a..6e699cb9971f 100644
@@ -795,6 +795,55 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
 	},
 };
 
+static struct kfd_gpu_cache_info gfx1037_cache_info[] = {
+	{
+		/* TCP L1 Cache per CU */
+		.cache_size = 16,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 1,
+	},
+	{
+		/* Scalar L1 Instruction Cache per SQC */
+		.cache_size = 32,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_INST_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* Scalar L1 Data Cache per SQC */
+		.cache_size = 16,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* GL1 Data Cache per SA */
+		.cache_size = 128,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* L2 Data Cache per GPU (Total Tex Cache) */
+		.cache_size = 256,
+		.cache_level = 2,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+};
+
+
 static struct kfd_gpu_cache_info dummy_cache_info[] = {
 	{
 		/* TCP L1 Cache per CU */
@@ -1565,6 +1614,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
 			pcache_info = yellow_carp_cache_info;
 			num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
 			break;
+		case IP_VERSION(10, 3, 7):
+			pcache_info = gfx1037_cache_info;
+			num_of_cache_types = ARRAY_SIZE(gfx1037_cache_info);
+			break;
 		case IP_VERSION(11, 0, 0):
 		case IP_VERSION(11, 0, 1):
 		case IP_VERSION(11, 0, 2):
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/amdkfd: update gfx1037 Lx cache setting

Series is:

Quoted 82 lines · Prike Liang

Update the gfx1037 L1/L2/L3 cache setting.

---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 53 +++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +53 -1
index 960046e43b7a..6e699cb9971f 100644
@@ -795,6 +795,55 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
        },
 };
 
+static struct kfd_gpu_cache_info gfx1037_cache_info[] = {
+       {
+               /* TCP L1 Cache per CU */
+               .cache_size = 16,
+               .cache_level = 1,
+               .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                               CRAT_CACHE_FLAGS_DATA_CACHE |
+                               CRAT_CACHE_FLAGS_SIMD_CACHE),
+               .num_cu_shared = 1,
+       },
+       {
+               /* Scalar L1 Instruction Cache per SQC */
+               .cache_size = 32,
+               .cache_level = 1,
+               .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                               CRAT_CACHE_FLAGS_INST_CACHE |
+                               CRAT_CACHE_FLAGS_SIMD_CACHE),
+               .num_cu_shared = 2,
+       },
+       {
+               /* Scalar L1 Data Cache per SQC */
+               .cache_size = 16,
+               .cache_level = 1,
+               .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                               CRAT_CACHE_FLAGS_DATA_CACHE |
+                               CRAT_CACHE_FLAGS_SIMD_CACHE),
+               .num_cu_shared = 2,
+       },
+       {
+               /* GL1 Data Cache per SA */
+               .cache_size = 128,
+               .cache_level = 1,
+               .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                               CRAT_CACHE_FLAGS_DATA_CACHE |
+                               CRAT_CACHE_FLAGS_SIMD_CACHE),
+               .num_cu_shared = 2,
+       },
+       {
+               /* L2 Data Cache per GPU (Total Tex Cache) */
+               .cache_size = 256,
+               .cache_level = 2,
+               .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                               CRAT_CACHE_FLAGS_DATA_CACHE |
+                               CRAT_CACHE_FLAGS_SIMD_CACHE),
+               .num_cu_shared = 2,
+       },
+};
+
+
 static struct kfd_gpu_cache_info dummy_cache_info[] = {
        {
                /* TCP L1 Cache per CU */
@@ -1565,6 +1614,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                        pcache_info = yellow_carp_cache_info;
                        num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
                        break;
+               case IP_VERSION(10, 3, 7):
+                       pcache_info = gfx1037_cache_info;
+                       num_of_cache_types = ARRAY_SIZE(gfx1037_cache_info);
+                       break;
                case IP_VERSION(11, 0, 0):
                case IP_VERSION(11, 0, 1):
                case IP_VERSION(11, 0, 2):
--

2.25.1

maintainer
#3 lore raw
In reply to Prike Liang

Am 2022-10-20 um 05:15 schrieb Prike Liang:

Quoted 76 lines

This dummy cache info will enable kfd base function support.

---
  drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
  1 file changed, 52 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +48 -2
index cd5f8b219bf9..960046e43b7a 100644
@@ -795,6 +795,54 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
  	},
  };
 
+static struct kfd_gpu_cache_info dummy_cache_info[] = {
+	{
+		/* TCP L1 Cache per CU */
+		.cache_size = 16,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 1,
+	},
+	{
+		/* Scalar L1 Instruction Cache per SQC */
+		.cache_size = 32,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_INST_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* Scalar L1 Data Cache per SQC */
+		.cache_size = 16,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 2,
+	},
+	{
+		/* GL1 Data Cache per SA */
+		.cache_size = 128,
+		.cache_level = 1,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 6,
+	},
+	{
+		/* L2 Data Cache per GPU (Total Tex Cache) */
+		.cache_size = 2048,
+		.cache_level = 2,
+		.flags = (CRAT_CACHE_FLAGS_ENABLED |
+				CRAT_CACHE_FLAGS_DATA_CACHE |
+				CRAT_CACHE_FLAGS_SIMD_CACHE),
+		.num_cu_shared = 6,
+	},
+};
+
  static void kfd_populated_cu_info_cpu(struct kfd_topology_device *dev,
  		struct crat_subtype_computeunit *cu)
  {
@@ -1514,8 +1562,6 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
  			num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
  			break;
  		case IP_VERSION(10, 3, 3):
-		case IP_VERSION(10, 3, 6): /* TODO: Double check these on production silicon */
-		case IP_VERSION(10, 3, 7): /* TODO: Double check these on production silicon */
  			pcache_info = yellow_carp_cache_info;
  			num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
  			break;

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, · line 1580

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +4 -1
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
  				kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
  			break;
  		default:
-			return -EINVAL;
+			pcache_info = dummy_cache_info;
+			num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+			pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+			break;

Could we make this return an error if the amdgpu.exp_hw_support module parameter is not set?

Regards,
  Felix

Quoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +0 -0
  		}
  	}
 
#4 lore raw

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 12:03 AM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 05:15 schrieb Prike Liang:

Quoted 77 lines

This dummy cache info will enable kfd base function support.

---
  drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
  1 file changed, 52 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +48 -2
index cd5f8b219bf9..960046e43b7a 100644
@@ -795,6 +795,54 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
      },
  };
 
+static struct kfd_gpu_cache_info dummy_cache_info[] = {
+     {
+             /* TCP L1 Cache per CU */
+             .cache_size = 16,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 1,
+     },
+     {
+             /* Scalar L1 Instruction Cache per SQC */
+             .cache_size = 32,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_INST_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 2,
+     },
+     {
+             /* Scalar L1 Data Cache per SQC */
+             .cache_size = 16,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 2,
+     },
+     {
+             /* GL1 Data Cache per SA */
+             .cache_size = 128,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 6,
+     },
+     {
+             /* L2 Data Cache per GPU (Total Tex Cache) */
+             .cache_size = 2048,
+             .cache_level = 2,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 6,
+     },
+};
+
  static void kfd_populated_cu_info_cpu(struct kfd_topology_device *dev,
              struct crat_subtype_computeunit *cu)
  {
@@ -1514,8 +1562,6 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                      num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
                      break;
              case IP_VERSION(10, 3, 3):
-             case IP_VERSION(10, 3, 6): /* TODO: Double check these on production silicon */
-             case IP_VERSION(10, 3, 7): /* TODO: Double check these on production silicon */
                      pcache_info = yellow_carp_cache_info;
                      num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
                      break;

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, · line 1580

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +4 -1
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                              kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
                      break;
              default:
-                     return -EINVAL;
+                     pcache_info = dummy_cache_info;
+                     num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+                     pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+                     break;

Could we make this return an error if the amdgpu.exp_hw_support module parameter is not set?

Regards,
Felix

[Prike] It's fine to protect this dummy info by checking the parameter amdgpu_exp_hw_support, but it may not friendly to end user by adding the parameter and some guys will still report KFD not enabled for this parameter setting problem. The original idea is the end user will not aware the dummy cache info and only alert the warning message to developer.

Quoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +0 -0
              }
      }
 
maintainer
#5 lore raw

Am 2022-10-20 um 21:50 schrieb Liang, Prike:

Quoted 98 lines

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 12:03 AM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 05:15 schrieb Prike Liang:

Quoted 77 lines

This dummy cache info will enable kfd base function support.

---
   drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
   1 file changed, 52 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +48 -2
index cd5f8b219bf9..960046e43b7a 100644
@@ -795,6 +795,54 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
       },
   };
 
+static struct kfd_gpu_cache_info dummy_cache_info[] = {
+     {
+             /* TCP L1 Cache per CU */
+             .cache_size = 16,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 1,
+     },
+     {
+             /* Scalar L1 Instruction Cache per SQC */
+             .cache_size = 32,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_INST_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 2,
+     },
+     {
+             /* Scalar L1 Data Cache per SQC */
+             .cache_size = 16,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 2,
+     },
+     {
+             /* GL1 Data Cache per SA */
+             .cache_size = 128,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 6,
+     },
+     {
+             /* L2 Data Cache per GPU (Total Tex Cache) */
+             .cache_size = 2048,
+             .cache_level = 2,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 6,
+     },
+};
+
   static void kfd_populated_cu_info_cpu(struct kfd_topology_device *dev,
               struct crat_subtype_computeunit *cu)
   {
@@ -1514,8 +1562,6 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                       num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
                       break;
               case IP_VERSION(10, 3, 3):
-             case IP_VERSION(10, 3, 6): /* TODO: Double check these on production silicon */
-             case IP_VERSION(10, 3, 7): /* TODO: Double check these on production silicon */
                       pcache_info = yellow_carp_cache_info;
                       num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
                       break;

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, · line 1580

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +4 -1
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                               kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
                       break;
               default:
-                     return -EINVAL;
+                     pcache_info = dummy_cache_info;
+                     num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+                     pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+                     break;

Could we make this return an error if the amdgpu.exp_hw_support module parameter is not set?

Quoted 4 lines

Regards,
Felix

[Prike] It's fine to protect this dummy info by checking the parameter amdgpu_exp_hw_support, but it may not friendly to end user by adding the parameter and some guys will still report KFD not enabled for this parameter setting problem. The original idea is the end user will not aware the dummy cache info and only alert the warning message to developer.

I thought the intention was to simplify bring-up but make sure that valid cache info is available by the time a chip goes into production. Therefore, normal end users should never need to set the amdgpu_exp_hw_support option. I think you're saying that we would go to production with dummy info. That seems like a bad idea to me.

Regards,
  Felix

Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +0 -0
               }
       }
 
#6 lore raw

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 1:11 PM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 21:50 schrieb Liang, Prike:

Quoted 101 lines

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 12:03 AM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 05:15 schrieb Prike Liang:

Quoted 77 lines

This dummy cache info will enable kfd base function support.

---
   drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
   1 file changed, 52 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +48 -2
index cd5f8b219bf9..960046e43b7a 100644
@@ -795,6 +795,54 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
       },
   };
 
+static struct kfd_gpu_cache_info dummy_cache_info[] = {
+     {
+             /* TCP L1 Cache per CU */
+             .cache_size = 16,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 1,
+     },
+     {
+             /* Scalar L1 Instruction Cache per SQC */
+             .cache_size = 32,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_INST_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 2,
+     },
+     {
+             /* Scalar L1 Data Cache per SQC */
+             .cache_size = 16,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 2,
+     },
+     {
+             /* GL1 Data Cache per SA */
+             .cache_size = 128,
+             .cache_level = 1,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 6,
+     },
+     {
+             /* L2 Data Cache per GPU (Total Tex Cache) */
+             .cache_size = 2048,
+             .cache_level = 2,
+             .flags = (CRAT_CACHE_FLAGS_ENABLED |
+                             CRAT_CACHE_FLAGS_DATA_CACHE |
+                             CRAT_CACHE_FLAGS_SIMD_CACHE),
+             .num_cu_shared = 6,
+     },
+};
+
   static void kfd_populated_cu_info_cpu(struct kfd_topology_device *dev,
               struct crat_subtype_computeunit *cu)
   {
@@ -1514,8 +1562,6 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                       num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
                       break;
               case IP_VERSION(10, 3, 3):
-             case IP_VERSION(10, 3, 6): /* TODO: Double check these on production silicon */
-             case IP_VERSION(10, 3, 7): /* TODO: Double check these on production silicon */
                       pcache_info = yellow_carp_cache_info;
                       num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
                       break;

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, · line 1580

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +4 -1
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                               kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
                       break;
               default:
-                     return -EINVAL;
+                     pcache_info = dummy_cache_info;
+                     num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+                     pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+                     break;

Could we make this return an error if the amdgpu.exp_hw_support module parameter is not set?

Quoted 4 lines

Regards,
Felix

[Prike] It's fine to protect this dummy info by checking the parameter amdgpu_exp_hw_support, but it may not friendly to end user by adding the parameter and some guys will still report KFD not enabled for this parameter setting problem. The original idea is the end user will not aware the dummy cache info and only alert the warning message to developer.

I thought the intention was to simplify bring-up but make sure that valid cache info is available by the time a chip goes into production.
Therefore, normal end users should never need to set the amdgpu_exp_hw_support option. I think you're saying that we would go to production with dummy info. That seems like a bad idea to me.

Regards,
Felix

[Prike] Sorry for the confusion. In fact, this dummy cache info only used before production and meanwhile needn't require any parameter setting for CQE do KFD test. Anyway if you still have concern on this solution I will add the condition of checking amdgpu_exp_hw_support.

Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +0 -0
               }
       }
 
maintainer
#7 lore raw
Quoted 31 lines · Prike

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 1:11 PM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 21:50 schrieb Liang, Prike:

Quoted 21 lines

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 12:03 AM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 05:15 schrieb Prike Liang:

Quoted 7 lines

This dummy cache info will enable kfd base function support.

---
    drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
    1 file changed, 52 insertions(+), 3 deletions(-)

[snip]

Quoted 14 lines
Quoted 14 lines

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, · line 1580

Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +4 -1
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                                kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
                        break;
                default:
-                     return -EINVAL;
+                     pcache_info = dummy_cache_info;
+                     num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+                     pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+                     break;

Could we make this return an error if the amdgpu.exp_hw_support module parameter is not set?

Regards,
Felix

Quoted 8 lines
Quoted 1 line

[Prike] It's fine to protect this dummy info by checking the parameter amdgpu_exp_hw_support, but it may not friendly to end user by adding the parameter and some guys will still report KFD not enabled for this parameter setting problem. The original idea is the end user will not aware the dummy cache info and only alert the warning message to developer.

I thought the intention was to simplify bring-up but make sure that valid cache info is available by the time a chip goes into production.
Therefore, normal end users should never need to set the amdgpu_exp_hw_support option. I think you're saying that we would go to production with dummy info. That seems like a bad idea to me.

Regards,
Felix

[Prike] Sorry for the confusion. In fact, this dummy cache info only used before production and meanwhile needn't require any parameter setting for CQE do KFD test. Anyway if you still have concern on this solution I will add the condition of checking amdgpu_exp_hw_support.

The idea to control this with a module parameter was to cause a more obvious failure if we don't have correct cache info before going to production. Just a warning in the log file is too easy to miss or ignore. Of course, if QA gets into the habit of testing with amdgpu_exp_hw_support, then this may not solve the problem. You need to have at least one test pass without amdgpu_exp_hw_support to catch missing cache info.

Regards,
  Felix

#8 lore raw

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Saturday, October 22, 2022 4:53 AM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Quoted 34 lines · Prike

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 1:11 PM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 21:50 schrieb Liang, Prike:

Quoted 21 lines

[Public]

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, October 21, 2022 12:03 AM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

Am 2022-10-20 um 05:15 schrieb Prike Liang:

Quoted 7 lines

This dummy cache info will enable kfd base function support.

---
    drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +++++++++++++++++++++++++--
    1 file changed, 52 insertions(+), 3 deletions(-)

[snip]

Quoted 14 lines
Quoted 14 lines

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, · line 1580

Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +4 -1
@@ -1528,7 +1574,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                                kfd_fill_gpu_cache_info_from_gfx_config(kdev, pcache_info);
                        break;
                default:
-                     return -EINVAL;
+                     pcache_info = dummy_cache_info;
+                     num_of_cache_types = ARRAY_SIZE(dummy_cache_info);
+                     pr_warn("dummy cache info is used temporarily and real cache info need update later.\n");
+                     break;

Could we make this return an error if the amdgpu.exp_hw_support module parameter is not set?

Regards,
Felix

Quoted 8 lines
Quoted 1 line

[Prike] It's fine to protect this dummy info by checking the parameter amdgpu_exp_hw_support, but it may not friendly to end user by adding the parameter and some guys will still report KFD not enabled for this parameter setting problem. The original idea is the end user will not aware the dummy cache info and only alert the warning message to developer.

I thought the intention was to simplify bring-up but make sure that valid cache info is available by the time a chip goes into production.
Therefore, normal end users should never need to set the amdgpu_exp_hw_support option. I think you're saying that we would go to production with dummy info. That seems like a bad idea to me.

Regards,
Felix

[Prike] Sorry for the confusion. In fact, this dummy cache info only used before production and meanwhile needn't require any parameter setting for CQE do KFD test. Anyway if you still have concern on this solution I will add the condition of checking amdgpu_exp_hw_support.

The idea to control this with a module parameter was to cause a more obvious failure if we don't have correct cache info before going to production. Just a warning in the log file is too easy to miss or ignore. Of course, if QA gets into the habit of testing with amdgpu_exp_hw_support, then this may not solve the problem. You need to have at least one test pass without amdgpu_exp_hw_support to catch missing cache info.

Regards,
Felix

Get your point. As to the KFD support on a NPI will be tracked by a ticket which make sure the real cache info update later after this dummy cache info assigned in the early BU phase.

Thanks,
Prike