Debian Codegraph @

doc/source/configuration/drivers.rst

raw
1 ==================================
2 Accelerator Driver Configuration
3 ==================================
4
5 This document describes how to configure accelerator drivers in Cyborg.
6 The Cyborg agent discovers and manages hardware accelerators through
7 pluggable drivers that are enabled via configuration.
8
9 Enabling Drivers
10 ================
11
12 Drivers are enabled in the ``[agent]`` section of ``cyborg.conf`` using the
13 ``enabled_drivers`` option. This is a comma-separated list of driver names.
14
15 .. code-block:: ini
16
17 [agent]
18 enabled_drivers = intel_fpga_driver, nvidia_gpu_driver
19
20 The driver names correspond to entry points defined in the Cyborg package.
21 Only enabled drivers will be loaded by the cyborg-agent service.
22
23 Available Drivers
24 =================
25
26 The following table lists all available drivers and their supported hardware:
27
28 .. list-table:: Available Accelerator Drivers
29 :widths: 25 15 20 40
30 :header-rows: 1
31
32 * - Driver Name
33 - Vendor ID
34 - Product ID
35 - Description
36 * - ``intel_fpga_driver``
37 - ``0x8086``
38 - ``0x09c4``
39 - Intel FPGA (PAC Arria10)
40 * - ``inspur_fpga_driver``
41 - ``0x1bd4``
42 - (auto-detect)
43 - Inspur FPGA cards
44 * - ``xilinx_fpga_driver``
45 - ``0x10ee``
46 - (auto-detect)
47 - Xilinx FPGA cards
48 * - ``nvidia_gpu_driver``
49 - ``0x10de``
50 - (auto-detect)
51 - NVIDIA GPUs with optional vGPU support
52 * - ``intel_nic_driver``
53 - ``0x8086``
54 - ``0x158b``, ``0x1572``
55 - Intel NIC X710 series
56 * - ``intel_qat_driver``
57 - ``0x8086``
58 - ``0x37c8``
59 - Intel QuickAssist Technology
60 * - ``inspur_nvme_ssd_driver``
61 - ``0x1bd4``
62 - (auto-detect)
63 - Inspur NVMe SSD
64 * - ``huawei_ascend_driver``
65 - ``0x19e5``
66 - ``0xd100``
67 - Huawei Ascend AI chips
68 * - ``pci_driver``
69 - (configurable)
70 - (configurable)
71 - Generic PCI passthrough driver
72 * - ``fake_driver``
73 - ``0xABCD``
74 - ``0xabcd``
75 - Fake driver for testing
76
77 Driver Configuration Reference
78 ==============================
79
80 FPGA Drivers
81 ------------
82
83 The FPGA drivers (``intel_fpga_driver``, ``xilinx_fpga_driver``,
84 ``inspur_fpga_driver``) automatically discover FPGA devices on the host
85 by scanning PCI devices matching their vendor IDs. No additional
86 configuration is required beyond enabling the driver.
87
88 **Intel FPGA Driver**
89
90 The Intel FPGA driver discovers devices via ``/sys/class/fpga`` and
91 ``/sys/bus/pci/devices``. It supports programming bitstreams using
92 ``fpgaconf``.
93
94 .. code-block:: ini
95
96 [agent]
97 enabled_drivers = intel_fpga_driver
98
99 **Xilinx FPGA Driver**
100
101 The Xilinx FPGA driver uses ``lspci`` to discover Xilinx devices and
102 supports programming via the Xilinx Runtime (XRT) tools.
103
104 .. code-block:: ini
105
106 [agent]
107 enabled_drivers = xilinx_fpga_driver
108
109 **Inspur FPGA Driver**
110
111 The Inspur FPGA driver discovers Inspur FPGA cards via ``lspci``.
112
113 .. code-block:: ini
114
115 [agent]
116 enabled_drivers = inspur_fpga_driver
117
118 NVIDIA GPU Driver
119 -----------------
120
121 The NVIDIA GPU driver supports both physical GPUs (pGPUs) and virtual GPUs
122 (vGPUs). For vGPU support, additional configuration is required to map
123 vGPU types to physical GPU PCI addresses.
124
125 **Basic GPU Configuration (pGPU only)**
126
127 For physical GPU passthrough without vGPU:
128
129 .. code-block:: ini
130
131 [agent]
132 enabled_drivers = nvidia_gpu_driver
133
134 **vGPU Configuration**
135
136 To enable vGPU support, configure the ``[gpu_devices]`` section with the
137 vGPU types you want to enable. Each vGPU type requires a corresponding
138 ``[vgpu_<type>]`` section that specifies which physical GPUs should
139 provide that vGPU type.
140
141 .. code-block:: ini
142
143 [agent]
144 enabled_drivers = nvidia_gpu_driver
145
146 [gpu_devices]
147 # List of vGPU types to enable on this compute node
148 # These names correspond to mdev types (e.g., nvidia-35, nvidia-36)
149 enabled_vgpu_types = nvidia-35, nvidia-36
150
151 # Configuration for nvidia-35 vGPU type
152 [vgpu_nvidia-35]
153 # PCI addresses of physical GPUs that will provide this vGPU type
154 device_addresses = 0000:84:00.0,0000:85:00.0
155
156 # Configuration for nvidia-36 vGPU type
157 [vgpu_nvidia-36]
158 device_addresses = 0000:86:00.0
159
160 .. note::
161
162 Each physical GPU can only be configured for one vGPU type. If the
163 same PCI address is specified for multiple vGPU types, the cyborg-agent
164 will raise an ``InvalidGPUConfig`` exception.
165
166 Intel NIC Driver
167 ----------------
168
169 The Intel NIC driver supports Intel X710 series network interface cards.
170 It provides configuration options for mapping physical networks to
171 interfaces and mapping network functions to specific interfaces.
172
173 .. code-block:: ini
174
175 [agent]
176 enabled_drivers = intel_nic_driver
177
178 [nic_devices]
179 # List of NIC configuration profiles to enable
180 enabled_nic_types = x710_static
181
182 # Configuration for the x710_static profile
183 [x710_static]
184 # Map physical networks to interface names
185 # Format: <physical_network>:<interface1>|<interface2>
186 physical_device_mappings = physnet1:eth2|eth3
187
188 # Map network functions to interface names
189 # Format: <function_name>:<interface1>|<interface2>
190 function_device_mappings = GTPv1:eth3|eth2
191
192 **Configuration Options**
193
194 ``physical_device_mappings``
195 Maps OpenStack physical network names to NIC interface names.
196 Multiple interfaces can be specified using the pipe (``|``) separator.
197
198 ``function_device_mappings``
199 Maps network function names to NIC interface names for specialized
200 network processing functions.
201
202 Intel QAT Driver
203 ----------------
204
205 The Intel QAT (QuickAssist Technology) driver discovers Intel QAT devices
206 automatically. No additional configuration is required.
207
208 .. code-block:: ini
209
210 [agent]
211 enabled_drivers = intel_qat_driver
212
213 Inspur NVMe SSD Driver
214 ----------------------
215
216 The Inspur NVMe SSD driver discovers Inspur NVMe storage devices
217 automatically via ``lspci``.
218
219 .. code-block:: ini
220
221 [agent]
222 enabled_drivers = inspur_nvme_ssd_driver
223
224 Huawei Ascend Driver
225 --------------------
226
227 The Huawei Ascend driver discovers Huawei Ascend AI accelerator chips
228 automatically.
229
230 .. code-block:: ini
231
232 [agent]
233 enabled_drivers = huawei_ascend_driver
234
235 Generic PCI Driver
236 ------------------
237
238 The generic PCI driver (``pci_driver``) allows passthrough of arbitrary
239 PCI devices that match a configurable whitelist. This is useful for
240 devices that don't have a dedicated Cyborg driver.
241
242 **Whitelist Configuration**
243
244 The ``[pci]`` section contains a ``passthrough_whitelist`` option that
245 specifies which PCI devices can be managed by Cyborg. The whitelist uses
246 JSON format and supports several matching methods.
247
248 **Match by Vendor and Product ID**
249
250 .. code-block:: ini
251
252 [agent]
253 enabled_drivers = pci_driver
254
255 [pci]
256 # Match devices with specific vendor and product IDs
257 passthrough_whitelist = {"vendor_id":"8086", "product_id":"1520"}
258
259 **Match by PCI Address (Glob Style)**
260
261 Use glob-style patterns to match PCI addresses. The address format is
262 ``domain:bus:slot.function``.
263
264 .. code-block:: ini
265
266 [pci]
267 # Match all functions on bus 0a, slot 00
268 passthrough_whitelist = {"address":"*:0a:00.*"}
269
270 # Match a specific device
271 passthrough_whitelist = {"address":"0000:0b:00.0"}
272
273 **Match by PCI Address (Regex Style)**
274
275 Use regex patterns for more complex address matching:
276
277 .. code-block:: ini
278
279 [pci]
280 # Match devices on bus 02, slot 01, functions 0-2
281 passthrough_whitelist = {"address": {"domain": ".*", "bus": "02", "slot": "01", "function": "[0-2]"}}
282
283 **Multiple Whitelist Entries**
284
285 You can specify multiple whitelist entries to match different device types:
286
287 .. code-block:: ini
288
289 [pci]
290 passthrough_whitelist = {"vendor_id":"8086", "product_id":"1520"}
291 passthrough_whitelist = {"vendor_id":"10de", "product_id":"1eb8"}
292 passthrough_whitelist = {"address":"*:0c:00.*"}
293
294 **Match by Device Name**
295
296 You can also match by network interface name (for NIC devices):
297
298 .. code-block:: ini
299
300 [pci]
301 passthrough_whitelist = {"devname":"eth0"}
302
303 Fake Driver
304 -----------
305
306 The fake driver creates simulated accelerator resources for testing
307 purposes. It does not require any actual hardware.
308
309 .. code-block:: ini
310
311 [agent]
312 enabled_drivers = fake_driver
313
314 Complete Configuration Examples
315 ===============================
316
317 Example 1: Intel FPGA Deployment
318 --------------------------------
319
320 A minimal configuration for Intel FPGA acceleration:
321
322 .. code-block:: ini
323
324 [DEFAULT]
325 transport_url = rabbit://stackrabbit:secret@controller:5672/
326 debug = True
327
328 [database]
329 connection = mysql+pymysql://cyborg:secret@controller/cyborg
330
331 [agent]
332 enabled_drivers = intel_fpga_driver
333
334 [keystone_authtoken]
335 auth_url = http://controller:5000
336 auth_type = password
337 project_name = service
338 username = cyborg
339 password = secret
340 project_domain_name = Default
341 user_domain_name = Default
342
343 [placement]
344 auth_url = http://controller:5000
345 auth_type = password
346 project_name = service
347 username = placement
348 password = secret
349 project_domain_name = Default
350 user_domain_name = Default
351
352 Example 2: NVIDIA GPU with vGPU
353 -------------------------------
354
355 Configuration for NVIDIA GPU with multiple vGPU types:
356
357 .. code-block:: ini
358
359 [DEFAULT]
360 transport_url = rabbit://stackrabbit:secret@controller:5672/
361 debug = True
362
363 [database]
364 connection = mysql+pymysql://cyborg:secret@controller/cyborg
365
366 [agent]
367 enabled_drivers = nvidia_gpu_driver
368
369 [gpu_devices]
370 enabled_vgpu_types = nvidia-35, nvidia-36, nvidia-37
371
372 [vgpu_nvidia-35]
373 # Assign nvidia-35 type to GPUs on slot 84 and 85
374 device_addresses = 0000:84:00.0,0000:85:00.0
375
376 [vgpu_nvidia-36]
377 # Assign nvidia-36 type to GPU on slot 86
378 device_addresses = 0000:86:00.0
379
380 [vgpu_nvidia-37]
381 # Assign nvidia-37 type to GPU on slot 87
382 device_addresses = 0000:87:00.0
383
384 [keystone_authtoken]
385 auth_url = http://controller:5000
386 auth_type = password
387 project_name = service
388 username = cyborg
389 password = secret
390 project_domain_name = Default
391 user_domain_name = Default
392
393 [placement]
394 auth_url = http://controller:5000
395 auth_type = password
396 project_name = service
397 username = placement
398 password = secret
399 project_domain_name = Default
400 user_domain_name = Default
401
402 Example 3: Intel NIC with Network Mappings
403 ------------------------------------------
404
405 Configuration for Intel NIC with physical network mappings:
406
407 .. code-block:: ini
408
409 [DEFAULT]
410 transport_url = rabbit://stackrabbit:secret@controller:5672/
411 debug = True
412
413 [database]
414 connection = mysql+pymysql://cyborg:secret@controller/cyborg
415
416 [agent]
417 enabled_drivers = intel_nic_driver
418
419 [nic_devices]
420 enabled_nic_types = x710_static
421
422 [x710_static]
423 # Map physnet1 to eth2 and eth3 interfaces
424 physical_device_mappings = physnet1:eth2|eth3
425 # Map GTPv1 function to eth3 and eth2
426 function_device_mappings = GTPv1:eth3|eth2
427
428 [keystone_authtoken]
429 auth_url = http://controller:5000
430 auth_type = password
431 project_name = service
432 username = cyborg
433 password = secret
434 project_domain_name = Default
435 user_domain_name = Default
436
437 [placement]
438 auth_url = http://controller:5000
439 auth_type = password
440 project_name = service
441 username = placement
442 password = secret
443 project_domain_name = Default
444 user_domain_name = Default
445
446 Example 4: Generic PCI Passthrough
447 ----------------------------------
448
449 Configuration for generic PCI device passthrough:
450
451 .. code-block:: ini
452
453 [DEFAULT]
454 transport_url = rabbit://stackrabbit:secret@controller:5672/
455 debug = True
456
457 [database]
458 connection = mysql+pymysql://cyborg:secret@controller/cyborg
459
460 [agent]
461 enabled_drivers = pci_driver
462
463 [pci]
464 # Allow Intel I350 NICs
465 passthrough_whitelist = {"vendor_id":"8086", "product_id":"1521"}
466 # Allow all devices on bus 0c
467 passthrough_whitelist = {"address":"*:0c:*.*"}
468
469 [keystone_authtoken]
470 auth_url = http://controller:5000
471 auth_type = password
472 project_name = service
473 username = cyborg
474 password = secret
475 project_domain_name = Default
476 user_domain_name = Default
477
478 [placement]
479 auth_url = http://controller:5000
480 auth_type = password
481 project_name = service
482 username = placement
483 password = secret
484 project_domain_name = Default
485 user_domain_name = Default
486
487 Example 5: Multi-Driver Deployment
488 ----------------------------------
489
490 Configuration enabling multiple accelerator types on a single compute node:
491
492 .. code-block:: ini
493
494 [DEFAULT]
495 transport_url = rabbit://stackrabbit:secret@controller:5672/
496 debug = True
497
498 [database]
499 connection = mysql+pymysql://cyborg:secret@controller/cyborg
500
501 [agent]
502 # Enable multiple drivers
503 enabled_drivers = intel_fpga_driver, nvidia_gpu_driver, intel_qat_driver
504
505 # GPU vGPU configuration
506 [gpu_devices]
507 enabled_vgpu_types = nvidia-35
508
509 [vgpu_nvidia-35]
510 device_addresses = 0000:84:00.0
511
512 [keystone_authtoken]
513 auth_url = http://controller:5000
514 auth_type = password
515 project_name = service
516 username = cyborg
517 password = secret
518 project_domain_name = Default
519 user_domain_name = Default
520
521 [placement]
522 auth_url = http://controller:5000
523 auth_type = password
524 project_name = service
525 username = placement
526 password = secret
527 project_domain_name = Default
528 user_domain_name = Default
529
530 [nova]
531 auth_url = http://controller:5000
532 auth_type = password
533 project_name = service
534 username = nova
535 password = secret
536 project_domain_name = Default
537 user_domain_name = Default
538
539 Discovering PCI Devices
540 =======================
541
542 To identify PCI devices on your system for configuration, use the ``lspci``
543 command:
544
545 .. code-block:: bash
546
547 # List all PCI devices with vendor and product IDs
548 lspci -nn
549
550 # List devices with full PCI addresses
551 lspci -nn -D
552
553 # Filter for specific device types
554 lspci -nn | grep -i nvidia
555 lspci -nn | grep -i fpga
556
557 The output shows the PCI address in ``domain:bus:slot.function`` format
558 along with vendor and product IDs in brackets (e.g., ``[8086:1520]``).
559
560 Troubleshooting
561 ===============
562
563 **Driver not loading**
564
565 Verify the driver name is correctly spelled in ``enabled_drivers`` and
566 matches an entry point in the Cyborg package.
567
568 **Devices not discovered**
569
570 Check that:
571
572 - The hardware is properly installed and recognized by the OS (``lspci``)
573 - The correct driver is enabled
574 - For the PCI driver, the ``passthrough_whitelist`` matches your devices
575
576 **vGPU configuration errors**
577
578 Ensure that:
579
580 - Each PCI address is only assigned to one vGPU type
581 - The vGPU type names match those available on your NVIDIA GPU
582 - The ``[vgpu_<type>]`` section names include the ``vgpu_`` prefix