mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-16 00:56:26 +00:00
Update AppImage
This commit is contained in:
@@ -74,7 +74,7 @@ export default function Hardware() {
|
|||||||
try {
|
try {
|
||||||
console.log("[v0] Fetching real-time GPU data for slot:", gpu.slot)
|
console.log("[v0] Fetching real-time GPU data for slot:", gpu.slot)
|
||||||
const response = await fetch(`http://localhost:8008/api/gpu/${gpu.slot}/realtime`, {
|
const response = await fetch(`http://localhost:8008/api/gpu/${gpu.slot}/realtime`, {
|
||||||
signal: AbortSignal.timeout(3000),
|
signal: AbortSignal.timeout(6000),
|
||||||
})
|
})
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
|
|||||||
@@ -1625,7 +1625,7 @@ def get_detailed_gpu_info(gpu):
|
|||||||
data_retrieved = False
|
data_retrieved = False
|
||||||
process = None
|
process = None
|
||||||
try:
|
try:
|
||||||
cmd = ['intel_gpu_top', '-J', '-s', '250', '-o', '-', '-d', f'sys:{sys_real}']
|
cmd = ['intel_gpu_top', '-J', '-s', '1000', '-o', '-', '-d', f'sys:{sys_real}']
|
||||||
print(f"[v0] Starting intel_gpu_top with command: {' '.join(cmd)}")
|
print(f"[v0] Starting intel_gpu_top with command: {' '.join(cmd)}")
|
||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
@@ -1638,17 +1638,20 @@ def get_detailed_gpu_info(gpu):
|
|||||||
|
|
||||||
print(f"[v0] intel_gpu_top process started, reading output...")
|
print(f"[v0] intel_gpu_top process started, reading output...")
|
||||||
|
|
||||||
# Read output with timeout
|
|
||||||
output_lines = []
|
output_lines = []
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
timeout_seconds = 5.0
|
timeout_seconds = 8.0
|
||||||
json_objects_found = 0
|
json_objects_found = 0
|
||||||
|
valid_data_found = False
|
||||||
|
|
||||||
while time.time() - start_time < timeout_seconds:
|
while time.time() - start_time < timeout_seconds:
|
||||||
if process.poll() is not None:
|
if process.poll() is not None:
|
||||||
break
|
break
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Use select for non-blocking read to avoid hanging
|
||||||
|
ready_fds, _, _ = select.select([process.stdout], [], [], 0.1)
|
||||||
|
if ready_fds:
|
||||||
line = process.stdout.readline()
|
line = process.stdout.readline()
|
||||||
if line:
|
if line:
|
||||||
output_lines.append(line)
|
output_lines.append(line)
|
||||||
@@ -1804,7 +1807,7 @@ def get_detailed_gpu_info(gpu):
|
|||||||
if json_objects_found >= 2 and data_retrieved:
|
if json_objects_found >= 2 and data_retrieved:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
time.sleep(0.05)
|
time.sleep(0.05) # Sleep briefly if no output, to avoid busy-waiting
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[v0] Error reading intel_gpu_top output: {e}")
|
print(f"[v0] Error reading intel_gpu_top output: {e}")
|
||||||
@@ -2349,7 +2352,7 @@ def get_hardware_info():
|
|||||||
# Graphics Cards (from lspci - will be duplicated by new PCI device listing, but kept for now)
|
# Graphics Cards (from lspci - will be duplicated by new PCI device listing, but kept for now)
|
||||||
try:
|
try:
|
||||||
# Try nvidia-smi first
|
# Try nvidia-smi first
|
||||||
result = subprocess.run(['nvidia-smi', '--query-gpu=name,memory.total,temperature.gpu,power.draw', '--format=csv,noheader'],
|
result = subprocess.run(['nvidia-smi', '--query-gpu=name,memory.total,temperature.gpu,power.draw', '--format=csv,noheader,nounits'],
|
||||||
capture_output=True, text=True, timeout=5)
|
capture_output=True, text=True, timeout=5)
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
for line in result.stdout.strip().split('\n'):
|
for line in result.stdout.strip().split('\n'):
|
||||||
@@ -2785,7 +2788,7 @@ def api_hardware():
|
|||||||
formatted_data = {
|
formatted_data = {
|
||||||
'cpu': hardware_info.get('cpu', {}),
|
'cpu': hardware_info.get('cpu', {}),
|
||||||
'motherboard': hardware_info.get('motherboard', {}),
|
'motherboard': hardware_info.get('motherboard', {}),
|
||||||
'bios': hardware_info.get('bios', {}),
|
'bios': hardware_info.get('motherboard', {}).get('bios', {}), # Extract BIOS info
|
||||||
'memory_modules': hardware_info.get('memory_modules', []),
|
'memory_modules': hardware_info.get('memory_modules', []),
|
||||||
'storage_devices': hardware_info.get('storage_devices', []),
|
'storage_devices': hardware_info.get('storage_devices', []),
|
||||||
'pci_devices': hardware_info.get('pci_devices', []),
|
'pci_devices': hardware_info.get('pci_devices', []),
|
||||||
|
|||||||
Reference in New Issue
Block a user