filmov
tv
How to Setup GPU for TensorFlow in the Cloud

Показать описание
This tutorila will show you how to create a google cloud enviornment to perform Tensorflow machine learning tasks with a GPU graphic processing unit. We will use Google Compute Engine in conjunction with a Tesla K80 Nvidia GPU card. We will also create a jupyter notebook to use in the browser as an example. We will also use docker as an easy way to create a tensorflow enviornment.
In general, if the step of the process can be described such as “do this mathematical operation thousands of times”, then send it to the GPU. Examples include matrix multiplication and computing the inverse of a matrix. In fact, many basic matrix operations are prime candidates for GPUs. As an overly broad and simple rule, other operations should be performed on the CPU.
#tensorflow #nvidia #gpu
Cuda Nvidia Google Startup Scripts
*We used Ubuntu 18 as our operating system
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda-10-0; then
apt-get update
apt-get install cuda-10-0 -y
fi
# Enable persistence mode
nvidia-smi -pm 1
Install Docker
# Add NVIDIA's docker repository to your system.
# Install nvidia-docker2 and restart the Docker daemon.
&& sudo apt-get update \
&& sudo apt-get install -y nvidia-docker2 \
&& sudo pkill -SIGKILL dockerd
# Test nvidia-smi within the Docker container.
sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
Docker Container Pre-Configured with TensorFlow
docker run -it -d macgyvertechnology/tensorflow-gpu:basic-jupyter
Need Consulting?
Run Machine Learning Models in the Cloud
In general, if the step of the process can be described such as “do this mathematical operation thousands of times”, then send it to the GPU. Examples include matrix multiplication and computing the inverse of a matrix. In fact, many basic matrix operations are prime candidates for GPUs. As an overly broad and simple rule, other operations should be performed on the CPU.
#tensorflow #nvidia #gpu
Cuda Nvidia Google Startup Scripts
*We used Ubuntu 18 as our operating system
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda-10-0; then
apt-get update
apt-get install cuda-10-0 -y
fi
# Enable persistence mode
nvidia-smi -pm 1
Install Docker
# Add NVIDIA's docker repository to your system.
# Install nvidia-docker2 and restart the Docker daemon.
&& sudo apt-get update \
&& sudo apt-get install -y nvidia-docker2 \
&& sudo pkill -SIGKILL dockerd
# Test nvidia-smi within the Docker container.
sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
Docker Container Pre-Configured with TensorFlow
docker run -it -d macgyvertechnology/tensorflow-gpu:basic-jupyter
Need Consulting?
Run Machine Learning Models in the Cloud
Комментарии