@@ -668,6 +668,11 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection
668668 if (mlu_memory_supported ()) {
669669 printf (" --use_mlu=<mlu device id>" );
670670 printf (" Use selected MLU device for MLUDirect RDMA testing\n" );
671+
672+ if (mlu_memory_dmabuf_supported ()) {
673+ printf (" --use_mlu_dmabuf" );
674+ printf (" Use DMA-BUF for HW accelerator direct RDMA testing\n" );
675+ }
671676 }
672677
673678 if (opencl_memory_supported ()) {
@@ -913,6 +918,7 @@ static void init_perftest_params(struct perftest_parameters *user_param)
913918 user_param -> rocm_device_id = 0 ;
914919 user_param -> neuron_core_id = 0 ;
915920 user_param -> mlu_device_id = 0 ;
921+ user_param -> use_mlu_dmabuf = 0 ;
916922 user_param -> opencl_platform_id = 0 ;
917923 user_param -> opencl_device_id = 0 ;
918924 user_param -> gpu_touch = GPU_NO_TOUCH ;
@@ -1897,6 +1903,18 @@ static void force_dependecies(struct perftest_parameters *user_param)
18971903 exit (1 );
18981904 }
18991905
1906+ if (user_param -> memory_type == MEMORY_MLU && user_param -> tst == LAT && (user_param -> verb == WRITE || user_param -> verb == WRITE_IMM )) {
1907+ printf (RESULT_LINE );
1908+ fprintf (stderr ,"Perftest supports MLU latency tests with read/send verbs only\n" );
1909+ exit (1 );
1910+ }
1911+
1912+ if (user_param -> memory_type == MEMORY_MLU && (int )user_param -> size <= user_param -> inline_size ) {
1913+ printf (RESULT_LINE );
1914+ fprintf (stderr ,"Perftest doesn't support MLU tests with inline messages\n" );
1915+ exit (1 );
1916+ }
1917+
19001918 if (user_param -> use_data_direct ) {
19011919 user_param -> use_cuda_pcie_mapping = 1 ;
19021920 }
@@ -2045,11 +2063,16 @@ enum ctx_device ib_dev_name(struct ibv_context *context)
20452063 case 5522 : dev_fname = INTEL_GEN2 ; break ;
20462064 default : dev_fname = INTEL_GEN2 ; break ;
20472065 }
2066+ } else if (attr .vendor_id == 0x209b ) {
2067+ switch (attr .vendor_part_id ) {
2068+ case 0x1000 : dev_fname = TCU1 ; break ;
2069+ default : dev_fname = UNKNOWN ; break ;
2070+ }
20482071 } else if (attr .vendor_id == 0x1f67 ) {
20492072 switch (attr .vendor_part_id ) {
2050- case 0x1021 : dev_fname = YUNSILICON_DIAMOND ; break ;
2051- case 0x1023 : dev_fname = YUNSILICON_DIAMOND_NEXT ; break ;
2052- default : dev_fname = YUNSILICON_ANDES ; break ;
2073+ case 0x1021 : dev_fname = YUNSILICON_DIAMOND ; break ;
2074+ case 0x1023 : dev_fname = YUNSILICON_DIAMOND_NEXT ; break ;
2075+ default : dev_fname = YUNSILICON_ANDES ; break ;
20532076 }
20542077 } else {
20552078
@@ -2339,6 +2362,12 @@ static void ctx_set_max_inline(struct ibv_context *context,struct perftest_param
23392362 return ;
23402363 }
23412364
2365+ if (user_param -> memory_type == MEMORY_MLU ){
2366+ user_param -> inline_size = 0 ;
2367+ printf ("Perftest doesn't supports MLU tests with inline messages: inline size set to 0\n" );
2368+ return ;
2369+ }
2370+
23422371 if (user_param -> tst == LAT ) {
23432372 switch (user_param -> verb ) {
23442373 case WRITE_IMM :
@@ -2440,6 +2469,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
24402469 static int use_neuron_dmabuf_flag = 0 ;
24412470 static int use_hl_flag = 0 ;
24422471 static int use_mlu_flag = 0 ;
2472+ static int use_mlu_dmabuf_flag = 0 ;
24432473 static int use_opencl_flag = 0 ;
24442474 static int opencl_platform_id_flag = 0 ;
24452475 static int gpu_touch_flag = 0 ;
@@ -2620,6 +2650,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
26202650 { .name = "use_neuron_dmabuf" , .has_arg = 0 , .flag = & use_neuron_dmabuf_flag , .val = 1 },
26212651 { .name = "use_hl" , .has_arg = 1 , .flag = & use_hl_flag , .val = 1 },
26222652 { .name = "use_mlu" , .has_arg = 1 , .flag = & use_mlu_flag , .val = 1 },
2653+ { .name = "use_mlu_dmabuf" , .has_arg = 0 , .flag = & use_mlu_dmabuf_flag , .val = 1 },
26232654 { .name = "use_opencl" , .has_arg = 1 , .flag = & use_opencl_flag , .val = 1 },
26242655 { .name = "opencl_platform_id" , .has_arg = 1 , .flag = & opencl_platform_id_flag , .val = 1 },
26252656 { .name = "gpu_touch" , .has_arg = 1 , .flag = & gpu_touch_flag , .val = 1 },
@@ -3067,6 +3098,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
30673098 (use_neuron_dmabuf_flag && !neuron_memory_dmabuf_supported ()) ||
30683099 (use_hl_flag && !hl_memory_supported ()) ||
30693100 (use_mlu_flag && !mlu_memory_supported ()) ||
3101+ (use_mlu_dmabuf_flag && !mlu_memory_dmabuf_supported ()) ||
30703102 (use_opencl_flag && !opencl_memory_supported ())) {
30713103 printf (" Unsupported memory type\n" );
30723104 return FAILURE ;
@@ -3181,6 +3213,15 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
31813213 user_param -> memory_create = mlu_memory_create ;
31823214 use_mlu_flag = 0 ;
31833215 }
3216+ if (use_mlu_dmabuf_flag ) {
3217+ user_param -> use_mlu_dmabuf = 1 ;
3218+ if (user_param -> memory_type != MEMORY_MLU ) {
3219+ fprintf (stderr , "MLU DMA-BUF cannot be used without MLU device\n" );
3220+ free (duplicates_checker );
3221+ return FAILURE ;
3222+ }
3223+ use_mlu_dmabuf_flag = 0 ;
3224+ }
31843225
31853226 if (use_opencl_flag ) {
31863227 CHECK_VALUE_NON_NEGATIVE (user_param -> opencl_device_id ,int ,"OPENCL device" ,not_int_ptr );
0 commit comments