CUDA—GPU Acceleration for Fast Training and Evaluation

Get a brief introduction to CUDA and how it accelerates training and evaluation.

The NVIDIA CUDA Toolkit is a fully optimized parallel computing platform for general-purpose computing on graphics processing units (GPGPU). It allows us to perform scientific computing on NVIDIA graphic cards, including linear algebra, image and video processing, deep learning, and graph analytics. It is used by a lot of commercial and open-source software to enable GPU-accelerated computation across different domains. If we look back at the development of deep learning, we should realize that the latest breakthroughs in GANs would have been almost impossible without the help of CUDA and powerful GPUs. Therefore, we highly recommend we try out the experiments in this course on a CUDA-compatible GPU; otherwise, the training time of neural networks could be painfully long on CPUs.

In this section, we will walk through the installation of CUDA on Windows 10 and Ubuntu. Before we start installing CUDA, we should make sure that our video card supports CUDA and that we have installed the latest driver for our video card. To check whether our GPU is compatible with CUDA (or the exact CUDA version we want to install), we should first make sure we have an NVIDIA video card on our machine.

On Windows, we can use third-party tools such as GPU-Z or GPU Caps Viewer to examine the specifications of our video card. The most straightforward and practical way, however, to check whether the latest CUDA perfectly runs on our system is to finish the installation and evaluation steps in the following subsections without any issues.

Installing NVIDIA driver

On Windows 10, download the driver by choosing the product and operating system based on our video card and system. Installation on Windows should be very straightforward since it has a graphical user interface (GUI). We can keep the default settings during installation. Install the NVIDIA driver in the following way so that our graphics driver can be updated in the same way as other software. First, open up a terminal and add the proper repository to the package management source list by typing in the following:

Get hands-on with 1400+ tech skills courses.