gpustack-runtime 0.1.39.post2__py3-none-any.whl → 0.1.40__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. gpustack_runtime/__main__.py +7 -3
  2. gpustack_runtime/_version.py +2 -2
  3. gpustack_runtime/_version_appendix.py +1 -1
  4. gpustack_runtime/cmds/__init__.py +2 -0
  5. gpustack_runtime/cmds/deployer.py +84 -2
  6. gpustack_runtime/cmds/images.py +2 -0
  7. gpustack_runtime/deployer/__init__.py +2 -0
  8. gpustack_runtime/deployer/__types__.py +52 -28
  9. gpustack_runtime/deployer/__utils__.py +99 -112
  10. gpustack_runtime/deployer/cdi/__init__.py +81 -0
  11. gpustack_runtime/deployer/cdi/__types__.py +667 -0
  12. gpustack_runtime/deployer/cdi/thead.py +103 -0
  13. gpustack_runtime/deployer/docker.py +42 -24
  14. gpustack_runtime/deployer/kuberentes.py +8 -4
  15. gpustack_runtime/deployer/podman.py +41 -23
  16. gpustack_runtime/detector/__init__.py +62 -3
  17. gpustack_runtime/detector/__types__.py +11 -0
  18. gpustack_runtime/detector/__utils__.py +23 -0
  19. gpustack_runtime/detector/amd.py +17 -9
  20. gpustack_runtime/detector/hygon.py +6 -1
  21. gpustack_runtime/detector/iluvatar.py +20 -5
  22. gpustack_runtime/detector/mthreads.py +8 -12
  23. gpustack_runtime/detector/nvidia.py +365 -168
  24. gpustack_runtime/detector/pyacl/__init__.py +9 -1
  25. gpustack_runtime/detector/pyamdgpu/__init__.py +8 -0
  26. gpustack_runtime/detector/pycuda/__init__.py +9 -1
  27. gpustack_runtime/detector/pydcmi/__init__.py +9 -2
  28. gpustack_runtime/detector/pyhgml/__init__.py +5879 -0
  29. gpustack_runtime/detector/pyhgml/libhgml.so +0 -0
  30. gpustack_runtime/detector/pyhgml/libuki.so +0 -0
  31. gpustack_runtime/detector/pyhsa/__init__.py +9 -0
  32. gpustack_runtime/detector/pyixml/__init__.py +89 -164
  33. gpustack_runtime/detector/pyrocmcore/__init__.py +42 -24
  34. gpustack_runtime/detector/pyrocmsmi/__init__.py +141 -138
  35. gpustack_runtime/detector/thead.py +733 -0
  36. gpustack_runtime/envs.py +128 -55
  37. {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/METADATA +4 -2
  38. gpustack_runtime-0.1.40.dist-info/RECORD +55 -0
  39. gpustack_runtime/detector/pymtml/__init__.py +0 -770
  40. gpustack_runtime-0.1.39.post2.dist-info/RECORD +0 -49
  41. {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/WHEEL +0 -0
  42. {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/entry_points.txt +0 -0
  43. {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/licenses/LICENSE +0 -0
@@ -384,13 +384,20 @@ def convertStrBytes(func):
384
384
 
385
385
 
386
386
  def _LoadAclLibrary():
387
+ """
388
+ Load the library if it isn't loaded already.
389
+ """
387
390
  global aclLib
391
+
388
392
  if aclLib is None:
393
+ # lock to ensure only one caller loads the library
389
394
  libLoadLock.acquire()
395
+
390
396
  try:
397
+ # ensure the library still isn't loaded
391
398
  if aclLib is None:
392
399
  if sys.platform.startswith("win"):
393
- # ACL not supported on Windows
400
+ # Do not support Windows yet.
394
401
  raise ACLError(ACL_ERROR_LIBRARY_NOT_FOUND)
395
402
  # Linux path
396
403
  locs = [
@@ -419,6 +426,7 @@ def _LoadAclLibrary():
419
426
  if aclLib is None:
420
427
  raise ACLError(ACL_ERROR_LIBRARY_NOT_FOUND)
421
428
  finally:
429
+ # lock is always freed
422
430
  libLoadLock.release()
423
431
 
424
432
 
@@ -212,10 +212,17 @@ class c_amdgpu_gpu_info(_PrintableStructure):
212
212
 
213
213
 
214
214
  def _LoadAMDGPULibrary():
215
+ """
216
+ Load the library if it isn't loaded already.
217
+ """
215
218
  global amdgpuLib
219
+
216
220
  if amdgpuLib is None:
221
+ # lock to ensure only one caller loads the library
217
222
  libLoadLock.acquire()
223
+
218
224
  try:
225
+ # ensure the library still isn't loaded
219
226
  if amdgpuLib is None:
220
227
  if sys.platform.startswith("win"):
221
228
  # Do not support Windows yet.
@@ -235,6 +242,7 @@ def _LoadAMDGPULibrary():
235
242
  if amdgpuLib is None:
236
243
  raise AMDGPUError(AMDGPU_ERROR_LIBRARY_NOT_FOUND)
237
244
  finally:
245
+ # lock is always freed
238
246
  libLoadLock.release()
239
247
 
240
248
 
@@ -1,10 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
- import contextlib
4
3
  import string
5
4
  import sys
6
5
  import threading
7
6
  from ctypes import *
7
+ from functools import wraps
8
8
  from typing import ClassVar
9
9
 
10
10
  ## C Type mappings ##
@@ -390,10 +390,17 @@ def convertStrBytes(func):
390
390
 
391
391
 
392
392
  def _LoadCudaLibrary():
393
+ """
394
+ Load the library if it isn't loaded already.
395
+ """
393
396
  global cudaLib
397
+
394
398
  if cudaLib is None:
399
+ # lock to ensure only one caller loads the library
395
400
  libLoadLock.acquire()
401
+
396
402
  try:
403
+ # ensure the library still isn't loaded
397
404
  if cudaLib is None:
398
405
  if sys.platform.startswith("win"):
399
406
  # Do not support Windows yet.
@@ -411,6 +418,7 @@ def _LoadCudaLibrary():
411
418
  if cudaLib is None:
412
419
  raise CUDAError(CUDA_ERROR_LIBRARY_NOT_FOUND)
413
420
  finally:
421
+ # lock is always freed
414
422
  libLoadLock.release()
415
423
 
416
424
 
@@ -733,14 +733,20 @@ def convertStrBytes(func):
733
733
 
734
734
 
735
735
  def _LoadDcmiLibrary():
736
+ """
737
+ Load the library if it isn't loaded already.
738
+ """
736
739
  global dcmiLib
740
+
737
741
  if dcmiLib is None:
742
+ # lock to ensure only one caller loads the library
738
743
  libLoadLock.acquire()
744
+
739
745
  try:
746
+ # ensure the library still isn't loaded
740
747
  if dcmiLib is None:
741
748
  if sys.platform.startswith("win"):
742
- # DCMI is typically used on Linux, but for completeness,
743
- # Windows support would require different path handling.
749
+ # Do not support Windows yet.
744
750
  raise DCMIError(DCMI_ERROR_LIBRARY_NOT_FOUND)
745
751
  # Linux path
746
752
  locs = [
@@ -757,6 +763,7 @@ def _LoadDcmiLibrary():
757
763
  if dcmiLib is None:
758
764
  raise DCMIError(DCMI_ERROR_LIBRARY_NOT_FOUND)
759
765
  finally:
766
+ # lock is always freed
760
767
  libLoadLock.release()
761
768
 
762
769