pyhw 0.12.3__tar.gz → 0.12.5__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.3/src/pyhw.egg-info → pyhw-0.12.5}/PKG-INFO +2 -2
- {pyhw-0.12.3 → pyhw-0.12.5}/README.md +1 -1
- {pyhw-0.12.3 → pyhw-0.12.5}/pyproject.toml +2 -2
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/__init__.py +1 -1
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/linux.py +38 -2
- pyhw-0.12.5/src/pyhw/library/lib/iokitCPULib.dylib +0 -0
- pyhw-0.12.5/src/pyhw/library/lib/iokitGPULib.dylib +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/library/lib/iokitHostLib.dylib +0 -0
- pyhw-0.12.5/src/pyhw/library/lib/nvmlGPULib_amd64.so +0 -0
- pyhw-0.12.5/src/pyhw/library/lib/nvmlGPULib_arm64.so +0 -0
- pyhw-0.12.5/src/pyhw/library/test/nvmlGPULibTest.py +25 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/pyhwUtil/pyhwUtil.py +5 -1
- {pyhw-0.12.3 → pyhw-0.12.5/src/pyhw.egg-info}/PKG-INFO +2 -2
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw.egg-info/SOURCES.txt +4 -0
- pyhw-0.12.3/src/pyhw/library/lib/iokitGPULib.dylib +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/LICENSE +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/setup.cfg +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/__main__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/backendBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/cpuBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/cpu/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/gpuBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/gpu/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/hostBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/hostInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/host/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/kernel/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/kernel/kernelBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/kernel/unix.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/kernel/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/memoryBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/memoryInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/memory/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/nicBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/nicInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/nic/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/npuBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/npuInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/npu/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/osBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/osInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/os/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/shell/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/shell/shellBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/shell/shellInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/shell/unix.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/shell/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/title/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/title/titleBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/title/titleInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/title/unix.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/title/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/bsd.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/linux.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/macos.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/backend/uptime/windows.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/color/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/color/colorConfig.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/color/colorSet.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/color/colorUtil.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/frontendBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/alpine.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/arch.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/armbian.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/centos.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/freebsd.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/kali.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/linuxmint.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/opensuse-leap.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/opensuse-tumbleweed.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/raspbian.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/rhel.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/windows_10.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/windows_11.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/windows_2025.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/ascii/windows_old.pyhw +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/frontend/logo/logoBase.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/library/test/iokitHostLibTest.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/pyhwException/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/pyhwException/pyhwException.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/pyhwUtil/__init__.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/pyhwUtil/cliUtil.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw.egg-info/dependency_links.txt +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw.egg-info/entry_points.txt +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw.egg-info/requires.txt +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/src/pyhw.egg-info/top_level.txt +0 -0
- {pyhw-0.12.3 → pyhw-0.12.5}/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.5
|
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>
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
33
33
|

|
34
34
|
|
35
35
|
|
36
|
-
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
36
|
+
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
37
37
|
|
38
38
|
This project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so 🤔).
|
39
39
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|

|
15
15
|
|
16
16
|
|
17
|
-
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
17
|
+
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
18
18
|
|
19
19
|
This project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so 🤔).
|
20
20
|
|
@@ -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.5"
|
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.5'
|
2
2
|
__author__ = 'xiaoran007'
|
@@ -1,12 +1,15 @@
|
|
1
1
|
from .gpuInfo import GPUInfo
|
2
2
|
from ..cpu import CPUDetect
|
3
3
|
from ...pyhwUtil import getArch
|
4
|
+
from pathlib import Path
|
4
5
|
import pypci
|
6
|
+
import ctypes
|
5
7
|
|
6
8
|
|
7
9
|
class GPUDetectLinux:
|
8
10
|
def __init__(self):
|
9
11
|
self.__gpuInfo = GPUInfo()
|
12
|
+
self.__arch = self.__setArch()
|
10
13
|
|
11
14
|
def getGPUInfo(self):
|
12
15
|
self.__getGPUInfo()
|
@@ -18,14 +21,39 @@ class GPUDetectLinux:
|
|
18
21
|
if len(gpu_devices) == 0:
|
19
22
|
self.__handleNonePciDevices()
|
20
23
|
else:
|
24
|
+
core_map = dict()
|
21
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)"
|
22
38
|
if device.subsystem_device_name != "":
|
23
|
-
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}"
|
24
40
|
else:
|
25
|
-
device_name = f"{device.vendor_name} {device.device_name}"
|
41
|
+
device_name = f"{device.vendor_name} {device.device_name} {core_print}"
|
26
42
|
self.__gpuInfo.gpus.append(self.__gpuNameClean(device_name))
|
27
43
|
self.__gpuInfo.number += 1
|
28
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
|
+
|
29
57
|
def __handleNonePciDevices(self):
|
30
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.
|
31
59
|
if getArch() in ["aarch64", "arm32", "riscv64"]:
|
@@ -40,5 +68,13 @@ class GPUDetectLinux:
|
|
40
68
|
gpu_name_clean = gpu_name.replace("Corporation ", "")
|
41
69
|
return gpu_name_clean
|
42
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
|
+
|
43
79
|
def __sortGPUList(self):
|
44
80
|
self.__gpuInfo.gpus.sort()
|
Binary file
|
Binary file
|
Binary file
|
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()
|
@@ -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.5
|
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>
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
33
33
|

|
34
34
|
|
35
35
|
|
36
|
-
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
36
|
+
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
37
37
|
|
38
38
|
This project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so 🤔).
|
39
39
|
|
@@ -112,9 +112,13 @@ src/pyhw/frontend/logo/ascii/windows_10.pyhw
|
|
112
112
|
src/pyhw/frontend/logo/ascii/windows_11.pyhw
|
113
113
|
src/pyhw/frontend/logo/ascii/windows_2025.pyhw
|
114
114
|
src/pyhw/frontend/logo/ascii/windows_old.pyhw
|
115
|
+
src/pyhw/library/lib/iokitCPULib.dylib
|
115
116
|
src/pyhw/library/lib/iokitGPULib.dylib
|
116
117
|
src/pyhw/library/lib/iokitHostLib.dylib
|
118
|
+
src/pyhw/library/lib/nvmlGPULib_amd64.so
|
119
|
+
src/pyhw/library/lib/nvmlGPULib_arm64.so
|
117
120
|
src/pyhw/library/test/iokitHostLibTest.py
|
121
|
+
src/pyhw/library/test/nvmlGPULibTest.py
|
118
122
|
src/pyhw/pyhwException/__init__.py
|
119
123
|
src/pyhw/pyhwException/pyhwException.py
|
120
124
|
src/pyhw/pyhwUtil/__init__.py
|
Binary file
|
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
|
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
|