pyhw 0.12.2__tar.gz → 0.12.4__tar.gz
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-0.12.2/src/pyhw.egg-info → pyhw-0.12.4}/PKG-INFO +7 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/README.md +6 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/pyproject.toml +2 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/__init__.py +1 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/linux.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/windows.py +0 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/bsd.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/linux.py +38 -4
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/windows.py +0 -4
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/bsd.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/hostInfo.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/kernel/unix.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/kernel/windows.py +0 -4
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/bsd.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/linux.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/windows.py +0 -7
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/bsd.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/linux.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/macos.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/windows.py +0 -6
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/__init__.py +1 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/macos.py +1 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/npuInfo.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/windows.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/bsd.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/linux.py +0 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/macos.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/windows.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/shell/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/shell/unix.py +0 -10
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/shell/windows.py +0 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/title/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/title/unix.py +0 -5
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/title/windows.py +0 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/bsd.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/linux.py +0 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/macos.py +0 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/windows.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/color/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/frontendBase.py +0 -3
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/logoBase.py +0 -1
- pyhw-0.12.4/src/pyhw/library/lib/nvmlGPULib_amd64.so +0 -0
- pyhw-0.12.4/src/pyhw/library/lib/nvmlGPULib_arm64.so +0 -0
- pyhw-0.12.4/src/pyhw/library/test/nvmlGPULibTest.py +25 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/pyhwException/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/pyhwUtil/__init__.py +1 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/pyhwUtil/cliUtil.py +0 -2
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/pyhwUtil/pyhwUtil.py +5 -1
- {pyhw-0.12.2 → pyhw-0.12.4/src/pyhw.egg-info}/PKG-INFO +7 -1
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw.egg-info/SOURCES.txt +3 -1
- pyhw-0.12.2/src/pyhw/backend/metal/t.py +0 -19
- {pyhw-0.12.2 → pyhw-0.12.4}/LICENSE +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/setup.cfg +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/__main__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/backendBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/__init__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/bsd.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/cpuBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/cpu/macos.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/__init__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/gpuBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/gpu/macos.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/__init__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/hostBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/linux.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/macos.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/host/windows.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/kernel/__init__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/kernel/kernelBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/__init__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/macos.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/memoryBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/memory/memoryInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/__init__.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/nicBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/nic/nicInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/bsd.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/linux.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/npu/npuBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/osBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/os/osInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/shell/shellBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/shell/shellInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/title/titleBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/title/titleInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/color/colorConfig.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/color/colorSet.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/color/colorUtil.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/alpine.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/arch.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/armbian.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/centos.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/freebsd.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/kali.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/linuxmint.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/opensuse-leap.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/opensuse-tumbleweed.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/raspbian.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/rhel.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/windows_10.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/windows_11.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/windows_2025.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/frontend/logo/ascii/windows_old.pyhw +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/library/lib/iokitGPULib.dylib +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/library/lib/iokitHostLib.dylib +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/library/test/iokitHostLibTest.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/pyhwException/pyhwException.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw.egg-info/dependency_links.txt +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw.egg-info/entry_points.txt +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw.egg-info/requires.txt +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/src/pyhw.egg-info/top_level.txt +0 -0
- {pyhw-0.12.2 → pyhw-0.12.4}/test/test_cliUtil.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.4
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author: Xiao Ran
|
6
6
|
Maintainer-email: Xiao Ran <xiaoran.007@icloud.com>
|
@@ -127,6 +127,12 @@ Make sure the following Python build tools are already installed.
|
|
127
127
|
* build
|
128
128
|
* twine
|
129
129
|
|
130
|
+
Newer versions of twine requires the following dependencies are up to date:
|
131
|
+
* setuptools
|
132
|
+
* build
|
133
|
+
* twine
|
134
|
+
* packaging
|
135
|
+
|
130
136
|
### 4.3 Build package
|
131
137
|
clone the project, and run:
|
132
138
|
```shell
|
@@ -108,6 +108,12 @@ Make sure the following Python build tools are already installed.
|
|
108
108
|
* build
|
109
109
|
* twine
|
110
110
|
|
111
|
+
Newer versions of twine requires the following dependencies are up to date:
|
112
|
+
* setuptools
|
113
|
+
* build
|
114
|
+
* twine
|
115
|
+
* packaging
|
116
|
+
|
111
117
|
### 4.3 Build package
|
112
118
|
clone the project, and run:
|
113
119
|
```shell
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "pyhw"
|
7
|
-
version = "0.12.
|
7
|
+
version = "0.12.4"
|
8
8
|
description = "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python."
|
9
9
|
keywords = ["neofetch", "system information", "command line tool", "python", "hardware information", "fastfetch", "fetching"]
|
10
10
|
authors = [
|
@@ -33,7 +33,7 @@ package-dir = {"" = "src"}
|
|
33
33
|
include-package-data = true
|
34
34
|
|
35
35
|
[tool.setuptools.package-data]
|
36
|
-
"pyhw" = ["frontend/logo/ascii/*.pyhw", "library/lib/*.dylib"]
|
36
|
+
"pyhw" = ["frontend/logo/ascii/*.pyhw", "library/lib/*.dylib", "library/lib/*.so"]
|
37
37
|
|
38
38
|
[project.scripts]
|
39
39
|
pyhw = "pyhw.__main__:main"
|
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = '0.12.
|
1
|
+
__version__ = '0.12.4'
|
2
2
|
__author__ = 'xiaoran007'
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import re
|
2
|
-
import os
|
3
1
|
import subprocess
|
4
2
|
from .cpuInfo import CPUInfo
|
5
3
|
import json
|
@@ -45,4 +43,3 @@ class CPUDetectWindows:
|
|
45
43
|
self.__cpuInfo.model = self.__cpuInfo.model.replace("(R)", "")
|
46
44
|
self.__cpuInfo.model = self.__cpuInfo.model.replace("(TM)", "")
|
47
45
|
self.__cpuInfo.model = self.__cpuInfo.model.replace("CPU ", "")
|
48
|
-
|
@@ -1,13 +1,15 @@
|
|
1
|
-
import subprocess
|
2
1
|
from .gpuInfo import GPUInfo
|
3
2
|
from ..cpu import CPUDetect
|
4
3
|
from ...pyhwUtil import getArch
|
4
|
+
from pathlib import Path
|
5
5
|
import pypci
|
6
|
+
import ctypes
|
6
7
|
|
7
8
|
|
8
9
|
class GPUDetectLinux:
|
9
10
|
def __init__(self):
|
10
11
|
self.__gpuInfo = GPUInfo()
|
12
|
+
self.__arch = self.__setArch()
|
11
13
|
|
12
14
|
def getGPUInfo(self):
|
13
15
|
self.__getGPUInfo()
|
@@ -19,14 +21,39 @@ class GPUDetectLinux:
|
|
19
21
|
if len(gpu_devices) == 0:
|
20
22
|
self.__handleNonePciDevices()
|
21
23
|
else:
|
24
|
+
core_map = dict()
|
22
25
|
for device in gpu_devices:
|
26
|
+
record_cores = core_map.get(device.device_id, 0)
|
27
|
+
if record_cores != 0:
|
28
|
+
pass
|
29
|
+
else:
|
30
|
+
cores = self.__getGPUInfoNvidia(device)
|
31
|
+
core_map[device.device_id] = cores
|
32
|
+
for device in gpu_devices:
|
33
|
+
core = core_map.get(device.device_id, 0)
|
34
|
+
if core == 0:
|
35
|
+
core_print = ""
|
36
|
+
else:
|
37
|
+
core_print = f"({core} Cores)"
|
23
38
|
if device.subsystem_device_name != "":
|
24
|
-
device_name = f"{device.vendor_name} {device.device_name}
|
39
|
+
device_name = f"{device.vendor_name} {device.device_name} [{device.subsystem_device_name}] {core_print}"
|
25
40
|
else:
|
26
|
-
device_name = f"{device.vendor_name} {device.device_name}"
|
41
|
+
device_name = f"{device.vendor_name} {device.device_name} {core_print}"
|
27
42
|
self.__gpuInfo.gpus.append(self.__gpuNameClean(device_name))
|
28
43
|
self.__gpuInfo.number += 1
|
29
44
|
|
45
|
+
def __getGPUInfoNvidia(self, device):
|
46
|
+
try:
|
47
|
+
package_root = Path(__file__).resolve().parent.parent.parent
|
48
|
+
lib = ctypes.CDLL(f"{package_root}/library/lib/nvmlGPULib_{self.__arch}.so")
|
49
|
+
lib.GetGPUCoreCountByPciBusId.argtypes = [ctypes.c_char_p]
|
50
|
+
lib.GetGPUCoreCountByPciBusId.restype = ctypes.c_uint
|
51
|
+
cores = lib.GetGPUCoreCountByPciBusId(f'00000000:{device.bus}'.encode())
|
52
|
+
return cores
|
53
|
+
except Exception as e:
|
54
|
+
print(f"An error occurred while getting GPU info using nvml: {e}")
|
55
|
+
return 0
|
56
|
+
|
30
57
|
def __handleNonePciDevices(self):
|
31
58
|
# if detector can't find any VGA/Display/3D GPUs, assume the host is a sbc device, this function is a placeholder for a more advanced method.
|
32
59
|
if getArch() in ["aarch64", "arm32", "riscv64"]:
|
@@ -41,6 +68,13 @@ class GPUDetectLinux:
|
|
41
68
|
gpu_name_clean = gpu_name.replace("Corporation ", "")
|
42
69
|
return gpu_name_clean
|
43
70
|
|
71
|
+
@staticmethod
|
72
|
+
def __setArch():
|
73
|
+
arch = getArch()
|
74
|
+
if arch == "aarch64":
|
75
|
+
return "arm64"
|
76
|
+
elif arch == "x86_64":
|
77
|
+
return "amd64"
|
78
|
+
|
44
79
|
def __sortGPUList(self):
|
45
80
|
self.__gpuInfo.gpus.sort()
|
46
|
-
|
@@ -1,9 +1,5 @@
|
|
1
|
-
import subprocess
|
2
1
|
from .nicInfo import NICInfo
|
3
|
-
from ...pyhwUtil import getArch
|
4
|
-
from ...pyhwException import BackendException
|
5
2
|
import pypci
|
6
|
-
import os
|
7
3
|
|
8
4
|
|
9
5
|
class NICDetectWindows:
|
@@ -40,5 +36,3 @@ class NICDetectWindows:
|
|
40
36
|
|
41
37
|
def _sortNICList(self):
|
42
38
|
return self._nicInfo.nics.sort()
|
43
|
-
|
44
|
-
|
@@ -1,7 +1,5 @@
|
|
1
1
|
from .npuInfo import NPUInfo
|
2
2
|
from ...pyhwUtil import getArch, getOS
|
3
|
-
import json
|
4
|
-
import subprocess
|
5
3
|
from ..cpu import CPUDetect
|
6
4
|
|
7
5
|
|
@@ -57,9 +55,9 @@ class NPUDetectMacOS:
|
|
57
55
|
"Apple M3": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
|
58
56
|
"Apple M3 Pro": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
|
59
57
|
"Apple M3 Max": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
|
58
|
+
"Apple M3 Ultra": "Apple Neural Engine 32 Cores (3nm) [SOC Integrated]",
|
60
59
|
"Apple M4": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
|
61
60
|
"Apple M4 Pro": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
|
62
61
|
"Apple M4 Max": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]"
|
63
62
|
}
|
64
63
|
return npu.get(model_name, "Not Found")
|
65
|
-
|
@@ -1,6 +1,3 @@
|
|
1
|
-
"""
|
2
|
-
In dev.
|
3
|
-
"""
|
4
1
|
from ...pyhwUtil import getDocker
|
5
2
|
from .shellInfo import ShellInfo
|
6
3
|
import os
|
@@ -57,10 +54,3 @@ class ShellDetectUnix:
|
|
57
54
|
self.__shellInfo.version = result.stdout.strip()
|
58
55
|
except subprocess.SubprocessError:
|
59
56
|
pass
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
@@ -52,7 +52,6 @@ class Printer:
|
|
52
52
|
else:
|
53
53
|
pass
|
54
54
|
|
55
|
-
|
56
55
|
@staticmethod
|
57
56
|
def __getColumns() -> int:
|
58
57
|
if getOS() == "linux":
|
@@ -105,5 +104,3 @@ class Printer:
|
|
105
104
|
print(data_line)
|
106
105
|
raise BackendException("Invalid data format")
|
107
106
|
self.__processed_data_lines.append(colorPrefix(ColorSet.COLOR_MODE_BOLD) + colorPrefix(keys_color) + name + ": " + colorSuffix() + value)
|
108
|
-
|
109
|
-
|
Binary file
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import ctypes
|
2
|
+
import pypci
|
3
|
+
|
4
|
+
|
5
|
+
def main():
|
6
|
+
lib = ctypes.CDLL(f"../lib/nvmlGPULib_amd64.so")
|
7
|
+
lib.GetGPUCoreCount.argtypes = [ctypes.c_uint]
|
8
|
+
lib.GetGPUCoreCount.restype = ctypes.c_uint
|
9
|
+
cuda_cores = lib.GetGPUCoreCount(0)
|
10
|
+
print("CUDA Cores:", cuda_cores)
|
11
|
+
lib.GetGPUCoreCountByPciBusId.argtypes = [ctypes.c_char_p]
|
12
|
+
lib.GetGPUCoreCountByPciBusId.restype = ctypes.c_uint
|
13
|
+
pci_bus_id = b"00000000:99:00.0"
|
14
|
+
cuda_cores = lib.GetGPUCoreCountByPciBusId(pci_bus_id)
|
15
|
+
print("CUDA Cores by PCI Bus ID:", cuda_cores)
|
16
|
+
|
17
|
+
gpu_devices = pypci.PCI().FindAllVGA()
|
18
|
+
for gpu in gpu_devices:
|
19
|
+
print(f"id: {gpu.bus}")
|
20
|
+
print(f"cuda cores: {lib.GetGPUCoreCountByPciBusId(f'00000000:{gpu.bus}'.encode())}")
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
if __name__ == "__main__":
|
25
|
+
main()
|
@@ -2,4 +2,5 @@ from .pyhwUtil import getOS, getArch, getDocker, getWSL, createDataString, selec
|
|
2
2
|
from .sysctlUtil import sysctlGetString, sysctlGetInt
|
3
3
|
from .cliUtil import ReleaseChecker
|
4
4
|
|
5
|
+
|
5
6
|
__all__ = ["getOS", "getArch", "getDocker", "getWSL", "createDataString", "selectOSLogo", "sysctlGetString", "sysctlGetInt", "ReleaseChecker"]
|
@@ -26,7 +26,7 @@ def getOS():
|
|
26
26
|
def getArch():
|
27
27
|
"""
|
28
28
|
Get the machine architecture.
|
29
|
-
:return: str, value in [x86_64, x86, aarch64, arm32, riscv64].
|
29
|
+
:return: str, value in [x86_64, x86, aarch64, arm32, riscv64, s390x, ppc64le].
|
30
30
|
"""
|
31
31
|
arch = platform.machine()
|
32
32
|
if arch == "x86_64" or arch == "AMD64" or arch == "amd64":
|
@@ -39,6 +39,10 @@ def getArch():
|
|
39
39
|
return "arm32"
|
40
40
|
elif arch == "riscv64":
|
41
41
|
return "riscv64"
|
42
|
+
elif arch == "s390x":
|
43
|
+
return "s390x"
|
44
|
+
elif arch == "ppc64le":
|
45
|
+
return "ppc64le"
|
42
46
|
else:
|
43
47
|
return "unknown"
|
44
48
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.4
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author: Xiao Ran
|
6
6
|
Maintainer-email: Xiao Ran <xiaoran.007@icloud.com>
|
@@ -127,6 +127,12 @@ Make sure the following Python build tools are already installed.
|
|
127
127
|
* build
|
128
128
|
* twine
|
129
129
|
|
130
|
+
Newer versions of twine requires the following dependencies are up to date:
|
131
|
+
* setuptools
|
132
|
+
* build
|
133
|
+
* twine
|
134
|
+
* packaging
|
135
|
+
|
130
136
|
### 4.3 Build package
|
131
137
|
clone the project, and run:
|
132
138
|
```shell
|
@@ -44,7 +44,6 @@ src/pyhw/backend/memory/macos.py
|
|
44
44
|
src/pyhw/backend/memory/memoryBase.py
|
45
45
|
src/pyhw/backend/memory/memoryInfo.py
|
46
46
|
src/pyhw/backend/memory/windows.py
|
47
|
-
src/pyhw/backend/metal/t.py
|
48
47
|
src/pyhw/backend/nic/__init__.py
|
49
48
|
src/pyhw/backend/nic/bsd.py
|
50
49
|
src/pyhw/backend/nic/linux.py
|
@@ -115,7 +114,10 @@ src/pyhw/frontend/logo/ascii/windows_2025.pyhw
|
|
115
114
|
src/pyhw/frontend/logo/ascii/windows_old.pyhw
|
116
115
|
src/pyhw/library/lib/iokitGPULib.dylib
|
117
116
|
src/pyhw/library/lib/iokitHostLib.dylib
|
117
|
+
src/pyhw/library/lib/nvmlGPULib_amd64.so
|
118
|
+
src/pyhw/library/lib/nvmlGPULib_arm64.so
|
118
119
|
src/pyhw/library/test/iokitHostLibTest.py
|
120
|
+
src/pyhw/library/test/nvmlGPULibTest.py
|
119
121
|
src/pyhw/pyhwException/__init__.py
|
120
122
|
src/pyhw/pyhwException/pyhwException.py
|
121
123
|
src/pyhw/pyhwUtil/__init__.py
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import ctypes
|
2
|
-
|
3
|
-
|
4
|
-
mylib = ctypes.CDLL('./metalGPULib.dylib')
|
5
|
-
|
6
|
-
mylib.backend_init.argtypes = []
|
7
|
-
mylib.backend_init.restype = None
|
8
|
-
|
9
|
-
mylib.get_default_device_name.argtypes = []
|
10
|
-
mylib.get_default_device_name.restype = ctypes.c_char_p
|
11
|
-
|
12
|
-
|
13
|
-
# Call the function
|
14
|
-
mylib.backend_init()
|
15
|
-
device_name = mylib.get_default_device_name()
|
16
|
-
|
17
|
-
# Print the result
|
18
|
-
print(f"Device Name: {device_name.decode('utf-8')}")
|
19
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|