How to Prepare Your GPU Machine and Get It cuDNN Ready

By Henry Lee, Solutions Architect

Video and image processing solutions are some of the hottest topics of today. They play a crucial role in making artificial intelligence a reality, such as in AR/VR and unmanned vehicle (driverless) technologies. There are number of packaged solutions in the market for video and image processing, and most of them depend on GPU technology to run.

However, there are always questions about the preparation of GPU system for video or image processing. Although we can easily get prebuilt images on a software marketplace, but many packaged solutions have their own prerequisites. Depending on your application, manual installation for specific versions may be preferred over packaged solutions.

This article captures the step-by-step installation process for the preparation of cuDNN on Alibaba Cloud GPU compute service. cuDNN is part of the NVIDIA deep learning SDK includes standard routines such as pooling, normalization and convolution.

To prepare the deep learning platform, we start with setting up the GPU compute service. We can deploy any GN5 series machine; in this demo, we will be using an X86_64 Linux platform machine. We install setup both cuDNN and CUDA drivers (requirement for cuDNN library) and follow up with the verification of the cuDNN library.

Image for post
Image for post

There are two options of package supported; it can be either a package file in tar or deb format. We can download the required directly package from https://developer.nvidia.com/cuda-downloads

We can now install the first package with the following command.

sudo dpkg –i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb

Then you can install the CUDA GPG public key by running the command below.

sudo apt-key adv –fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
Image for post
Image for post
Image for post
Image for post

Next, we will update the cache with the command below.

sudo apt-get update

You should expect to see the following output.

Image for post
Image for post

The CUDA is ready and we can verify the driver with the deviceQuery command.

/usr/local/cuda/extras/demo_suite/deviceQuery

You should expect the following output.

Image for post
Image for post
Image for post
Image for post

Now we can start the cuDNN setup. First you’ll need to get the cuDNN package, which includes the following files:

1.    Libcudnn7-dev_7.1.3.16-1+cuda9.0-amd64.deb
2. Libcudnn7-doc_7.1.3.16-1+cuda9.0_amd64.deb
3. Libcudnn7_7.1.3.16-1+cuda9.0_am64.deb
Image for post
Image for post

We can now install the required runtime library.

Sudo dpkg –I libcudnn7_7.1.3.16-1+cuda9.0_amd64.deb
Image for post
Image for post

Next, you need to update the apt cache.

sudo apt-get update
Image for post
Image for post

Next, install the developer library.

Sudo dpkg –I libcudnn7-dev_7.1.3.16-1+cuda9.0_amd64.deb
Image for post
Image for post

Install code samples and documents such as user guides with the command below.

Sudo dpkg –I libcudnn7-doc_7.0.3.11-1+cuda9.0_amd65.deb
Image for post
Image for post

Your cuDNN driver is ready to go. We can verify the setup with mninstCUDNN*. If everything is set up correctly, you should expect the following result.

Image for post
Image for post

Now your GPU system is ready for deep learning! Get started now on Alibaba Cloud’s GPU platform for a flexible and cost effective way to run machine learning and deep learning projects.

Reference:https://www.alibabacloud.com/blog/how-to-prepare-your-gpu-machine-and-get-it-cudnn-ready_594484?spm=a2c41.12584207.0.0

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store