Commit Graph

7 Commits

Author SHA1 Message Date
Elena Agostini
d69bb47d21 gpudev: expose GPU memory to CPU
Enable the possibility to expose a GPU memory area and make it
accessible from the CPU.

GPU memory has to be allocated via rte_gpu_mem_alloc().

This patch allows the gpudev library to map (and unmap),
through the GPU driver, a chunk of GPU memory and to return
a memory pointer usable by the CPU to access the GPU memory area.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-10 10:06:56 +01:00
Elena Agostini
c8557ed434 gpudev: add alignment for memory allocation
Similarly to rte_malloc, rte_gpu_mem_alloc accepts as
input the memory alignment size.

GPU driver should return GPU memory address aligned
with the input value.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-21 11:33:25 +01:00
Elena Agostini
65ac1464ff gpu/cuda: add NVIDIA GPU A100 identifier for DPU
Adding a new NVIDIA GPU identifier to let
driver recognize the A100 on a DPU card.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-20 14:22:37 +01:00
Elena Agostini
98ddd04c6a gpu/cuda: fix memory list cleanup
Memory list cleanup (called by cuda_mem_free)
was not properly set the new head of the list
when deleting an entry.

Fixes: 1306a73b19 ("gpu/cuda: introduce CUDA driver")
Cc: stable@dpdk.org

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-20 14:17:00 +01:00
Elena Agostini
94220b3977 gpu/cuda: set rte_errno
Set correct rte_errno variable in CUDA driver
and return -rte_errno in case of error.

rte_errno values are compliant with the gpudev library documentation.

Fixes: 1306a73b19 ("gpu/cuda: introduce CUDA driver")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-24 12:00:42 +01:00
Elena Agostini
1674c56dc3 gpudev: manage null parameters in memory functions
The gpudev functions free, register and unregister
return gracefully if input pointer is NULL or size 0,
as API doc was indicating no-op accepted values.

CUDA driver checks are removed because redundant
with the checks added in gpudev library.

Fixes: e818c4e2bf ("gpudev: add memory API")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-24 09:38:43 +01:00
Elena Agostini
1306a73b19 gpu/cuda: introduce CUDA driver
This is the CUDA implementation of the gpudev library.
Functionalities implemented through CUDA Driver API are:
- Device probe and remove
- Manage device memory allocations
- Register/unregister external CPU memory in the device memory area

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-16 17:47:52 +01:00