From 648c9514834b1864e53531aeaefcef73351308a6 Mon Sep 17 00:00:00 2001 From: Shachar Kagan Date: Tue, 29 Oct 2024 15:04:24 +0200 Subject: [PATCH] tests: Update PCIE mapping flag of mlx5 DMABUF Set the appropriate CUDA flag when creating FD for mlx5 DMABUF. This flag is mandatory for data-direct traffic. Signed-off-by: Shachar Kagan Signed-off-by: Edward Srouji --- tests/test_mlx5_dmabuf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_mlx5_dmabuf.py b/tests/test_mlx5_dmabuf.py index 1e0915179..a4de7fa26 100644 --- a/tests/test_mlx5_dmabuf.py +++ b/tests/test_mlx5_dmabuf.py @@ -72,11 +72,13 @@ def create_mr(self): int(self.cuda_addr))) cuda_flag = cuda.CUmemRangeHandleType.CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD + cuda_dma_mapping_type = cuda.CUmemRangeFlags.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE \ + if self.mlx5_access else 0 dmabuf_fd = cu.check_cuda_errors( cuda.cuMemGetHandleForAddressRange(self.cuda_addr, GPU_PAGE_SIZE, cuda_flag, - 0)) + cuda_dma_mapping_type)) try: self.mr = Mlx5DmaBufMR(self.pd, offset=0, length=self.msg_size, access=self.mr_access, fd=dmabuf_fd, mlx5_access=self.mlx5_access)