Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save pajayrao/306b41661c02b880105c4d5c577cadbd to your computer and use it in GitHub Desktop.

Select an option

Save pajayrao/306b41661c02b880105c4d5c577cadbd to your computer and use it in GitHub Desktop.

Revisions

  1. Ajay Rao revised this gist Mar 22, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Installing Nvidia Graphics Driver and Cuda on Ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -25,10 +25,14 @@ $ chmod 755 cuda_8.0.61_375.26_linux-run

    Login to the Virtual Console (not the Terminal) by pressing `Ctrl + Alt + F1` - Enter your `username` and `password`

    #### Disable `lightdm`
    #### Disable `lightdm` and other settings

    ```
    $ sudo /etc/init.d/lightdm stop
    $ sudo init 3
    $ sudo apt-get install build-essential
    $ echo blacklist nouveau option nouveau modeset=0 |sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
    $ sudo update-initramfs -u
    ```

    #### Start the runfile
  2. Ajay Rao created this gist Feb 9, 2017.
    100 changes: 100 additions & 0 deletions Installing Nvidia Graphics Driver and Cuda on Ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,100 @@
    # Installing Nvidia Graphics Driver and Cuda on Ubuntu

    ### Remove any previously installed Nvidia drivers
    ```
    $ sudo apt-get remove --purge nvidia-*
    $ sudo apt-get autoremove
    $ sudo apt-get autoclean
    ```

    **You can choose to install CUDA drivers from `.deb` file or `.run` file**

    ## 1. Installing from `.run` file (Recommended)
    ---

    #### Download **CUDA 8.0 `.run` file (local) for Ubuntu** - [Download Page](https://developer.nvidia.com/cuda-downloads)

    > eg: Run file (local) for Ubuntu 14.04 (~1.4G)
    ```
    $ wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run`
    $ chmod 755 cuda_8.0.61_375.26_linux-run
    ```

    #### Installing the runfile

    Login to the Virtual Console (not the Terminal) by pressing `Ctrl + Alt + F1` - Enter your `username` and `password`

    #### Disable `lightdm`

    ```
    $ sudo /etc/init.d/lightdm stop
    ```

    #### Start the runfile
    ```
    $ sudo ./cuda_8.0.61_375.26_linux-run
    ...
    (Scroll through the Terms and Conditions by Pressing Ctrl+D
    ...
    Do you want to Install Nvidia Integrated Drivers? (yes)
    Do you want to Install OpenGL? (yes)
    **NOTE: If *lightdm* fails to display after login, Restart the whole process by opting (no) for OpenGL**
    ...
    Install X11 config file? (no)
    Install cuda? (yes)
    ```

    #### Remove old X11 config file
    ```
    $ sudo rm /etc/X11/xorg.conf
    ```
    (No need to create new X11 file as during restart, `lightdm` will create a new file with new drivers configuration)

    #### Reboot the system
    ```
    $ sudo reboot
    ```

    After reboot, login to the system and run `nvidia-settings` to ensure the drivers are installed
    ```
    $ nvidia-settings
    ...
    $ nvidia-smi
    ...
    ```

    ## 2. Installing from `.deb` file
    ---

    #### Download **CUDA 8.0 `.deb` file (local) for Ubuntu** - [Download Page](https://developer.nvidia.com/cuda-downloads)

    > eg: Deb file (local) for Ubuntu 14.04 (~1.9G)
    ```
    $ wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64-deb`
    ```

    #### Run the following commands
    ```
    $ sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64-deb
    $ sudo apt-get update
    $ sudo apt-get install cuda
    ```

    #### Reboot the system
    ```
    $ sudo reboot
    ```

    After reboot, login to the system and run `nvidia-settings` to ensure the drivers are installed
    ```
    $ nvidia-settings
    ...
    $ nvidia-smi
    ...
    ```

    **Comment if there any issues**