In fact, besides CUDA tasks (which could be deep neural network training), our operating system also consumes a decent amount of memory for graphic rendering. This article will guide you to use onboard graphic card for display, thereby saving a considerable amount of GPU VRAM for model training. It’s especially useful when you have an NVIDIA GPU with a small memory size.
I will guide you through these steps to install necessary drivers and CUDA packages.
First, open Terminal (Ctrl+Alt+t).
You need to delete the preinstalled CUDA PPA and nvidia-cuda-toolkit package. This will ensure that you can properly install the desired version of drivers:
Remove old driver (recommended)
Update your system packages:
Add PPA and setup key server:
Add driver repositories:
Update package database again:
And, install CUDA 10.0. Please note that, when you type the following command, the suitable driver version for GPU is also installed.
Install cudnn package (for deep learning applications):
Finnaly, you need to open
~/.profile (using Nano:
nano ~/.profile) and append following content:
After this step, you will need to restart your computer and check if CUDA is installed correctly using
/etc/X11/xorg.confwith following content (using Nano:
sudo nano /etc/X11/xorg.conf):
Note that you have to change BusId (PCI:0:2:0) to your integrated GPU. List all graphic cards by following command: (Note that my Intel graphic card is
00:02.0, so I use
PCI:0:2:0 for BusId.)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop) 01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2070] (rev a1)
If everything goes in the right direction, after restarting the computer, your workstation will use the onboard card for rendering and NVIDIA GPU for CUDA works. Check with the following command when you are not running any CUDA work yourself:
If you see
No running processes found like following figure, your system is using integrated card for displaying. You can run a training task (or any other CUDA task) to ensure that the CUDA system can still operate properly.
Note that a wrong configuration in step 2 can break your system. If it happens, please reboot into recovery mode and remove
/etc/X11/xorg.conf by using
rm /etc/X11/xorg.conf command. Thank you for reading my post!