Skip to content

Build a hardware detector #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RETR0-OS
Copy link

Pull Request Description: Hardware Resource Monitor

Overview

This pull request introduces a Python-based hardware resource monitoring tool that provides real-time information about the system's hardware specifications and resource usage. The tool is designed to run continuously, similar to the Windows Task Manager, and displays data in a clean and user-friendly format in the console.

Features

  • GPU Monitoring:

    • Detects and displays GPU specifications, including:
      • GPU name
      • Total memory (in GB)
      • Used memory (in GB)
    • Supports NVIDIA GPUs using the pynvml library.
  • System Monitoring:

    • Detects and displays system specifications, including:
      • Total and used RAM (in GB)
      • Available disk space (in GB)
      • Number of CPU cores
      • CPU usage percentage
  • Continuous Monitoring:

    • Continuously monitors hardware resources with a customizable update interval.
    • Clears the console output on each update for a clean display.
  • Cross-Platform Compatibility:

    • Works on Windows, macOS, and Linux for CPU, RAM, and disk monitoring.
    • GPU monitoring is limited to systems with NVIDIA GPUs and the required drivers.

Changes Made

  1. Added the HardwareDetector class to handle hardware resource detection and monitoring.
  2. Implemented methods for:
    • GPU specifications detection (get_gpu_specs).
    • System specifications detection (get_computer_specs).
    • Continuous monitoring (monitor_resources).
  3. Included exception handling for graceful termination using KeyboardInterrupt.
  4. Updated the README.md with usage instructions and project details.
  5. Added a requirements.txt file for dependency management.

How to Use

  1. Install the required dependencies:

    pip install -r requirements.txt
  2. Run the script:

    python hardware_detector.py
  3. Press Ctrl+C to stop the monitoring process.

Notes

  • Ensure that your system has a CUDA-enabled GPU with the correct drivers installed to retrieve GPU information.
  • The script clears the console output on each update. This behavior may vary depending on the operating system.

Testing

  • Verified functionality on Windows and Linux systems.
  • Tested with and without NVIDIA GPUs to ensure proper handling of GPU-related functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant