How do I install NVIDIA and CUDA drivers into Ubuntu?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I have a system with a NVIDIA card that has a compute support of 3.0+ compared on https://developer.nvidia.com/cuda-gpus. How do I install CUDA and the NVIDIA drivers in Ubuntu without downloading the .deb files from NVIDIA?










share|improve this question

























    up vote
    2
    down vote

    favorite












    I have a system with a NVIDIA card that has a compute support of 3.0+ compared on https://developer.nvidia.com/cuda-gpus. How do I install CUDA and the NVIDIA drivers in Ubuntu without downloading the .deb files from NVIDIA?










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I have a system with a NVIDIA card that has a compute support of 3.0+ compared on https://developer.nvidia.com/cuda-gpus. How do I install CUDA and the NVIDIA drivers in Ubuntu without downloading the .deb files from NVIDIA?










      share|improve this question













      I have a system with a NVIDIA card that has a compute support of 3.0+ compared on https://developer.nvidia.com/cuda-gpus. How do I install CUDA and the NVIDIA drivers in Ubuntu without downloading the .deb files from NVIDIA?







      nvidia cuda






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      Terrance

      17.4k23885




      17.4k23885




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          Ubuntu 18.04, CUDA 10.0 and NVIDIA 410 drivers:



          NOTE: CUDA 9.x is not available through NVIDIA's ubuntu1804 repo.



          These instructions are for installing CUDA through the repository instead of the .deb installation.



          The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



          Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



          sudo rm /etc/apt/sources.list.d/cuda*
          sudo apt remove nvidia-cuda-toolkit


          Recommended to also remove all NVIDIA drivers before installing new drivers:



          sudo apt remove nvidia-*


          Then update the system:



          sudo apt update


          Install the key:



          sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub


          Add the repo:



          sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


          Update the system again:



          sudo apt update


          Install CUDA 10.0.



          sudo apt install cuda-10-0


          It should be installing the nvidia-410 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/



          Add the following lines to your ~/.profile file for CUDA 10.0



          # set PATH for cuda 10.0 installation
          if [ -d "/usr/local/cuda-10.0/bin/" ]; then
          export PATH=/usr/local/cuda-10.0/bin$PATH:+:$PATH
          export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
          fi


          Reboot the computer and check your settings when reboot is complete:



          Check NVIDIA Cuda Compiler with nvcc --version:



          terrance@terrance-ubuntu:~$ nvcc --version
          nvcc: NVIDIA (R) Cuda compiler driver
          Copyright (c) 2005-2018 NVIDIA Corporation
          Built on Sat_Aug_25_21:08:01_CDT_2018
          Cuda compilation tools, release 10.0, V10.0.130


          Check NVIDIA driver with nvidia-smi:



          terrance@terrance-ubuntu:~$ nvidia-smi
          Thu Sep 20 10:31:17 2018
          +-----------------------------------------------------------------------------+
          | NVIDIA-SMI 410.48 Driver Version: 410.48 |
          |-------------------------------+----------------------+----------------------+
          | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
          | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
          |===============================+======================+======================|
          | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
          | 43% 34C P8 N/A / N/A | 119MiB / 1998MiB | N/A Default |
          +-------------------------------+----------------------+----------------------+

          +-----------------------------------------------------------------------------+
          | Processes: GPU Memory |
          | GPU PID Type Process name Usage |
          |=============================================================================|
          | 0 Not Supported |
          +-----------------------------------------------------------------------------+





          share|improve this answer





























            up vote
            1
            down vote













            Ubuntu 16.04, CUDA 9.2 and NVIDIA 396 drivers:



            These instructions are for installing CUDA through the repository instead of the .deb installation.



            The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



            Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



            sudo rm /etc/apt/sources.list.d/cuda*
            sudo apt remove nvidia-cuda-toolkit


            Recommended to also remove all NVIDIA drivers before installing new drivers:



            sudo apt remove nvidia-*


            Then update the system:



            sudo apt update


            Install the key:



            sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub


            Add the repo:



            sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


            Install CUDA 9.2:



            sudo apt install cuda-9-2


            It should be installing the nvidia-396 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/



            Verify that CUDA 9.2 was installed:



            ~$ ls /usr/local/cuda-9.2/
            bin include libnvvp nvml samples targets
            doc lib64 LICENSE nvvm share tools
            extras libnsight nsightee_plugins README src version.txt


            Now, add the following to your ~/.profile for the PATH and LD_LIBRARY. You can use the command gedit ~/.profile for editing:



            # set PATH for cuda 9.2 installation
            if [ -d "/usr/local/cuda-9.2/bin/" ]; then
            export PATH=/usr/local/cuda-9.2/bin$PATH:+:$PATH
            export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
            fi


            Reboot your system.



            sudo reboot


            Once the system is up, you can verify the installation by typing in the following:



            nvcc -V


            You should see something similar the following:



            ~$ nvcc -V
            nvcc: NVIDIA (R) Cuda compiler driver
            Copyright (c) 2005-2017 NVIDIA Corporation
            Built on Fri_Nov__3_21:07:56_CDT_2017
            Cuda compilation tools, release 9.1, V9.1.85


            And you should see the 396.xx drivers installed:



            ~$ nvidia-smi
            Thu May 17 07:38:54 2018
            +-----------------------------------------------------------------------------+
            | NVIDIA-SMI 396.44 Driver Version: 396.44 |
            |-------------------------------+----------------------+----------------------+
            | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
            | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
            |===============================+======================+======================|
            | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
            | 49% 53C P0 N/A / N/A | 187MiB / 1999MiB | N/A Default |
            +-------------------------------+----------------------+----------------------+

            +-----------------------------------------------------------------------------+
            | Processes: GPU Memory |
            | GPU PID Type Process name Usage |
            |=============================================================================|
            | 0 Not Supported |
            +-----------------------------------------------------------------------------+







            share|improve this answer






















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "89"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1077061%2fhow-do-i-install-nvidia-and-cuda-drivers-into-ubuntu%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              Ubuntu 18.04, CUDA 10.0 and NVIDIA 410 drivers:



              NOTE: CUDA 9.x is not available through NVIDIA's ubuntu1804 repo.



              These instructions are for installing CUDA through the repository instead of the .deb installation.



              The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



              Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



              sudo rm /etc/apt/sources.list.d/cuda*
              sudo apt remove nvidia-cuda-toolkit


              Recommended to also remove all NVIDIA drivers before installing new drivers:



              sudo apt remove nvidia-*


              Then update the system:



              sudo apt update


              Install the key:



              sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub


              Add the repo:



              sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


              Update the system again:



              sudo apt update


              Install CUDA 10.0.



              sudo apt install cuda-10-0


              It should be installing the nvidia-410 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/



              Add the following lines to your ~/.profile file for CUDA 10.0



              # set PATH for cuda 10.0 installation
              if [ -d "/usr/local/cuda-10.0/bin/" ]; then
              export PATH=/usr/local/cuda-10.0/bin$PATH:+:$PATH
              export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
              fi


              Reboot the computer and check your settings when reboot is complete:



              Check NVIDIA Cuda Compiler with nvcc --version:



              terrance@terrance-ubuntu:~$ nvcc --version
              nvcc: NVIDIA (R) Cuda compiler driver
              Copyright (c) 2005-2018 NVIDIA Corporation
              Built on Sat_Aug_25_21:08:01_CDT_2018
              Cuda compilation tools, release 10.0, V10.0.130


              Check NVIDIA driver with nvidia-smi:



              terrance@terrance-ubuntu:~$ nvidia-smi
              Thu Sep 20 10:31:17 2018
              +-----------------------------------------------------------------------------+
              | NVIDIA-SMI 410.48 Driver Version: 410.48 |
              |-------------------------------+----------------------+----------------------+
              | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
              | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
              |===============================+======================+======================|
              | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
              | 43% 34C P8 N/A / N/A | 119MiB / 1998MiB | N/A Default |
              +-------------------------------+----------------------+----------------------+

              +-----------------------------------------------------------------------------+
              | Processes: GPU Memory |
              | GPU PID Type Process name Usage |
              |=============================================================================|
              | 0 Not Supported |
              +-----------------------------------------------------------------------------+





              share|improve this answer


























                up vote
                2
                down vote













                Ubuntu 18.04, CUDA 10.0 and NVIDIA 410 drivers:



                NOTE: CUDA 9.x is not available through NVIDIA's ubuntu1804 repo.



                These instructions are for installing CUDA through the repository instead of the .deb installation.



                The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                sudo rm /etc/apt/sources.list.d/cuda*
                sudo apt remove nvidia-cuda-toolkit


                Recommended to also remove all NVIDIA drivers before installing new drivers:



                sudo apt remove nvidia-*


                Then update the system:



                sudo apt update


                Install the key:



                sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub


                Add the repo:



                sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                Update the system again:



                sudo apt update


                Install CUDA 10.0.



                sudo apt install cuda-10-0


                It should be installing the nvidia-410 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/



                Add the following lines to your ~/.profile file for CUDA 10.0



                # set PATH for cuda 10.0 installation
                if [ -d "/usr/local/cuda-10.0/bin/" ]; then
                export PATH=/usr/local/cuda-10.0/bin$PATH:+:$PATH
                export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                fi


                Reboot the computer and check your settings when reboot is complete:



                Check NVIDIA Cuda Compiler with nvcc --version:



                terrance@terrance-ubuntu:~$ nvcc --version
                nvcc: NVIDIA (R) Cuda compiler driver
                Copyright (c) 2005-2018 NVIDIA Corporation
                Built on Sat_Aug_25_21:08:01_CDT_2018
                Cuda compilation tools, release 10.0, V10.0.130


                Check NVIDIA driver with nvidia-smi:



                terrance@terrance-ubuntu:~$ nvidia-smi
                Thu Sep 20 10:31:17 2018
                +-----------------------------------------------------------------------------+
                | NVIDIA-SMI 410.48 Driver Version: 410.48 |
                |-------------------------------+----------------------+----------------------+
                | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                |===============================+======================+======================|
                | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                | 43% 34C P8 N/A / N/A | 119MiB / 1998MiB | N/A Default |
                +-------------------------------+----------------------+----------------------+

                +-----------------------------------------------------------------------------+
                | Processes: GPU Memory |
                | GPU PID Type Process name Usage |
                |=============================================================================|
                | 0 Not Supported |
                +-----------------------------------------------------------------------------+





                share|improve this answer
























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  Ubuntu 18.04, CUDA 10.0 and NVIDIA 410 drivers:



                  NOTE: CUDA 9.x is not available through NVIDIA's ubuntu1804 repo.



                  These instructions are for installing CUDA through the repository instead of the .deb installation.



                  The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                  Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                  sudo rm /etc/apt/sources.list.d/cuda*
                  sudo apt remove nvidia-cuda-toolkit


                  Recommended to also remove all NVIDIA drivers before installing new drivers:



                  sudo apt remove nvidia-*


                  Then update the system:



                  sudo apt update


                  Install the key:



                  sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub


                  Add the repo:



                  sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                  Update the system again:



                  sudo apt update


                  Install CUDA 10.0.



                  sudo apt install cuda-10-0


                  It should be installing the nvidia-410 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/



                  Add the following lines to your ~/.profile file for CUDA 10.0



                  # set PATH for cuda 10.0 installation
                  if [ -d "/usr/local/cuda-10.0/bin/" ]; then
                  export PATH=/usr/local/cuda-10.0/bin$PATH:+:$PATH
                  export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                  fi


                  Reboot the computer and check your settings when reboot is complete:



                  Check NVIDIA Cuda Compiler with nvcc --version:



                  terrance@terrance-ubuntu:~$ nvcc --version
                  nvcc: NVIDIA (R) Cuda compiler driver
                  Copyright (c) 2005-2018 NVIDIA Corporation
                  Built on Sat_Aug_25_21:08:01_CDT_2018
                  Cuda compilation tools, release 10.0, V10.0.130


                  Check NVIDIA driver with nvidia-smi:



                  terrance@terrance-ubuntu:~$ nvidia-smi
                  Thu Sep 20 10:31:17 2018
                  +-----------------------------------------------------------------------------+
                  | NVIDIA-SMI 410.48 Driver Version: 410.48 |
                  |-------------------------------+----------------------+----------------------+
                  | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                  | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                  |===============================+======================+======================|
                  | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                  | 43% 34C P8 N/A / N/A | 119MiB / 1998MiB | N/A Default |
                  +-------------------------------+----------------------+----------------------+

                  +-----------------------------------------------------------------------------+
                  | Processes: GPU Memory |
                  | GPU PID Type Process name Usage |
                  |=============================================================================|
                  | 0 Not Supported |
                  +-----------------------------------------------------------------------------+





                  share|improve this answer














                  Ubuntu 18.04, CUDA 10.0 and NVIDIA 410 drivers:



                  NOTE: CUDA 9.x is not available through NVIDIA's ubuntu1804 repo.



                  These instructions are for installing CUDA through the repository instead of the .deb installation.



                  The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                  Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                  sudo rm /etc/apt/sources.list.d/cuda*
                  sudo apt remove nvidia-cuda-toolkit


                  Recommended to also remove all NVIDIA drivers before installing new drivers:



                  sudo apt remove nvidia-*


                  Then update the system:



                  sudo apt update


                  Install the key:



                  sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub


                  Add the repo:



                  sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                  Update the system again:



                  sudo apt update


                  Install CUDA 10.0.



                  sudo apt install cuda-10-0


                  It should be installing the nvidia-410 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/



                  Add the following lines to your ~/.profile file for CUDA 10.0



                  # set PATH for cuda 10.0 installation
                  if [ -d "/usr/local/cuda-10.0/bin/" ]; then
                  export PATH=/usr/local/cuda-10.0/bin$PATH:+:$PATH
                  export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                  fi


                  Reboot the computer and check your settings when reboot is complete:



                  Check NVIDIA Cuda Compiler with nvcc --version:



                  terrance@terrance-ubuntu:~$ nvcc --version
                  nvcc: NVIDIA (R) Cuda compiler driver
                  Copyright (c) 2005-2018 NVIDIA Corporation
                  Built on Sat_Aug_25_21:08:01_CDT_2018
                  Cuda compilation tools, release 10.0, V10.0.130


                  Check NVIDIA driver with nvidia-smi:



                  terrance@terrance-ubuntu:~$ nvidia-smi
                  Thu Sep 20 10:31:17 2018
                  +-----------------------------------------------------------------------------+
                  | NVIDIA-SMI 410.48 Driver Version: 410.48 |
                  |-------------------------------+----------------------+----------------------+
                  | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                  | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                  |===============================+======================+======================|
                  | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                  | 43% 34C P8 N/A / N/A | 119MiB / 1998MiB | N/A Default |
                  +-------------------------------+----------------------+----------------------+

                  +-----------------------------------------------------------------------------+
                  | Processes: GPU Memory |
                  | GPU PID Type Process name Usage |
                  |=============================================================================|
                  | 0 Not Supported |
                  +-----------------------------------------------------------------------------+






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 3 hours ago

























                  answered 3 hours ago









                  Terrance

                  17.4k23885




                  17.4k23885






















                      up vote
                      1
                      down vote













                      Ubuntu 16.04, CUDA 9.2 and NVIDIA 396 drivers:



                      These instructions are for installing CUDA through the repository instead of the .deb installation.



                      The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                      Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                      sudo rm /etc/apt/sources.list.d/cuda*
                      sudo apt remove nvidia-cuda-toolkit


                      Recommended to also remove all NVIDIA drivers before installing new drivers:



                      sudo apt remove nvidia-*


                      Then update the system:



                      sudo apt update


                      Install the key:



                      sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub


                      Add the repo:



                      sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                      Install CUDA 9.2:



                      sudo apt install cuda-9-2


                      It should be installing the nvidia-396 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/



                      Verify that CUDA 9.2 was installed:



                      ~$ ls /usr/local/cuda-9.2/
                      bin include libnvvp nvml samples targets
                      doc lib64 LICENSE nvvm share tools
                      extras libnsight nsightee_plugins README src version.txt


                      Now, add the following to your ~/.profile for the PATH and LD_LIBRARY. You can use the command gedit ~/.profile for editing:



                      # set PATH for cuda 9.2 installation
                      if [ -d "/usr/local/cuda-9.2/bin/" ]; then
                      export PATH=/usr/local/cuda-9.2/bin$PATH:+:$PATH
                      export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                      fi


                      Reboot your system.



                      sudo reboot


                      Once the system is up, you can verify the installation by typing in the following:



                      nvcc -V


                      You should see something similar the following:



                      ~$ nvcc -V
                      nvcc: NVIDIA (R) Cuda compiler driver
                      Copyright (c) 2005-2017 NVIDIA Corporation
                      Built on Fri_Nov__3_21:07:56_CDT_2017
                      Cuda compilation tools, release 9.1, V9.1.85


                      And you should see the 396.xx drivers installed:



                      ~$ nvidia-smi
                      Thu May 17 07:38:54 2018
                      +-----------------------------------------------------------------------------+
                      | NVIDIA-SMI 396.44 Driver Version: 396.44 |
                      |-------------------------------+----------------------+----------------------+
                      | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                      | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                      |===============================+======================+======================|
                      | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                      | 49% 53C P0 N/A / N/A | 187MiB / 1999MiB | N/A Default |
                      +-------------------------------+----------------------+----------------------+

                      +-----------------------------------------------------------------------------+
                      | Processes: GPU Memory |
                      | GPU PID Type Process name Usage |
                      |=============================================================================|
                      | 0 Not Supported |
                      +-----------------------------------------------------------------------------+







                      share|improve this answer


























                        up vote
                        1
                        down vote













                        Ubuntu 16.04, CUDA 9.2 and NVIDIA 396 drivers:



                        These instructions are for installing CUDA through the repository instead of the .deb installation.



                        The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                        Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                        sudo rm /etc/apt/sources.list.d/cuda*
                        sudo apt remove nvidia-cuda-toolkit


                        Recommended to also remove all NVIDIA drivers before installing new drivers:



                        sudo apt remove nvidia-*


                        Then update the system:



                        sudo apt update


                        Install the key:



                        sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub


                        Add the repo:



                        sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                        Install CUDA 9.2:



                        sudo apt install cuda-9-2


                        It should be installing the nvidia-396 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/



                        Verify that CUDA 9.2 was installed:



                        ~$ ls /usr/local/cuda-9.2/
                        bin include libnvvp nvml samples targets
                        doc lib64 LICENSE nvvm share tools
                        extras libnsight nsightee_plugins README src version.txt


                        Now, add the following to your ~/.profile for the PATH and LD_LIBRARY. You can use the command gedit ~/.profile for editing:



                        # set PATH for cuda 9.2 installation
                        if [ -d "/usr/local/cuda-9.2/bin/" ]; then
                        export PATH=/usr/local/cuda-9.2/bin$PATH:+:$PATH
                        export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                        fi


                        Reboot your system.



                        sudo reboot


                        Once the system is up, you can verify the installation by typing in the following:



                        nvcc -V


                        You should see something similar the following:



                        ~$ nvcc -V
                        nvcc: NVIDIA (R) Cuda compiler driver
                        Copyright (c) 2005-2017 NVIDIA Corporation
                        Built on Fri_Nov__3_21:07:56_CDT_2017
                        Cuda compilation tools, release 9.1, V9.1.85


                        And you should see the 396.xx drivers installed:



                        ~$ nvidia-smi
                        Thu May 17 07:38:54 2018
                        +-----------------------------------------------------------------------------+
                        | NVIDIA-SMI 396.44 Driver Version: 396.44 |
                        |-------------------------------+----------------------+----------------------+
                        | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                        | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                        |===============================+======================+======================|
                        | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                        | 49% 53C P0 N/A / N/A | 187MiB / 1999MiB | N/A Default |
                        +-------------------------------+----------------------+----------------------+

                        +-----------------------------------------------------------------------------+
                        | Processes: GPU Memory |
                        | GPU PID Type Process name Usage |
                        |=============================================================================|
                        | 0 Not Supported |
                        +-----------------------------------------------------------------------------+







                        share|improve this answer
























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          Ubuntu 16.04, CUDA 9.2 and NVIDIA 396 drivers:



                          These instructions are for installing CUDA through the repository instead of the .deb installation.



                          The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                          Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                          sudo rm /etc/apt/sources.list.d/cuda*
                          sudo apt remove nvidia-cuda-toolkit


                          Recommended to also remove all NVIDIA drivers before installing new drivers:



                          sudo apt remove nvidia-*


                          Then update the system:



                          sudo apt update


                          Install the key:



                          sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub


                          Add the repo:



                          sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                          Install CUDA 9.2:



                          sudo apt install cuda-9-2


                          It should be installing the nvidia-396 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/



                          Verify that CUDA 9.2 was installed:



                          ~$ ls /usr/local/cuda-9.2/
                          bin include libnvvp nvml samples targets
                          doc lib64 LICENSE nvvm share tools
                          extras libnsight nsightee_plugins README src version.txt


                          Now, add the following to your ~/.profile for the PATH and LD_LIBRARY. You can use the command gedit ~/.profile for editing:



                          # set PATH for cuda 9.2 installation
                          if [ -d "/usr/local/cuda-9.2/bin/" ]; then
                          export PATH=/usr/local/cuda-9.2/bin$PATH:+:$PATH
                          export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                          fi


                          Reboot your system.



                          sudo reboot


                          Once the system is up, you can verify the installation by typing in the following:



                          nvcc -V


                          You should see something similar the following:



                          ~$ nvcc -V
                          nvcc: NVIDIA (R) Cuda compiler driver
                          Copyright (c) 2005-2017 NVIDIA Corporation
                          Built on Fri_Nov__3_21:07:56_CDT_2017
                          Cuda compilation tools, release 9.1, V9.1.85


                          And you should see the 396.xx drivers installed:



                          ~$ nvidia-smi
                          Thu May 17 07:38:54 2018
                          +-----------------------------------------------------------------------------+
                          | NVIDIA-SMI 396.44 Driver Version: 396.44 |
                          |-------------------------------+----------------------+----------------------+
                          | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                          | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                          |===============================+======================+======================|
                          | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                          | 49% 53C P0 N/A / N/A | 187MiB / 1999MiB | N/A Default |
                          +-------------------------------+----------------------+----------------------+

                          +-----------------------------------------------------------------------------+
                          | Processes: GPU Memory |
                          | GPU PID Type Process name Usage |
                          |=============================================================================|
                          | 0 Not Supported |
                          +-----------------------------------------------------------------------------+







                          share|improve this answer














                          Ubuntu 16.04, CUDA 9.2 and NVIDIA 396 drivers:



                          These instructions are for installing CUDA through the repository instead of the .deb installation.



                          The following lines you can copy and paste to a terminal window. Press Ctrl+Alt+T to open a terminal window.



                          Remove any CUDA PPAs that may be setup and also remove the nvidia-cuda-toolkit if installed:



                          sudo rm /etc/apt/sources.list.d/cuda*
                          sudo apt remove nvidia-cuda-toolkit


                          Recommended to also remove all NVIDIA drivers before installing new drivers:



                          sudo apt remove nvidia-*


                          Then update the system:



                          sudo apt update


                          Install the key:



                          sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub


                          Add the repo:



                          sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'


                          Install CUDA 9.2:



                          sudo apt install cuda-9-2


                          It should be installing the nvidia-396 drivers with it as those are what are listed in the repo. See: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/



                          Verify that CUDA 9.2 was installed:



                          ~$ ls /usr/local/cuda-9.2/
                          bin include libnvvp nvml samples targets
                          doc lib64 LICENSE nvvm share tools
                          extras libnsight nsightee_plugins README src version.txt


                          Now, add the following to your ~/.profile for the PATH and LD_LIBRARY. You can use the command gedit ~/.profile for editing:



                          # set PATH for cuda 9.2 installation
                          if [ -d "/usr/local/cuda-9.2/bin/" ]; then
                          export PATH=/usr/local/cuda-9.2/bin$PATH:+:$PATH
                          export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH
                          fi


                          Reboot your system.



                          sudo reboot


                          Once the system is up, you can verify the installation by typing in the following:



                          nvcc -V


                          You should see something similar the following:



                          ~$ nvcc -V
                          nvcc: NVIDIA (R) Cuda compiler driver
                          Copyright (c) 2005-2017 NVIDIA Corporation
                          Built on Fri_Nov__3_21:07:56_CDT_2017
                          Cuda compilation tools, release 9.1, V9.1.85


                          And you should see the 396.xx drivers installed:



                          ~$ nvidia-smi
                          Thu May 17 07:38:54 2018
                          +-----------------------------------------------------------------------------+
                          | NVIDIA-SMI 396.44 Driver Version: 396.44 |
                          |-------------------------------+----------------------+----------------------+
                          | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
                          | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
                          |===============================+======================+======================|
                          | 0 GeForce GTX 760 Off | 00000000:02:00.0 N/A | N/A |
                          | 49% 53C P0 N/A / N/A | 187MiB / 1999MiB | N/A Default |
                          +-------------------------------+----------------------+----------------------+

                          +-----------------------------------------------------------------------------+
                          | Processes: GPU Memory |
                          | GPU PID Type Process name Usage |
                          |=============================================================================|
                          | 0 Not Supported |
                          +-----------------------------------------------------------------------------+








                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 3 hours ago

























                          answered 3 hours ago









                          Terrance

                          17.4k23885




                          17.4k23885



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1077061%2fhow-do-i-install-nvidia-and-cuda-drivers-into-ubuntu%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                              Confectionery