What is GPU pass-through
GPU pass-through technology allows containerized applications to directly access the GPU hardware resources of the host system. This provides containers with bare-metal performance for GPU-intensive workloads, making it ideal for AI/ML applications that require significant computational power. By enabling direct GPU access, applications can utilize GPU cores for parallel processing, significantly accelerating training and inference tasks compared to CPU-only environments.
Advantech Container Catalog
Advantech provides an GPU Passthrough with built-in support for GPUs and frameworks like PyTorch, TensorFlow, and CUDA®. This section explains how to leverage GPU pass-through capabilities for AI applications using this container image.
Demo Scenario
A data center administrator needs to proactively monitor server temperatures to prevent system crashes and hardware failures. Using Advantech's GPU-accelerated container, they can deploy a real-time temperature monitoring system that uses deep learning to predict potential system failures before they occur. This approach leverages historical temperature data and LSTM (Long Short-Term Memory) neural networks to detect anomalous temperature patterns that precede system crashes.
Before you start
To follow this tutorial effectively, familiarity with the following technologies and concepts will be helpful:
- Docker and container orchestration: Understanding of containers, images, GPU pass-through, and Docker Compose
- Python programming: Knowledge of Python, PyTorch, and deep learning concepts
- GPU computing: Basic familiarity with CUDA® and GPU acceleration principles
- System monitoring: Understanding of hardware monitoring and temperature thresholds
If you need to strengthen your knowledge in these areas, here are some helpful resources.
Run the container
-
Visit the GPU Passthrough website to review container details, GPU compatibility, and system requirements.
-
Ensure your system has compatible GPUs with appropriate drivers installed, as the container requires GPU pass-through capabilities.
-
Download the required Docker Compose file and build script from GitHub
-
Place both files (
build.shanddocker-compose.yml) in the same directory on your device. -
Run the build script with the following commands:
chmod +x build.sh
sudo ./build.sh -
After running build.sh, you will enter the container with a bash UI
Build and run your own application
Understanding the demo components
This demo consists of several key components:
-
Training Dataset: The
fake_temp.csvfile contains historical temperature data paired with binary labels indicating whether a system crash occurred. This dataset is used to train our predictive model. -
LSTM Neural Network Model: The
train.pyscript defines and trains a deep learning model using PyTorch's LSTM cells, which are particularly suited for sequence data like temperature patterns over time. -
Real-time Monitoring System: The
ai.pyscript implements a monitoring system that continuously collects temperature data and uses the trained model to predict potential system failures.
Start Coding and build image
-
On your device, create a new folder
mkdir myContainer
cd myContainer