Frameworks such as Tensorflow, Pytorch, Theano and Cognitive Toolkit (CNTK) (and by extension any deep learning library which works alongside them, e.g. Keras) permit significantly faster training of deep learning when they are set up with GPU (graphics processing unit) support compared with using a CPU.
For GPU support to be available for those deep learning frameworks, the GPU itself must be compatible with the CUDA toolkit and any additional required GPU-Accelerated Libraries, for example cuDNN.
At present, CUDA compatibility is largely limited to Nvidia GPUs. Apple has released Tensorflow Metal to enable AMD GPU for Tensorflow (see a tutorial by Jack Chih-Hsu Lin on Medium, on setting Tensorflow Metal up on a Mac), but I personally only like Windows and Linux, so I won’t be covering any Mac based tutorials.
So, if you have other GPU hardware such as AMD, you may wish to swap it out of your Windows PC for an Nvidia GPU, and set up new Nvidia driver software. This is what I had to do for my PC, and this post guides you through that process, step by step.
Note: Because my PC has 64 bit Windows 10 installed (for now, at least), the instructions below on using software and removing and installing GPU drivers will all refer to Windows 10. However, as I plan to use this PC for machine learning and other programming projects, I will be wiping Windows and installing Linux Ubuntu 18.04 LTS (long term support) in its place.
- Step 1: Check any existing graphics card and driver software via your operating system
- Step 2: Have a look inside your PC before selecting a new GPU
- Step 3: Select a new Nvidia Compatible GPU
- Step 4: Uninstall the driver for your old GPU
- Step 5: Install the new GPU hardware
- Step 6: Get the driver software for your new GPU
- Step 7: Check the GPU installation in Windows
- Conclusions
- Other postings of this article
Step 1: Check any existing graphics card and driver software via your operating system
The first step in upgrading your computer is to check what you already have. My PC is a Chillblast Fusion Inferno 2 Gaming PC which I originally bought in January 2016. The Chillblast Fusion has an AMD Radeon R7 graphics driver on the motherboard (6595 MB of memory, VRAM 991 MB and shared memory of 5604 MB).
You can check this by using the “DirectX” diagnostic tool on windows. You do this by going to the Windows start menu, typing ‘run’ and the window shown in Fig 1 will pop up.
Type in “dxdiag” as shown in Fig 1, and the DirectX diagnostic tool opens (Fig.2). From that tool I could see that I have an AMD Radeon R7 GPU, which isn’t compatible with CUDA. This confirms the need for a GPU upgrade to a deep learning compatible GPU.
As well as checking via Windows, I thought it was important to inspect inside the PC before selecting or ordering a new GPU. This was to confirm, firstly, what slots would be available for the GPU and secondly, any available power supply. Many GPUs require their own cooling, and therefore access to the power supply unit. This is carried out in Step 2.
Step 2: Have a look inside your PC before selecting a new GPU
It has been mentioned above that a new GPU installation requires an available slot on your motherboard; this is a PCI express (PCIe) slot. On opening up the PC, confirm there a slot available for GPU installation. This is shown for my computer in Fig 3.
In addition to the requirement for a slot on your motherboard, most of the Nvidia GPUs considered require a dedicated power supply for cooling. Opening the PC case was helpful to check the power supply already there (and order an additional one if there wasn’t one).
The power supply available in my PC is 500 W (see Fig.4). It also has a spare cables from it, one of which has a 6 pin connector. The cables were unused and tucked into the corner of the PC’s enclosure, and the 6 way pin can be attached to the GPU socket to provide the required power to it for cooling.
Step 3: Select a new Nvidia Compatible GPU
Most of the cards in the GTX 1000 range require a separate power supply unit (PSU), although the GTX 1050 Ti has the advantage of not requiring an additional power connector from the PSU, so this is a good entry level choice if you do not want to buy additional hardware.
I plumped for a EVGA Geforce GTX 1060 6GB to get me started, which is considered a cost-efficient entry solution to. There is a good discussion of the various Nvidia GPU options here. If you are looking to buy an Nvidia GPU, Ebay* has a huge range – I’ve added some country specific Ebay Nvidia GPU listings here: Ebay (US)*, Ebay(Canada)*, Ebay (Germany)*
Looking at the hardware requirements for the Geforce GTX 1060 GPU:
- Graphics card power needed is 120 W
- Recommended PSU (power supply unit) is a minimum of 400W
- Power connection for the GPU is a 6 PIN connector from the PSU
Previous inspection inside my PC in Step 2 shows that the 500 W power supply I already have is sufficient, and as the power supply also has an available 6 PIN connector, I have all I need to connect up the Geforce GTX 1060 GPU.
Step 4: Uninstall the driver for your old GPU
In order to remove the Download the software, it is best to use a display driver uninstaller (“DDU”). The one which I used is Wagnardsoft ; this is freeware, but donations are appreciated by the developer. The DDU software recommends that you reboot your PC into safemode when removing the drivers .
Once you have rebooted in safemode (there are numerous ways to do this on Windows 10), go to the folder where you have downloaded your DDU software, and right click on the Display Driver Uninstaller (it has file type: application) and the window in Fig. 4 will appear.
Of the DDU options shown in Fig 4.1, the best one to choose is “clean and restart (highly recommended)” — that way on removing the drivers you can at least check that your machine boots up again. The “clean and shutdown (for installing a new graphics card)” option shown in Fig 4 may sound more applicable in this situation, but it is not as useful as you don’t get to check the PC on reboot.
Step 5: Install the new GPU hardware
I had to remove two of the panels at the back of the case so the GPU could fit in; this is shown in Fig. 5. Once the GPU is installed, its connection slots are directly accessible from the back of the PC case.
When the GTX 1060 GPU arrives as new, it has a protective black rubber cover over the pins which are to be inserted into the PCIe slot.
- Remove that protective cover from the pins first.
- Hold the GPU by the side of the fan (i.e. the opposite side from the printed circuit board), and take care to avoid electrostatic discharge which could damage the GPU by touching a large metal object (such as the computer case) before you handle the GPU.
- Push the GPU onto the PCIe slot; you should feel the PCIe slot clip click and engage to hold the GPU in place.
The resulting set up is shown for my PC in Fig. 6.
Once the GPU has been inserted securely ito the PCIe slot, plug the 6 pin power from the 500 W power supply into the top of the GPU unit. The power socket on the GPU is shown on Fig. 6 (top), and the GPU with power plugged in is shown at Fig. 7 (bottom).
Additionally, it is there was a screw attachment for the GPU; this can be used to screw it securely to the PC case, as shown in Fig. 7 (top).
Now that the GPU is secured in place, power the computer up with one side of the casing off, just to make sure that the fans on the GPU are spinning. When you are happy that your GPU cabling is neatly stowed and the fans are operating, you can close up your PC case.
A note on connection to your PC monitor
Prior to fitting the GPU, my video card was connected to my PC monitor via an HDMI cable plugged into the motherboard; see the HDMI socket (motherboard) labelling on Fig 8).
The GPU, when fitted, comes with several connections, including its own HDMI and DVI socket (labelled as “HDMI socket (GPU)” and “DVI socket (GPU)” respectively on Fig. 8. While the computer is still switched off, I unplugged the HDMI cable from the motherboard, and plugged it into the GPU. Then I powered on the computer and it rebooted into windows.
If you do not switch your monitor connector (HDMI or DVI) from the motherboard socket to the GPU socket prior to turning on and booting up, although your computer boots up, you will have a black screen on your monitor. Your PC now recognises the GPU on booting up and the default display output switches from motherboard to the new GPU.
Finally having put your computer back together, it is time to get the drivers for your new GPU.
Step 6: Get the driver software for your new GPU
There is a driver CD included if you buy your Nvidia GPU driver new, however, this is probably out of date by the time you get it. The alternative (and probably better option) is to download the driver software directly from the Nvidia site here. The Geforce GTX 1060 driver software is listed as part of the Geforce 10 Series as shown in Fig. 9.
Choosing the options in Fig. 9 and clicking ‘search’ takes you to the download page shown in Fig. 10; the GPU I have is within the GeForce 10 Series:
Having downloaded and run the software, you will get the message in Fig. 11 to extract and install the Nvidia software.
A note on troubleshooting
Once I had followed the installation process above, including the Nvidia display driver software, I found that my PC did not instantly detect my new Nvidia GPU. One thing I tried to fix this was a “turn it off and turn it back on again” approach — a simple reboot. This worked for me. However, if you find that your Windows 10, 8, or 7 system cannot detect your new GPU, I found this link to be a useful resource in troubleshooting why this may be so.
Step 7: Check the GPU installation in Windows
When your GPU installation is finally recognized, it should show up in a few forms on Windows. First of all, you should be able to see it in “device manager” (as per Fig. 12).
Note that I disabled the Microsoft Basic Display Adapter (also listed in Fig. 12), as it was showing an error from the time I removed the old AMD drivers; I do not need the Microsoft basic display adapter in any event.
In Windows task manager, your new GPU should also be listed as an additional GPU. From Fig. 13 it can be seen that my original GPU — ‘GPU0’ is listed as AMD Radeon (TM) R7 graphics, and the new GPU — ‘GPU1’ is now the Nvidia GeForce GTX 1060 6GB.
Conclusions
This article covered how to check your current computer’s suitability for a GPU upgrade and how to install a new GPU in your machine, together with the drivers.
Next up will be CUDA and CuDNN software installation for deep learning on Windows, as these are needed prior to putting deep learning frameworks with GPU support such Tensorflow, Pytorch and others. These installation steps are covered in the tutorial Install Tensorflow with CUDA, cuDNN and GPU support step-by-step on your Windows 10 system.
Other postings of this article
A version of this tutorial has also been posted by Dr Joanne Kitson in Towards Data Science on medium.com
Affiliate Links
This site uses affiliate links; where these are used, they are marked with an asterisk ‘*’. By clicking on them and purchasing an item following the link, there is no extra cost to you to buy, but we receive a small commission.