Skip to content

akileshjayakumar/gpu-detection-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPU Detection Scripts

This repository contains Python scripts to check GPU availability and status using PyTorch and TensorFlow.

Files

  • gpu_test.py: Checks GPU availability using PyTorch and TensorFlow.
  • gpu_test_pytorch.py: Checks GPU availability using PyTorch only.
  • gpu_test_tf.py: Checks GPU availability using TensorFlow only.

Usage

To check for GPU availability, run the appropriate script:

  • For both PyTorch and TensorFlow:
    python gpu_test.py
  • For PyTorch only:
    python gpu_test_pytorch.py
  • For TensorFlow only:
    python gpu_test_tf.py

Output

Each script will display the following information:

  • PyTorch:

    • If CUDA is available.
    • Number of CUDA devices.
    • Name of the first CUDA device (if available).
  • TensorFlow:

    • Number of GPUs available (prefixed with Num GPUs Available:).

Requirements

Ensure you have the necessary libraries installed. The scripts will notify you if either library is missing. Install them individually with:

pip install torch tensorflow pytest

Requirements

Ensure you have the necessary libraries installed. The scripts will notify you if either library is missing. Install them individually with:

pip install torch tensorflow pytest

Alternatively, install everything from the provided requirements file:

pip install -r requirements.txt

Testing

This project uses pytest for its test suite. After installing the required packages, run:

pytest

This command executes the tests under the tests directory and verifies that each GPU detection script runs without errors.

Acknowledgments

Thanks to the open-source community for the tools and libraries used.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages