@@ -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 }
@@ -2333,6 +2351,12 @@ static void ctx_set_max_inline(struct ibv_context *context,struct perftest_param
23332351 return ;
23342352 }
23352353
2354+ if (user_param -> memory_type == MEMORY_MLU ){
2355+ user_param -> inline_size = 0 ;
2356+ printf ("Perftest doesn't supports MLU tests with inline messages: inline size set to 0\n" );
2357+ return ;
2358+ }
2359+
23362360 if (user_param -> tst == LAT ) {
23372361 switch (user_param -> verb ) {
23382362 case WRITE_IMM :
@@ -2434,6 +2458,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
24342458 static int use_neuron_dmabuf_flag = 0 ;
24352459 static int use_hl_flag = 0 ;
24362460 static int use_mlu_flag = 0 ;
2461+ static int use_mlu_dmabuf_flag = 0 ;
24372462 static int use_opencl_flag = 0 ;
24382463 static int opencl_platform_id_flag = 0 ;
24392464 static int gpu_touch_flag = 0 ;
@@ -2614,6 +2639,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
26142639 { .name = "use_neuron_dmabuf" , .has_arg = 0 , .flag = & use_neuron_dmabuf_flag , .val = 1 },
26152640 { .name = "use_hl" , .has_arg = 1 , .flag = & use_hl_flag , .val = 1 },
26162641 { .name = "use_mlu" , .has_arg = 1 , .flag = & use_mlu_flag , .val = 1 },
2642+ { .name = "use_mlu_dmabuf" , .has_arg = 0 , .flag = & use_mlu_dmabuf_flag , .val = 1 },
26172643 { .name = "use_opencl" , .has_arg = 1 , .flag = & use_opencl_flag , .val = 1 },
26182644 { .name = "opencl_platform_id" , .has_arg = 1 , .flag = & opencl_platform_id_flag , .val = 1 },
26192645 { .name = "gpu_touch" , .has_arg = 1 , .flag = & gpu_touch_flag , .val = 1 },
@@ -3061,6 +3087,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
30613087 (use_neuron_dmabuf_flag && !neuron_memory_dmabuf_supported ()) ||
30623088 (use_hl_flag && !hl_memory_supported ()) ||
30633089 (use_mlu_flag && !mlu_memory_supported ()) ||
3090+ (use_mlu_dmabuf_flag && !mlu_memory_dmabuf_supported ()) ||
30643091 (use_opencl_flag && !opencl_memory_supported ())) {
30653092 printf (" Unsupported memory type\n" );
30663093 return FAILURE ;
@@ -3175,6 +3202,15 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
31753202 user_param -> memory_create = mlu_memory_create ;
31763203 use_mlu_flag = 0 ;
31773204 }
3205+ if (use_mlu_dmabuf_flag ) {
3206+ user_param -> use_mlu_dmabuf = 1 ;
3207+ if (user_param -> memory_type != MEMORY_MLU ) {
3208+ fprintf (stderr , "MLU DMA-BUF cannot be used without MLU device\n" );
3209+ free (duplicates_checker );
3210+ return FAILURE ;
3211+ }
3212+ use_mlu_dmabuf_flag = 0 ;
3213+ }
31783214
31793215 if (use_opencl_flag ) {
31803216 CHECK_VALUE_NON_NEGATIVE (user_param -> opencl_device_id ,int ,"OPENCL device" ,not_int_ptr );
0 commit comments