-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
65 lines (54 loc) · 2.09 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from nvidia_gpu import *
from cpu_usage import *
from radeon_gpu2 import *
from gpu_check import *
from rich import print as rprint
from rich.console import Console
from alive_progress import alive_bar
console = Console()
BANNER =(
'╔════════════════════════════════════════════╗',
'║ ██████╗ ██████╗████████╗ ██████╗ ██████╗ ║',
'║ ██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗ ║',
'║ ██║ ██║ ███╗ ██║ ██║ ██║██████╔╝ ║',
'║ ██║ ██║ ██║ ██║ ██║ ██║██╔═══╝ ║',
'║ ╚██████╗╚██████╔╝ ██║ ╚██████╔╝██║ ║',
'║ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ║',
'╚════════════════════════════════════════════╝'
)
if "nvidia" in gpu_info:
nvmlInit();
for i in range(total_nvidia_gpu()):
GPU_ID = nvmlDeviceGetHandleByIndex(i)
elif "amdgpu" in gpu_info:
pass
else:
pass
while(1):
os.system("clear");
for i in range(len(BANNER)):
console.print(f"[green]{BANNER[i]}", justify="center")
print(f"CPU Usage is : {cpu_usage()}%");
per_cpu_usage();
per_cpu_freq();
#time.sleep(1);
if "nvidia" in gpu_info:
print(nvidia_gpu_name(0))
print(nvidia_gpu_temp(GPU_ID))
print(nvidia_gpu_core_clock(GPU_ID))
print(nvidia_gpu_mem_clock(GPU_ID))
time.sleep(1)
else:
pass
if "amdgpu" in gpu_info:
print(amd_gpu_vram_usage(0))
print(amd_gpu_core_clock(0))
print(amd_gpu_mem_clock(0))
"""radeon_out = subprocess.check_output("radeontop -l 1 -d -", shell=True)
output = radeon_out.decode()
print(radeon_gpu_usage(output))
print(radeon_gpu_mem_freq(output))
time.sleep(1)"""
else:
pass
time.sleep(1)