pyhw 0.12.0__py3-none-any.whl → 0.12.1__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.
- pyhw/__init__.py +1 -1
- pyhw/backend/gpu/macos.py +4 -0
- pyhw/backend/host/macos.py +4 -0
- {pyhw-0.12.0.dist-info → pyhw-0.12.1.dist-info}/METADATA +1 -1
- {pyhw-0.12.0.dist-info → pyhw-0.12.1.dist-info}/RECORD +9 -9
- {pyhw-0.12.0.dist-info → pyhw-0.12.1.dist-info}/WHEEL +1 -1
- {pyhw-0.12.0.dist-info → pyhw-0.12.1.dist-info}/LICENSE +0 -0
- {pyhw-0.12.0.dist-info → pyhw-0.12.1.dist-info}/entry_points.txt +0 -0
- {pyhw-0.12.0.dist-info → pyhw-0.12.1.dist-info}/top_level.txt +0 -0
pyhw/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = '0.12.
|
1
|
+
__version__ = '0.12.1'
|
2
2
|
__author__ = 'xiaoran007'
|
pyhw/backend/gpu/macos.py
CHANGED
@@ -63,6 +63,10 @@ class GPUDetectMacOS:
|
|
63
63
|
lib.getGPUInfo.restype = ctypes.c_char_p
|
64
64
|
gpu_info = lib.getGPUInfo()
|
65
65
|
gpus = gpu_info.decode('utf-8').split("; ")
|
66
|
+
# if the first element is "Error", it means that the library failed to get the GPU info
|
67
|
+
# Fall back to the default implementation
|
68
|
+
if gpus[0] == "Error":
|
69
|
+
return False
|
66
70
|
self.__gpuInfo.number = len(gpus)
|
67
71
|
for gpu in gpus:
|
68
72
|
info_list = gpu.split(", ")
|
pyhw/backend/host/macos.py
CHANGED
@@ -26,6 +26,10 @@ class HostDetectMacOS:
|
|
26
26
|
lib.getHostInfo.restype = ctypes.c_char_p
|
27
27
|
host_info = lib.getHostInfo()
|
28
28
|
product_name = host_info.decode('utf-8').split("; ")
|
29
|
+
# If the first element is "Error", it means that the library failed to get the product name.
|
30
|
+
# Fall back to sysctl.
|
31
|
+
if product_name[0] == "Error":
|
32
|
+
return False
|
29
33
|
self.__hostInfo.model = product_name[0]
|
30
34
|
return True
|
31
35
|
except Exception as e:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
pyhw/__init__.py,sha256=
|
1
|
+
pyhw/__init__.py,sha256=7b2iToyIYELNXr7Y8tzbP1ltLj_gLux9vH4rYFqXtfU,49
|
2
2
|
pyhw/__main__.py,sha256=oZpFtvSyYTM8cMsulvi51zJV0gtmw3OCQVdgoaHbtxc,4977
|
3
3
|
pyhw/backend/__init__.py,sha256=knn_3Yroow1h0dqdrozk3zyy3vz-kQyNBRjR6OLmVoY,50
|
4
4
|
pyhw/backend/backendBase.py,sha256=mloo8mPEbgbIdmyQ3I4vdEXMSSjxWi_wnwACmzvHbEo,506
|
@@ -14,14 +14,14 @@ pyhw/backend/gpu/bsd.py,sha256=hNFiCek770CXOh3DK3I3-g272-a1S5D7LolGJBsLXaU,124
|
|
14
14
|
pyhw/backend/gpu/gpuBase.py,sha256=ZPT9o7PhYpzlwign0GsCT519F9DGx-1UEMVVOM8MV_k,748
|
15
15
|
pyhw/backend/gpu/gpuInfo.py,sha256=d_z_z5DiZAg85wP0VOBQEU0QHdaK3qFqA2Tp9Eq8-Zs,133
|
16
16
|
pyhw/backend/gpu/linux.py,sha256=M6pRlu3GREMw1Gm7MA-dY_yYI94MliHW3tyS8JjMw5Q,1617
|
17
|
-
pyhw/backend/gpu/macos.py,sha256=
|
17
|
+
pyhw/backend/gpu/macos.py,sha256=s-GZk_Q7K58nSOYuOIAYLRvLafwHyQtsWrPVe3CuXac,4068
|
18
18
|
pyhw/backend/gpu/windows.py,sha256=Hv-vtWQGKv6_Nxc8raEBq7NNm5TR6xg6x6BK3Aa2uP4,1249
|
19
19
|
pyhw/backend/host/__init__.py,sha256=Efaj7-Oya7H8HdpZHQCLrwn-mcfPb-d6yfh4dzsE_7I,58
|
20
20
|
pyhw/backend/host/bsd.py,sha256=9gKnM6yysHBKwS3EQvb0pCeylh3dzHvoEuPe14zo9wQ,382
|
21
21
|
pyhw/backend/host/hostBase.py,sha256=gM49SY6rEaxec_0bUOMk7QlEfR7vjfWp3BXEUqgdncc,762
|
22
22
|
pyhw/backend/host/hostInfo.py,sha256=grz15M2t3f_enqQvc7Qn6HlEfYwa66bu2NYvm8VpJ-g,452
|
23
23
|
pyhw/backend/host/linux.py,sha256=aU-tWTI2Wjg1HCx2lGFenoaiM94axutXmL7Auu8ilhM,2925
|
24
|
-
pyhw/backend/host/macos.py,sha256=
|
24
|
+
pyhw/backend/host/macos.py,sha256=RgDjvi8RsAs9i-bHkcSdK--TaeyaxYzLXFZFMl8T6Eo,16295
|
25
25
|
pyhw/backend/host/windows.py,sha256=qn2QiTK2wIijyyw_QKdiSizY3teyS-9RNBu5RxEPRSw,1185
|
26
26
|
pyhw/backend/kernel/__init__.py,sha256=fGjwjpOhwA_PnsWbwoq102hwhTay2ufYKaTqxjSV2-I,65
|
27
27
|
pyhw/backend/kernel/kernelBase.py,sha256=3ZmkRkvwoWk3R-by2cgBlZnMSQzVjTC8Owmv53Pm4II,539
|
@@ -113,9 +113,9 @@ pyhw/pyhwUtil/__init__.py,sha256=34ygvVBBqfJ_9OMzHToCcV_BVahixNsa_Z5yh6VsaPQ,304
|
|
113
113
|
pyhw/pyhwUtil/cliUtil.py,sha256=42Gdi9wTg5XOYuEvGHEgOaZJ6dJk1qSuHIprR8pCA-g,2344
|
114
114
|
pyhw/pyhwUtil/pyhwUtil.py,sha256=RokrE7X99pkS0LtN4wyJS_ZQmjtMwiNxA7MwXMoO96c,7664
|
115
115
|
pyhw/pyhwUtil/sysctlUtil.py,sha256=S-rUvqi7ZrMyMouIhxlyHEQ4agM7sCT1Y7uzs3Hu5-o,841
|
116
|
-
pyhw-0.12.
|
117
|
-
pyhw-0.12.
|
118
|
-
pyhw-0.12.
|
119
|
-
pyhw-0.12.
|
120
|
-
pyhw-0.12.
|
121
|
-
pyhw-0.12.
|
116
|
+
pyhw-0.12.1.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
|
117
|
+
pyhw-0.12.1.dist-info/METADATA,sha256=ST9mK338vzRH0CI9mX31UerZPsGYiIYSN9tkYKNe2ww,6753
|
118
|
+
pyhw-0.12.1.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
119
|
+
pyhw-0.12.1.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
|
120
|
+
pyhw-0.12.1.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
|
121
|
+
pyhw-0.12.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|