Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cognios/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
psutil
pandas
scikit-learn
torch
streamlit
pytest
13 changes: 10 additions & 3 deletions cognios/src/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,16 @@
proc_metrics = get_last_process_metrics(limit=15)

# Check GPU availability
import torch
gpu_available = torch.cuda.is_available()
gpu_name = torch.cuda.get_device_name(0) if gpu_available else "No GPU Detected"
import subprocess
gpu_available = False
gpu_name = "No GPU Detected"
try:
result = subprocess.run(['nvidia-smi', '--query-gpu=name', '--format=csv,noheader'], capture_output=True, text=True)
if result.returncode == 0 and result.stdout.strip():
gpu_available = True
gpu_name = result.stdout.strip().split('\n')[0]
except (FileNotFoundError, Exception):
pass

if sys_metrics:
if len(sys_metrics[0]) == 6:
Expand Down
3 changes: 2 additions & 1 deletion cognios/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def test_os_doctor():
print("\n[OS Doctor Test] Successfully detected CPU spike anomaly!")

def test_focus_os():
import torch
import pytest
torch = pytest.importorskip("torch")
import os
from cognios.src.focus_os import WorkloadCNN, Prioritizer

Expand Down