Forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Created
September 7, 2018 19:54
Revisions
-
zhanwenchen revised this gist
Apr 12, 2018 . 1 changed file with 18 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -160,7 +160,22 @@ deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA Runtime Versi Result = PASS ``` Cleanup: if ./deviceQuery works, remember to `rm` the 4 files (1 downloaded and 3 extracted). ## Install cuDNN 7.0 The recommended way for installing cuDNN is to 1. Download the "cuDNN v7.0.5 Library for Linux" `tgz` file (need to register for an Nvidia account). 2. `sudo mv` the downloaded archive to `/usr/local`. This might seem silly at first, but when you unzip it next you will see that the contents end up going to various folders under `/usr/local/cuda` and would be messy to move otherwise. 3. Then `cd /usr/local` and extract the `tgz` by ``` sudo tar -xvzf cudnn-9.0-linux-x64-v7.tgz ``` 4. Finally, execute `sudo ldconfig` to update the shared library cache. 5. Clean up now or later by `sudo rm cudnn-9.0-linux-x64-v7.tgz` -
zhanwenchen revised this gist
Apr 12, 2018 . 1 changed file with 2 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ *Updated 4/11/2018* Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS. ## Table of Contents @@ -162,9 +163,4 @@ Result = PASS ## Install cuDNN The recommended way for installing cuDNN is to first copy the `tgz` file to `/usr/local` and then extract it, and then remove the `tgz` file if necessary. This method will preserve symbolic links. At last, execute `sudo ldconfig` to update the shared library cache. -
zhanwenchen revised this gist
Apr 12, 2018 . 1 changed file with 45 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -113,6 +113,51 @@ cd /usr/local/cuda/samples/bin/x86_64/linux/release The result of running `deviceQuery` should look something like this: ``` ./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "GeForce GTX 1060" CUDA Driver Version / Runtime Version 9.0 / 9.0 CUDA Capability Major/Minor version number: 6.1 Total amount of global memory: 6073 MBytes (6367739904 bytes) (10) Multiprocessors, (128) CUDA Cores/MP: 1280 CUDA Cores GPU Max Clock rate: 1671 MHz (1.67 GHz) Memory Clock rate: 4004 Mhz Memory Bus Width: 192-bit L2 Cache Size: 1572864 bytes Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384) Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 49152 bytes Total number of registers available per block: 65536 Warp size: 32 Maximum number of threads per multiprocessor: 2048 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (1024, 1024, 64) Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) Maximum memory pitch: 2147483647 bytes Texture alignment: 512 bytes Concurrent copy and kernel execution: Yes with 2 copy engine(s) Run time limit on kernels: Yes Integrated GPU sharing Host Memory: No Support host page-locked memory mapping: Yes Alignment requirement for Surfaces: Yes Device has ECC support: Disabled Device supports Unified Addressing (UVA): Yes Supports Cooperative Kernel Launch: Yes Supports MultiDevice Co-op Kernel Launch: Yes Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0 Compute Mode: < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA Runtime Version = 9.0, NumDevs = 1 Result = PASS ``` ## Install cuDNN -
zhanwenchen revised this gist
Apr 12, 2018 . 1 changed file with 19 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,27 +60,27 @@ I suggest extracting the above three components and executing 2 and 3 separately ``` cd chmod +x cuda_9.0.176_384.81_linux-run ./cuda_9.0.176_384.81_linux-run --extract=$HOME ``` You should have unpacked three components: `NVIDIA-Linux-x86_64-384.81.run` (1. NVIDIA driver that we ignore), `cuda-linux.9.0.176-22781540.run` (2. CUDA 9.0 installer), and `cuda-samples.9.0.176-22781540-linux.run` (3. CUDA 9.0 Samples). Execute the second one to install the CUDA Toolkit 9.0: ``` sudo ./cuda-linux.9.0.176-22781540.run ``` You now have to accept the license by scrolling down to the bottom (hit the "d" key on your keyboard) and enter "accept". Next accept the defaults. To verify our CUDA installation, install the sample tests by ``` sudo ./cuda-samples.9.0.176-22781540-linux.run ``` After the installation finishes, configure the runtime library. @@ -90,11 +90,17 @@ sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf" sudo ldconfig ``` It is also recommended for Ubuntu users to append string `/usr/local/cuda/bin` to system file `/etc/environments` so that `nvcc` will be included in `$PATH`. This will take effect after reboot. To do that, you just have to ``` sudo vim /etc/environments ``` and then add `:/usr/local/cuda/bin` (including the ":") at the end of the PATH="/blah:/blah/blah" string (inside the quotes). After a `reboot`, let's test our installation by making and invoking our tests: ``` cd /usr/local/cuda-9.0/samples sudo make ``` -
zhanwenchen revised this gist
Apr 12, 2018 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ *Updated 4/11/2018* Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS. ## Table of Contents - [Install NVIDIA Graphics Driver via apt-get](#install-nvidia-graphics-driver-via-apt-get) @@ -38,15 +39,15 @@ Afterwards, you can check the Installation with the `nvidia-smi` command, which These commands can be added to `/etc/rc.local` for excuting at system boot. ## 2. Install CUDA 9.0 Installing CUDA from runfile is much simpler and smoother than installing the NVIDIA driver. It just involves copying files to system directories and has nothing to do with the system kernel or online compilation. Removing CUDA is simply removing the installation directory. So I personally does not recommend adding NVIDIA's repositories and install CUDA via `apt-get` or other package managers as it will not reduce the complexity of installation or uninstallation but increase the risk of messing up the configurations for repositories. The CUDA runfile installer can be downloaded from [NVIDIA's websie](https://developer.nvidia.com/cuda-downloads), or using wget in case you can't find it easily on NVIDIA: ``` cd wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run ``` What you download is a package the following three components: -
zhanwenchen revised this gist
Apr 12, 2018 . 1 changed file with 5 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,23 +11,15 @@ Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of Do not use the CUDA run file to install your driver. Use `apt-get` instead. This way you do not need to worry about the Nouveau stuff you read about on [StackOverflow](https://askubuntu.com/questions/799184/how-can-i-install-cuda-on-ubuntu-16-04). As of 04/11/2018, the latest version of NVIDIA driver for Ubuntu 16.04.4 LTS is 384. To install the driver, excute ```sudo apt-get nvidia-384 nvidia-modprobe``` , and then you will be prompted to disable Secure Boot. Select **Disable**. Reboot the machine but **enter BIOS to disable Secure Boot**. Typically you can enter BIOS by hitting F12 rapidly as soon as the system restarts. Afterwards, you can check the Installation with the `nvidia-smi` command, which will report all your CUDA-capable devices in the system. ### Common Errors and Solutions -
zhanwenchen revised this gist
Oct 2, 2017 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -118,4 +118,9 @@ The result of running `deviceQuery` should look something like this: ## Install cuDNN The recommended way for installing cuDNN is to first copy the `tgz` file to `/usr/local` and then extract it, and then remove the `tgz` file if necessary. This method will preserve symbolic links. At last, execute `sudo ldconfig` to update the shared library cache. ## libEGL [Solution for libEGL](https://askubuntu.com/questions/900285/libegl-so-1-is-not-a-symbolic-link) -
zhanwenchen revised this gist
Sep 30, 2017 . 1 changed file with 48 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of ## 1. Install NVIDIA Graphics Driver via apt-get Do not use the CUDA run file to install your driver. Use `apt-get` instead. This way you do not need to worry about the Nouveau stuff you read about on [StackOverflow](https://askubuntu.com/questions/799184/how-can-i-install-cuda-on-ubuntu-16-04). As of 09/30/2017, the latest version of NVIDIA driver for Ubuntu 16.04.3 LTS is 375. To install the driver, excute ```sudo apt-get nvidia-375 nvidia-modprobe``` @@ -50,32 +50,71 @@ These commands can be added to `/etc/rc.local` for excuting at system boot. Installing CUDA from runfile is much simpler and smoother than installing the NVIDIA driver. It just involves copying files to system directories and has nothing to do with the system kernel or online compilation. Removing CUDA is simply removing the installation directory. So I personally does not recommend adding NVIDIA's repositories and install CUDA via `apt-get` or other package managers as it will not reduce the complexity of installation or uninstallation but increase the risk of messing up the configurations for repositories. The CUDA runfile installer can be downloaded from [NVIDIA's websie](https://developer.nvidia.com/cuda-downloads), or using wget in case you can't find it easily on NVIDIA: ``` cd wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run ``` What you download is a package the following three components: 1. an NVIDIA driver installer, but usually of stale version; 2. the actual CUDA installer; 3. the CUDA samples installer; I suggest extracting the above three components and executing 2 and 3 separately (remember we installed the driver ourselves already). To extract them, execute the runfile installer with `--extract` option: ``` cd chmod +x cuda_8.0.61_375.26_linux.run ./cuda_8.0.61_375.26_linux.run --extract=$HOME ``` You should have unpacked three components: `NVIDIA-Linux-x86_64-375.26.run` (1. NVIDIA driver that we ignore), `cuda-linux64-rel-8.0.61-21551265.run` (2. CUDA 8 installer), and `cuda-samples-linux-8.0.61-21551265.run` (3. CUDA 8 Samples). Execute the second one to install the CUDA Toolkit 8.0: ``` sudo ./cuda-linux64-rel-8.0.61-21551265.run ``` The default install location is `/usr/local/cuda-8.0/`. To verify our CUDA installation, also install the Samples that includes two useful tools: `deviceQuery` and `p2pBandwidthLatencyTest`: ``` sudo ./cuda-samples-linux-8.0.61-21551265.run ``` After the installation finishes, configure the runtime library. ``` sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf" sudo ldconfig ``` It is also recommended for Ubuntu users to append string `/usr/local/cuda/bin` to system file `/etc/environments` so that `nvcc` will be included in `$PATH`. This will take effect after reboot. After the reboot, let's test our installation by making and invoking our tests: ``` cd /usr/local/cuda-8.0/samples sudo make ``` It's a long process with many irrelevant warnings about deprecated architectures (`sm_20` and such ancient GPUs). After it completes, run `deviceQuery` and `p2pBandwidthLatencyTest`: ``` cd /usr/local/cuda/samples/bin/x86_64/linux/release ./deviceQuery ``` The result of running `deviceQuery` should look something like this: ## Install cuDNN The recommended way for installing cuDNN is to first copy the `tgz` file to `/usr/local` and then extract it, and then remove the `tgz` file if necessary. This method will preserve symbolic links. -
zhanwenchen revised this gist
Sep 30, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,7 +65,7 @@ cd ~ wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run chmod +x cuda_8.0.61_375.26_linux.run ./cuda_8.0.61_375.26_linux.run --extract=$HOME sudo ./cuda-linux64-rel-8.0.61-21551265.run ``` After the installation finishes, configure runtime library. -
zhanwenchen revised this gist
Sep 15, 2017 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,9 @@ Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of <small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small> ## 1. Install NVIDIA Graphics Driver via apt-get Do not use the CUDA run file to install your driver. Use `apt-get` instead. As of 09/15/2017 the latest version of NVIDIA driver for Ubuntu 16.04.3 LTS is 375. To install the driver, excute @@ -44,7 +46,7 @@ After a succesful installation, `nvidia-smi` command will report all your CUDA-c These commands can be added to `/etc/rc.local` for excuting at system boot. ## 2. Install CUDA 8.0 Installing CUDA from runfile is much simpler and smoother than installing the NVIDIA driver. It just involves copying files to system directories and has nothing to do with the system kernel or online compilation. Removing CUDA is simply removing the installation directory. So I personally does not recommend adding NVIDIA's repositories and install CUDA via `apt-get` or other package managers as it will not reduce the complexity of installation or uninstallation but increase the risk of messing up the configurations for repositories. @@ -60,10 +62,10 @@ Scripts for installing CUDA Toolkit are summarized below. ``` cd ~ wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run chmod +x cuda_8.0.61_375.26_linux.run ./cuda_8.0.61_375.26_linux.run --extract=$HOME // TODO: what is this? sudo ./cuda-linux64-rel-7.5.18-19867135.run ``` After the installation finishes, configure runtime library. -
zhanwenchen revised this gist
Sep 15, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,11 @@ Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of ## Install NVIDIA Graphics Driver via apt-get As of 09/15/2017 the latest version of NVIDIA driver for Ubuntu 16.04.3 LTS is 375. To install the driver, excute ```sudo apt-get nvidia-375 nvidia-modprobe``` , and then reboot the machine. The `nvidia-modprobe` utility is used to load NVIDIA kernel modules and create NVIDIA character device files automatically everytime your machine boots up. -
zhanwenchen revised this gist
Sep 15, 2017 . 1 changed file with 0 additions and 93 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,99 +23,6 @@ It is recommended for new users to install the driver via this way because it is 2. There would be some naming conflicts when other repositories (e.g. ones from CUDA) are added to the system. 3. One has to reinstall the driver after Linux kernel are updated. ### Check the Installation After a succesful installation, `nvidia-smi` command will report all your CUDA-capable devices in the system. -
zhanwenchen revised this gist
Sep 15, 2017 . 1 changed file with 1 addition and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,7 @@ Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of Ubuntu Desktop 16.04.3 LTS. ## Table of Contents - [Install NVIDIA Graphics Driver via apt-get](#install-nvidia-graphics-driver-via-apt-get) - [Install CUDA](#install-cuda) - [Install cuDNN](#install-cudnn) -
wangruohui revised this gist
Aug 29, 2017 . 1 changed file with 8 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,24 +55,25 @@ sudo dpkg -P cuda-repo-ubuntu1404 ### Download the Driver The latest NVIDIA driver for Linux OS can be fetched from [NVIDIA's official website](http://www.nvidia.com/object/unix.html). The first one in the list, i.e. Latest Long Lived Branch version for Linux x86_64/AMD64/EM64T, is suitable for most case. If you want to down load the driver directly in a Linux shell, the script below would be useful. ``` cd ~ wget http://us.download.nvidia.com/XFree86/Linux-x86_64/384.69/NVIDIA-Linux-x86_64-384.69.run ``` Detailed installation instruction can be found in the download page via a [README](http://us.download.nvidia.com/XFree86/Linux-x86_64/384.69/README/index.html) hyperlink in the ADDITIONAL INFORMATION tab. I have also summarized key steps below. ### Install Dependencies Software required for the runfile are officially listed [here](http://us.download.nvidia.com/XFree86/Linux-x86_64/384.69/README/minimumrequirements.html). But this page seems to be stale and not easy to follow. For Ubuntu, installing the following dependencies is enough. 1. `build-essential` -- For building the driver 2. (Optional) `gcc-multilib` -- For providing 32-bit support 3. `dkms` -- For providing dkms support 4. (Optional) `xorg` and `xorg-dev`. On a workstation with GUI, this is require but usually have already been installed, because you have already got the graphic display. On headless servers without GUI, this is not a must. @@ -111,8 +112,8 @@ After above batch of preparition, we can eventually start excuting the runfile. ``` cd ~ chmod +x NVIDIA-Linux-x86_64-384.69.run sudo ./NVIDIA-Linux-x86_64-384.69.run --dkms -s ``` Note: -
wangruohui revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ In Ubuntu systems, drivers for NVIDIA Graphics Cards are already provided in the For ubuntu 14.04.5 LTS, the latest version is 352. To install the driver, excute `sudo apt-get nvidia-352 nvidia-modprobe`, and then reboot the machine. For ubuntu 16.04.3 LTS, the latest version is 375. To install the driver, excute `sudo apt-get nvidia-375 nvidia-modprobe`, and then reboot the machine. The `nvidia-modprobe` utility is used to load NVIDIA kernel modules and create NVIDIA character device files automatically everytime your machine boots up. -
wangruohui revised this gist
Aug 29, 2017 . No changes.There are no files selected for viewing
-
Ruohui Wang revised this gist
Dec 18, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -80,7 +80,7 @@ As a summary, excuting `sudo apt-get install build-essential gcc-multilib dkms` Required packages for CentOS are `epel-release dkms libstdc++.i686`. Execute `yum install epel-release dkms libstdc++.i686`. Required packages for Fedora are `dkms libstdc++.i686 kernel-devel`. Execute `dnf install dkms libstdc++.i686 kernel-devel`. ### Creat Blacklist for Nouveau Driver -
Ruohui Wang revised this gist
Nov 6, 2016 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -92,8 +92,6 @@ options nouveau modeset=0 ``` Note: It is also possible for the NVIDIA installation runfile to creat this blacklist file automatically. Excute the runfile and follow instructions when an error realted Nouveau appears. Then, 1. for Ubuntu 14.04 LTS, reboot the computer; @@ -107,8 +105,6 @@ After the computer is rebooted. We need to stop the desktop manager before excut 1. For Ubuntu 14.04 / 16.04, excuting `sudo service lightdm stop` (or use `gdm` or `kdm` instead of `lightdm`) 2. For Ubuntu 16.04 / Fedora / CentOS, excuting `sudo systemctl stop lightdm` (or use `gdm` or `kdm` instead of `lightdm`) ### Excuting the Runfile After above batch of preparition, we can eventually start excuting the runfile. So this is why I, from the very begining, recommend new users to install the driver via `apt-get`. -
Ruohui Wang revised this gist
Nov 4, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can. ## Table of Contents - [Install NVIDIA Graphics Driver via apt-get](#install-nvidia-graphics-driver-via-apt-get) @@ -31,7 +31,7 @@ It is recommended for new users to install the driver via this way because it is 1. The driver included in official Ubuntu repository is usually not the latest. 2. There would be some naming conflicts when other repositories (e.g. ones from CUDA) are added to the system. 3. One has to reinstall the driver after Linux kernel are updated. ## Install NVIDIA Graphics Driver via runfile -
Ruohui Wang revised this gist
Nov 4, 2016 . 1 changed file with 12 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,24 +57,24 @@ sudo dpkg -P cuda-repo-ubuntu1404 The latest driver for NVIDIA products can always be fetched from [NVIDIA's official website](http://www.nvidia.com/Download/index.aspx). It is not necessary to select all terms carefully. The driver provided for the same Product Series and Operating System is generally the same. For example, in order to find a driver for a GTX TITAN X graphics card, selecting GeForce 900 Series in Product Series and Linux 64-bit in Operating System is enough. If you want to down load the driver directly in a Linux shell, the script below would be useful. ``` cd ~ wget http://us.download.nvidia.com/XFree86/Linux-x86_64/367.57/NVIDIA-Linux-x86_64-367.57.run ``` Detailed installation instruction can be found in the download page via a [README](http://us.download.nvidia.com/XFree86/Linux-x86_64/367.57/README/index.html) hyperlink in the ADDITIONAL INFORMATION tab. I have also summarized key steps below. ### Install Dependencies Software required for the runfile are officially listed [here](http://us.download.nvidia.com/XFree86/Linux-x86_64/367.57/README/minimumrequirements.html). But this page seems to be stale and not easy to follow. For Ubuntu, installing the following dependencies is enough. 1. `build-essential` -- For building the driver 2. `gcc-multilib` -- For providing 32-bit support 3. `dkms` -- For providing dkms support 4. (Optional) `xorg` and `xorg-dev`. On a workstation with GUI, this is require but usually have already been installed, because you have already got the graphic display. On headless servers without GUI, this is not a must. As a summary, excuting `sudo apt-get install build-essential gcc-multilib dkms` to install all dependencies. @@ -92,6 +92,8 @@ options nouveau modeset=0 ``` Note: It is also possible for the NVIDIA installation runfile to creat this blacklist file automatically. Excute the runfile and follow instructions when an error realted Nouveau appears. Note: It seems this step be not required for driver version 367.57. Then, 1. for Ubuntu 14.04 LTS, reboot the computer; @@ -105,22 +107,24 @@ After the computer is rebooted. We need to stop the desktop manager before excut 1. For Ubuntu 14.04 / 16.04, excuting `sudo service lightdm stop` (or use `gdm` or `kdm` instead of `lightdm`) 2. For Ubuntu 16.04 / Fedora / CentOS, excuting `sudo systemctl stop lightdm` (or use `gdm` or `kdm` instead of `lightdm`) Note: It seems this step be not required for driver version 367.57. ### Excuting the Runfile After above batch of preparition, we can eventually start excuting the runfile. So this is why I, from the very begining, recommend new users to install the driver via `apt-get`. ``` cd ~ chmod +x NVIDIA-Linux-x86_64-367.57.run sudo ./NVIDIA-Linux-x86_64-367.57.run --dkms -s ``` Note: 1. option `--dkms` is used for register dkms module into the kernel so that update of the kernel will not require a reinstallation of the driver. This option should be turned on by default. 2. option `-s` is used for silent installation which should used for batch installation. For installation on a single computer, this option should be turned off for more installtion information. 3. option `--no-opengl-files` can also be added if non-NVIDIA (AMD or Intel) graphics are used for display while NVIDIA graphics are used for display. 4. The installer may prompt warning on a system without X.Org installed. It is safe to ignore that based on my experience. ``` WARNING: nvidia-installer was forced to guess the X library path '/usr/lib' and X module path '/usr/lib/xorg/modules'; these paths were not queryable from the system. If X fails to find the NVIDIA X driver module, please install the `pkg-config` utility and the X.Org SDK/development package for your distribution and reinstall the driver. ``` -
Ruohui Wang revised this gist
Sep 21, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ In this article, I will share some of my experience on installing the NVIDIA dri ## Table of Contents - [Install NVIDIA Graphics Driver via apt-get](#install-nvidia-graphics-driver-via-apt-get) - [Install NVIDIA Graphics Driver via runfile](#install-nvidia-graphics-driver-via-runfile) * [Remove Previous Installations (Important)](#remove-previous-installations--important-) * [Download the Driver](#download-the-driver) * [Install Dependencies](#install-dependencies) * [Creat Blacklist for Nouveau Driver](#creat-blacklist-for-nouveau-driver) @@ -37,7 +37,7 @@ It is recommended for new users to install the driver via this way because it is For advanced user who wants to get the latest version of the driver, get rid of the reinstallation issue caused bby dkms, or using Linux distributions that do not have nvidia drivers provided in the repositories, installing from runfile is recommended. ### Remove Previous Installations (Important) One might have installed the driver via `apt-get`. So before reinstall the driver from runfile, uninstalling previous installations is required. Executing the following scripts carefully one by one. -
Ruohui Wang revised this gist
Sep 20, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -178,4 +178,5 @@ It is also recommended for Ubuntu users to append string `/usr/local/cuda/bin` t ## Install cuDNN The recommended way for installing cuDNN is to first copy the `tgz` file to `/usr/local` and then extract it, and then remove the `tgz` file if necessary. This method will preserve symbolic links. At last, execute `sudo ldconfig` to update the shared library cache. -
Ruohui Wang revised this gist
Sep 20, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ In this article, I will share some of my experience on installing the NVIDIA dri * [Common Errors and Solutions](#common-errors-and-solutions) * [Additional Notes](#additional-notes) - [Install CUDA](#install-cuda) - [Install cuDNN](#install-cudnn) <small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small> @@ -176,6 +176,6 @@ sudo ldconfig It is also recommended for Ubuntu users to append string `/usr/local/cuda/bin` to system file `/etc/environments` so that `nvcc` will be included in `$PATH`. This will take effect after reboot. ## Install cuDNN The recommended way for installing cuDNN is to first copy the `tgz` file to `/usr/local` and then extract it, and then remove the `tgz` file if necessary. This method will preserve symbolic links. -
Ruohui Wang revised this gist
Sep 6, 2016 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,14 @@ In this article, I will share some of my experience on installing the NVIDIA driver and CUDA. I will mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can. ## Table of Contents - [Install NVIDIA Graphics Driver via apt-get](#install-nvidia-graphics-driver-via-apt-get) - [Install NVIDIA Graphics Driver via runfile](#install-nvidia-graphics-driver-via-runfile) * [Remove Previous Installations](#remove-previous-installations) * [Download the Driver](#download-the-driver) * [Install Dependencies](#install-dependencies) * [Creat Blacklist for Nouveau Driver](#creat-blacklist-for-nouveau-driver) * [Stop lightdm/gdm/kdm](#stop-lightdm-gdm-kdm) * [Excuting the Runfile](#excuting-the-runfile) * [Check the Installation](#check-the-installation) * [Common Errors and Solutions](#common-errors-and-solutions) * [Additional Notes](#additional-notes) @@ -18,7 +17,6 @@ In this article, I will share some of my experience on installing the NVIDIA dri <small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small> ## Install NVIDIA Graphics Driver via apt-get In Ubuntu systems, drivers for NVIDIA Graphics Cards are already provided in the official repository. Installation is as simple as one command. -
Ruohui Wang revised this gist
Sep 4, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -176,6 +176,8 @@ sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf" sudo ldconfig ``` It is also recommended for Ubuntu users to append string `/usr/local/cuda/bin` to system file `/etc/environments` so that `nvcc` will be included in `$PATH`. This will take effect after reboot. ## Install cnDNN The recommended way for installing cuDNN is to first copy the `tgz` file to `/usr/local` and then extract it, and then remove the `tgz` file if necessary. This method will preserve symbolic links. -
Ruohui Wang revised this gist
Sep 4, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -109,7 +109,7 @@ After the computer is rebooted. We need to stop the desktop manager before excut ### Excuting the Runfile After above batch of preparition, we can eventually start excuting the runfile. So this is why I, from the very begining, recommend new users to install the driver via `apt-get`. ``` cd ~ -
Ruohui Wang revised this gist
Sep 2, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -163,7 +163,11 @@ To extract above three components, one can execute the runfile installer with `- Scripts for installing CUDA Toolkit are summarized below. ``` cd ~ wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run chmod +x cuda_7.5.18_linux.run ./cuda_7.5.18_linux.run --extract=$HOME sudo ./cuda-linux64-rel-7.5.18-19867135.run ``` After the installation finishes, configure runtime library. -
Ruohui Wang revised this gist
Sep 2, 2016 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -163,11 +163,7 @@ To extract above three components, one can execute the runfile installer with `- Scripts for installing CUDA Toolkit are summarized below. ``` ``` After the installation finishes, configure runtime library. -
Ruohui Wang revised this gist
Sep 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -166,7 +166,7 @@ Scripts for installing CUDA Toolkit are summarized below. cd ~ wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run chmod +x cuda_7.5.18_linux.run ./cuda_7.5.18_linux.run --extract=`~` sudo ./cuda-linux64-rel-7.5.18-19867135.run ``` -
Ruohui Wang revised this gist
Aug 31, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -153,6 +153,7 @@ These commands can be added to `/etc/rc.local` for excuting at system boot. Installing CUDA from runfile is much simpler and smoother than installing the NVIDIA driver. It just involves copying files to system directories and has nothing to do with the system kernel or online compilation. Removing CUDA is simply removing the installation directory. So I personally does not recommend adding NVIDIA's repositories and install CUDA via `apt-get` or other package managers as it will not reduce the complexity of installation or uninstallation but increase the risk of messing up the configurations for repositories. The CUDA runfile installer can be downloaded from [NVIDIA's websie](https://developer.nvidia.com/cuda-downloads). But what you download is a package the following three components: 1. an NVIDIA driver installer, but usually of stale version; 2. the actual CUDA installer; 3. the CUDA samples installer;
NewerOlder