gpudev: add child device representing a device context
[dpdk.git] / doc / guides / prog_guide / gpudev.rst
1 .. SPDX-License-Identifier: BSD-3-Clause
2    Copyright (c) 2021 NVIDIA Corporation & Affiliates
3
4 General-Purpose Graphics Processing Unit Library
5 ================================================
6
7 When mixing networking activity with task processing on a GPU device,
8 there may be the need to put in communication the CPU with the device
9 in order to manage the memory, synchronize operations, exchange info, etc..
10
11 By means of the generic GPU interface provided by this library,
12 it is possible to allocate a chunk of GPU memory and use it
13 to create a DPDK mempool with external mbufs having the payload
14 on the GPU memory, enabling any network interface card
15 (which support this feature like Mellanox NIC)
16 to directly transmit and receive packets using GPU memory.
17
18 Additionally, this library provides a number of functions
19 to enhance the dialog between CPU and GPU.
20
21 Out of scope of this library is to provide a wrapper for GPU specific libraries
22 (e.g. CUDA Toolkit or OpenCL), thus it is not possible to launch workload
23 on the device or create GPU specific objects
24 (e.g. CUDA Driver context or CUDA Streams in case of NVIDIA GPUs).
25
26
27 Features
28 --------
29
30 This library provides a number of features:
31
32 - Interoperability with device-specific library through generic handlers.
33
34
35 API Overview
36 ------------
37
38 Child Device
39 ~~~~~~~~~~~~
40
41 By default, DPDK PCIe module detects and registers physical GPU devices
42 in the system.
43 With the gpudev library is also possible to add additional non-physical devices
44 through an ``uint64_t`` generic handler (e.g. CUDA Driver context)
45 that will be registered internally by the driver as an additional device (child)
46 connected to a physical device (parent).
47 Each device (parent or child) is represented through a ID
48 required to indicate which device a given operation should be executed on.