gpu
zeus.device.gpu
GPU management module for Zeus.
ZeusGPUInitError
Bases: ZeusBaseGPUError
Import error or GPU library initialization failures.
Source code in zeus/device/gpu.py
23 24 25 26 27 28 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
26 27 28 |
|
ZeusGPUInvalidArgError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Invalid Argument.
Source code in zeus/device/gpu.py
31 32 33 34 35 36 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
34 35 36 |
|
ZeusGPUNotSupportedError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Not Supported Operation on GPU.
Source code in zeus/device/gpu.py
39 40 41 42 43 44 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
42 43 44 |
|
ZeusGPUNoPermissionError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for No Permission to perform GPU operation.
Source code in zeus/device/gpu.py
47 48 49 50 51 52 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
50 51 52 |
|
ZeusGPUAlreadyInitializedError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Already Initialized GPU.
Source code in zeus/device/gpu.py
55 56 57 58 59 60 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
58 59 60 |
|
ZeusGPUNotFoundError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Not Found GPU.
Source code in zeus/device/gpu.py
63 64 65 66 67 68 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
66 67 68 |
|
ZeusGPUInsufficientSizeError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Insufficient Size.
Source code in zeus/device/gpu.py
71 72 73 74 75 76 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
74 75 76 |
|
ZeusGPUInsufficientPowerError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Insufficient Power.
Source code in zeus/device/gpu.py
79 80 81 82 83 84 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
82 83 84 |
|
ZeusGPUDriverNotLoadedError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Driver Error.
Source code in zeus/device/gpu.py
87 88 89 90 91 92 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
90 91 92 |
|
ZeusGPUTimeoutError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Timeout Error.
Source code in zeus/device/gpu.py
95 96 97 98 99 100 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
98 99 100 |
|
ZeusGPUIRQError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for IRQ Error.
Source code in zeus/device/gpu.py
103 104 105 106 107 108 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
106 107 108 |
|
ZeusGPULibraryNotFoundError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Library Not Found Error.
Source code in zeus/device/gpu.py
111 112 113 114 115 116 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
114 115 116 |
|
ZeusGPUFunctionNotFoundError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Function Not Found Error.
Source code in zeus/device/gpu.py
119 120 121 122 123 124 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
122 123 124 |
|
ZeusGPUCorruptedInfoROMError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Corrupted Info ROM Error.
Source code in zeus/device/gpu.py
127 128 129 130 131 132 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
130 131 132 |
|
ZeusGPULostError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Lost GPU Error.
Source code in zeus/device/gpu.py
135 136 137 138 139 140 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
138 139 140 |
|
ZeusGPUResetRequiredError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Reset Required Error.
Source code in zeus/device/gpu.py
143 144 145 146 147 148 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
146 147 148 |
|
ZeusGPUOperatingSystemError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Operating System Error.
Source code in zeus/device/gpu.py
151 152 153 154 155 156 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
154 155 156 |
|
ZeusGPULibRMVersionMismatchError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for LibRM Version Mismatch Error.
Source code in zeus/device/gpu.py
159 160 161 162 163 164 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
162 163 164 |
|
ZeusGPUMemoryError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Insufficient Memory Error.
Source code in zeus/device/gpu.py
167 168 169 170 171 172 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
170 171 172 |
|
ZeusGPUUnknownError
Bases: ZeusBaseGPUError
Zeus GPU exception class Wrapper for Unknown Error.
Source code in zeus/device/gpu.py
175 176 177 178 179 180 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
178 179 180 |
|
GPU
Bases: ABC
Abstract base class for GPU management.
This class defines the interface for interacting with GPUs, subclasses should implement the methods to interact with specific GPU libraries (e.g., NVML for NVIDIA GPUs).
Source code in zeus/device/gpu.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
193 194 195 |
|
getPowerManagementLimitConstraints
abstractmethod
1 |
|
Return the minimum and maximum power management limits for the GPU. Units: mW.
Source code in zeus/device/gpu.py
197 198 199 200 |
|
setPersistenceMode
abstractmethod
1 |
|
Enable persistence mode for the GPU.
Source code in zeus/device/gpu.py
202 203 204 205 |
|
setPowerManagementLimit
abstractmethod
1 |
|
Set the power management limit for the GPU to a specified value or default. Unit: mW.
Source code in zeus/device/gpu.py
207 208 209 210 |
|
resetPowerManagementLimit
abstractmethod
1 |
|
Resets the power management limit for the specified GPU to the default value.
Source code in zeus/device/gpu.py
212 213 214 215 |
|
setMemoryLockedClocks
abstractmethod
1 |
|
Lock the memory clock to a specified range. Units: MHz.
Source code in zeus/device/gpu.py
217 218 219 220 |
|
getSupportedMemoryClocks
abstractmethod
1 |
|
Return a list of supported memory clock frequencies for the GPU. Units: MHz.
Source code in zeus/device/gpu.py
222 223 224 225 |
|
getSupportedGraphicsClocks
abstractmethod
1 |
|
Return a list of supported graphics clock frequencies for a given memory frequency. Units: MHz.
Source code in zeus/device/gpu.py
227 228 229 230 |
|
getName
abstractmethod
1 |
|
Return the name of the GPU.
Source code in zeus/device/gpu.py
232 233 234 235 |
|
setGpuLockedClocks
abstractmethod
1 |
|
Lock the GPU clock to a specified range. Units: MHz.
Source code in zeus/device/gpu.py
237 238 239 240 |
|
resetMemoryLockedClocks
abstractmethod
1 |
|
Reset the memory locked clocks to default values.
Source code in zeus/device/gpu.py
242 243 244 245 |
|
resetGpuLockedClocks
abstractmethod
1 |
|
Reset the GPU locked clocks to default values.
Source code in zeus/device/gpu.py
247 248 249 250 |
|
getPowerUsage
abstractmethod
1 |
|
Return the current power usage of the GPU. Units: mW.
Source code in zeus/device/gpu.py
252 253 254 255 |
|
supportsGetTotalEnergyConsumption
abstractmethod
1 |
|
Check if the GPU supports retrieving total energy consumption.
Source code in zeus/device/gpu.py
257 258 259 260 |
|
getTotalEnergyConsumption
abstractmethod
1 |
|
Return the total energy consumption of the GPU since driver load. Units: mJ.
Source code in zeus/device/gpu.py
262 263 264 265 |
|
NVIDIAGPU
Bases: GPU
Control a Single NVIDIA GPU.
Uses NVML Library to control and query GPU. There is a 1:1 mapping between the methods in this class and the NVML library functions. Zeus GPU Exceptions are raised when NVML errors occur. To ensure computational efficiency, this class utilizes caching (ex. saves the handle) to avoid repeated calls to NVML.
Source code in zeus/device/gpu.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
291 292 293 294 295 |
|
getPowerManagementLimitConstraints
1 |
|
Returns the minimum and maximum power management limits for the specified GPU. Units: mW.
Source code in zeus/device/gpu.py
324 325 326 327 328 |
|
setPersistenceMode
1 |
|
If enable = True, enables persistence mode for the specified GPU. If enable = False, disables persistence mode.
Source code in zeus/device/gpu.py
330 331 332 333 334 335 336 337 338 339 340 |
|
setPowerManagementLimit
1 |
|
Sets the power management limit for the specified GPU to the given value. Unit: mW.
Source code in zeus/device/gpu.py
342 343 344 345 |
|
resetPowerManagementLimit
1 |
|
Resets the power management limit for the specified GPU to the default value.
Source code in zeus/device/gpu.py
347 348 349 350 351 352 353 |
|
setMemoryLockedClocks
1 |
|
Locks the memory clock of the specified GPU to a range defined by the minimum and maximum memory clock frequencies. Units: MHz.
Source code in zeus/device/gpu.py
355 356 357 358 359 360 |
|
getSupportedMemoryClocks
1 |
|
Returns a list of supported memory clock frequencies for the specified GPU. Units: MHz.
Source code in zeus/device/gpu.py
362 363 364 365 |
|
getSupportedGraphicsClocks
1 |
|
Returns a list of supported graphics clock frequencies for the specified GPU at a given frequency. Units: MHz.
Source code in zeus/device/gpu.py
367 368 369 370 |
|
getName
1 |
|
Returns the name of the specified GPU.
Source code in zeus/device/gpu.py
372 373 374 375 |
|
setGpuLockedClocks
1 |
|
Locks the GPU clock of the specified GPU to a range defined by the minimum and maximum GPU clock frequencies. Units: MHz.
Source code in zeus/device/gpu.py
377 378 379 380 |
|
resetMemoryLockedClocks
1 |
|
Resets the memory locked clocks of the specified GPU to their default values.
Source code in zeus/device/gpu.py
382 383 384 385 |
|
resetGpuLockedClocks
1 |
|
Resets the GPU locked clocks of the specified GPU to their default values.
Source code in zeus/device/gpu.py
387 388 389 390 |
|
getPowerUsage
1 |
|
Returns the power usage of the specified GPU. Units: mW.
Source code in zeus/device/gpu.py
392 393 394 395 |
|
supportsGetTotalEnergyConsumption
1 |
|
Returns True if the specified GPU supports retrieving the total energy consumption.
Source code in zeus/device/gpu.py
397 398 399 400 401 402 403 404 405 406 407 |
|
getTotalEnergyConsumption
1 |
|
Returns the total energy consumption of the specified GPU. Units: mJ.
Source code in zeus/device/gpu.py
409 410 411 412 |
|
UnprivilegedNVIDIAGPU
Bases: NVIDIAGPU
Control a Single NVIDIA GPU with no SYS_ADMIN privileges.
Uses NVML Library to control and query GPU. There is a 1:1 mapping between the methods in this class and the NVML library functions. Zeus GPU Exceptions are raised when NVML errors occur. To ensure computational efficiency, this class utilizes caching (ex. saves the handle) to avoid repeated calls to NVML.
Source code in zeus/device/gpu.py
415 416 417 418 419 420 421 422 423 |
|
AMDGPU
Bases: GPU
Control a Single AMD GPU.
Uses amdsmi Library to control and query GPU. There is a 1:1 mapping between the methods in this class and the amdsmi library functions. Zeus GPU Exceptions are raised when amdsmi errors occur. To ensure computational efficiency, this class utilizes caching (ex. saves the handle) to avoid repeated calls to amdsmi.
Source code in zeus/device/gpu.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
|
__init__
1 |
|
Source code in zeus/device/gpu.py
446 447 448 449 |
|
getPowerManagementLimitConstraints
1 |
|
Returns the minimum and maximum power management limits for the specified GPU. Units: mW.
Source code in zeus/device/gpu.py
457 458 459 460 461 |
|
setPersistenceMode
1 |
|
Enables persistence mode for the specified GPU.
Source code in zeus/device/gpu.py
463 464 465 466 467 468 469 470 |
|
setPowerManagementLimit
1 |
|
Sets the power management limit for the specified GPU to the given value. Unit: mW.
Source code in zeus/device/gpu.py
472 473 474 475 |
|
resetPowerManagementLimit
1 |
|
Resets the power management limit for the specified GPU to the default value.
Source code in zeus/device/gpu.py
477 478 479 480 481 482 483 |
|
setMemoryLockedClocks
1 |
|
Locks the memory clock of the specified GPU to a range defined by the minimum and maximum memory clock frequencies. Units: MHz.
Source code in zeus/device/gpu.py
485 486 487 488 489 490 491 492 493 |
|
getSupportedMemoryClocks
1 |
|
Returns a list of supported memory clock frequencies for the specified GPU. Units: MHz.
Source code in zeus/device/gpu.py
495 496 497 498 499 500 501 502 |
|
getSupportedGraphicsClocks
1 |
|
Returns a list of supported graphics clock frequencies for the specified GPU at a given frequency. Units: MHz.
Source code in zeus/device/gpu.py
504 505 506 507 508 509 |
|
getName
1 |
|
Returns the name of the specified GPU.
Source code in zeus/device/gpu.py
511 512 513 514 515 516 517 518 519 520 521 522 523 |
|
setGpuLockedClocks
1 |
|
Locks the GPU clock of the specified GPU to a range defined by the minimum and maximum GPU clock frequencies. Units: MHz.
Source code in zeus/device/gpu.py
525 526 527 528 529 530 531 532 533 |
|
resetMemoryLockedClocks
1 |
|
Resets the memory locked clocks of the specified GPU to their default values.
Source code in zeus/device/gpu.py
535 536 537 538 539 540 |
|
resetGpuLockedClocks
1 |
|
Resets the GPU locked clocks of the specified GPU to their default values.
Source code in zeus/device/gpu.py
542 543 544 545 546 547 |
|
getPowerUsage
1 |
|
Returns the power usage of the specified GPU. Units: mW.
Source code in zeus/device/gpu.py
549 550 551 552 553 554 |
|
supportsGetTotalEnergyConsumption
1 |
|
Returns True if the specified GPU supports retrieving the total energy consumption.
Source code in zeus/device/gpu.py
556 557 558 559 560 561 |
|
getTotalEnergyConsumption
1 |
|
Returns the total energy consumption of the specified GPU. Units: mJ.
Source code in zeus/device/gpu.py
563 564 565 566 567 568 |
|
UnprivilegedAMDGPU
Bases: AMDGPU
Control a Single AMD GPU with no SYS_ADMIN privileges.
Uses amdsmi Library to control and query GPU. There is a 1:1 mapping between the methods in this class and the amdsmi library functions. Zeus GPU Exceptions are raised when amdsmi errors occur. To ensure computational efficiency, this class utilizes caching (ex. saves the handle) to avoid repeated calls to amdsmi.
Source code in zeus/device/gpu.py
571 572 573 574 575 576 577 578 579 |
|
GPUs
Bases: ABC
An abstract base class for GPU manager object.
This class defines the essential interface and common functionality for GPU management, instantiating multiple GPU
objects for each GPU being tracked.
Forwards the call for a specific method to the corresponding GPU object.
Source code in zeus/device/gpu.py
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
|
gpus
abstractmethod
property
1 |
|
Returns a list of GPU objects being tracked.
__init__
abstractmethod
1 |
|
Source code in zeus/device/gpu.py
589 590 591 592 |
|
__del__
abstractmethod
1 |
|
Shuts down the GPU monitoring library to release resources and clean up.
Source code in zeus/device/gpu.py
594 595 596 597 |
|
_ensure_homogeneous
1 |
|
Ensures that all tracked GPUs are homogeneous in terms of name.
Source code in zeus/device/gpu.py
605 606 607 608 609 610 |
|
getPowerManagementLimitConstraints
1 |
|
Returns the minimum and maximum power management limits for the specified GPU. Units: mW.
Source code in zeus/device/gpu.py
612 613 614 |
|
setPersistenceMode
1 |
|
Enables persistence mode for the specified GPU.
Source code in zeus/device/gpu.py
616 617 618 |
|
setPowerManagementLimit
1 |
|
Sets the power management limit for the specified GPU to the given value. Unit: mW.
Source code in zeus/device/gpu.py
620 621 622 |
|
resetPowerManagementLimit
1 |
|
Resets the power management limit for the specified GPU to the default value.
Source code in zeus/device/gpu.py
624 625 626 |
|
setMemoryLockedClocks
1 2 3 |
|
Locks the memory clock of the specified GPU to a range defined by the minimum and maximum memory clock frequencies. Units: MHz.
Source code in zeus/device/gpu.py
628 629 630 631 632 |
|
getSupportedMemoryClocks
1 |
|
Returns a list of supported memory clock frequencies for the specified GPU. Units: MHz.
Source code in zeus/device/gpu.py
634 635 636 |
|
getSupportedGraphicsClocks
1 |
|
Returns a list of supported graphics clock frequencies for the specified GPU at a given frequency. Units: MHz.
Source code in zeus/device/gpu.py
638 639 640 |
|
getName
1 |
|
Returns the name of the specified GPU.
Source code in zeus/device/gpu.py
642 643 644 |
|
setGpuLockedClocks
1 |
|
Locks the GPU clock of the specified GPU to a range defined by the minimum and maximum GPU clock frequencies. Units: MHz.
Source code in zeus/device/gpu.py
646 647 648 649 650 |
|
resetMemoryLockedClocks
1 |
|
Resets the memory locked clocks of the specified GPU to their default values.
Source code in zeus/device/gpu.py
652 653 654 |
|
resetGpuLockedClocks
1 |
|
Resets the GPU locked clocks of the specified GPU to their default values.
Source code in zeus/device/gpu.py
656 657 658 |
|
getPowerUsage
1 |
|
Returns the power usage of the specified GPU. Units: mW.
Source code in zeus/device/gpu.py
660 661 662 |
|
supportsGetTotalEnergyConsumption
1 |
|
Returns True if the specified GPU supports retrieving the total energy consumption.
Source code in zeus/device/gpu.py
664 665 666 |
|
getTotalEnergyConsumption
1 |
|
Returns the total energy consumption of the specified GPU. Units: mJ.
Source code in zeus/device/gpu.py
668 669 670 |
|
__len__
1 |
|
Returns the number of GPUs being tracked.
Source code in zeus/device/gpu.py
672 673 674 |
|
NVIDIAGPUs
Bases: GPUs
NVIDIA GPU Manager object, containing individual NVIDIAGPU objects, abstracting pyNVML calls and handling related exceptions.
This class provides a high-level interface to interact with NVIDIA GPUs. CUDA_VISIBLE_DEVICES
environment variable is respected if set. For example, if there are
4 GPUs and CUDA_VISIBLE_DEVICES=0,2
, only GPUs 0 and 2 are instantiated. In this case, to access
GPU of CUDA index 0, use the index 0, and for CUDA index 2, use the index 1.
This class provides a 1:1 mapping between the methods and NVML library functions. For example, if you want to do the following:
1 2 |
|
You can now do:
1 2 |
|
Note: This class instantiates (grabs the handle, by calling pynvml.nvmlDeviceGetHandleByIndex
) all GPUs that are visible to the system, as determined by the CUDA_VISIBLE_DEVICES
environment variable if set.
Source code in zeus/device/gpu.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 |
|
gpus
property
1 |
|
Returns a list of NVIDIAGPU objects being tracked.
__init__
1 |
|
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ensure_homogeneous |
bool
|
If True, ensures that all tracked GPUs have the same name (return value of |
False
|
Source code in zeus/device/gpu.py
700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
|
__del__
1 |
|
Shuts down the NVIDIA GPU monitoring library to release resources and clean up.
Source code in zeus/device/gpu.py
732 733 734 735 |
|
AMDGPUs
Bases: GPUs
AMD GPU Manager object, containing individual AMDGPU objects, abstracting amdsmi calls and handling related exceptions.
This class provides a high-level interface to interact with AMD GPUs. ROCR_VISIBLE_DEVICES
environment variable is respected if set. For example, if there are
4 GPUs and ROCR_VISIBLE_DEVICES=0,2
, only GPUs 0 and 2 are instantiated. In this case, to access
GPU of ROCR index 0, use the index 0, and for ROCR index 2, use the index 1.
This class provides a 1:1 mapping between the methods and AMDSMI library functions. For example, if you want to do the following:
1 2 3 |
|
You can now do:
1 2 |
|
Note: This class instantiates (grabs the handle, by calling amdsmi.amdsmi_get_processor_handles()
) all GPUs that are visible to the system, as determined by the ROCR_VISIBLE_DEVICES
environment variable if set.
Source code in zeus/device/gpu.py
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 |
|
gpus
property
1 |
|
Returns a list of AMDGPU objects being tracked.
__init__
1 |
|
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ensure_homogeneous |
bool
|
If True, ensures that all tracked GPUs have the same name (return value of amdsmi.amdsmi_get_gpu_asic_info(handle).market_name). False by default. |
False
|
Source code in zeus/device/gpu.py
763 764 765 766 767 768 769 770 771 772 773 774 775 776 |
|
__del__
1 |
|
Shuts down the AMD GPU monitoring library to release resources and clean up.
Source code in zeus/device/gpu.py
787 788 789 790 |
|
get_gpus
1 |
|
Initialize and return a singleton GPU monitoring object for NVIDIA or AMD GPUs.
The function returns a GPU management object that aims to abstract the underlying GPU monitoring libraries (pynvml for NVIDIA GPUs and amdsmi for AMD GPUs), and provides a 1:1 mapping between the methods in the object and related library functions.
This function attempts to initialize GPU monitoring using the pynvml library for NVIDIA GPUs first. If pynvml is not available or fails to initialize, it then tries to use the amdsmi library for AMD GPUs. If both attempts fail, it raises a ZeusErrorInit exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ensure_homogeneous |
bool
|
If True, ensures that all tracked GPUs have the same name. False by default. |
False
|
Source code in zeus/device/gpu.py
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 |
|
nvml_is_available
1 |
|
Check if PyNVML is available.
Source code in zeus/device/gpu.py
829 830 831 832 833 834 835 836 837 838 839 840 841 |
|
amdsmi_is_available
1 |
|
Check if amdsmi is available.
Source code in zeus/device/gpu.py
844 845 846 847 848 849 850 851 852 853 854 855 856 |
|