How can I install CUDA 9 on Ubuntu 17.10











up vote
36
down vote

favorite
26












Ubuntu 17.10 comes with CUDA 8 which relies on clang 3.8
(e.g. see this blogpost).



However, I'd like to install CUDA 9 and rely on GCC if possible. How can I do this?










share|improve this question


























    up vote
    36
    down vote

    favorite
    26












    Ubuntu 17.10 comes with CUDA 8 which relies on clang 3.8
    (e.g. see this blogpost).



    However, I'd like to install CUDA 9 and rely on GCC if possible. How can I do this?










    share|improve this question
























      up vote
      36
      down vote

      favorite
      26









      up vote
      36
      down vote

      favorite
      26






      26





      Ubuntu 17.10 comes with CUDA 8 which relies on clang 3.8
      (e.g. see this blogpost).



      However, I'd like to install CUDA 9 and rely on GCC if possible. How can I do this?










      share|improve this question













      Ubuntu 17.10 comes with CUDA 8 which relies on clang 3.8
      (e.g. see this blogpost).



      However, I'd like to install CUDA 9 and rely on GCC if possible. How can I do this?







      cuda 17.10






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 21 '17 at 19:05









      B0rk4

      7931712




      7931712






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          51
          down vote



          accepted










          Installation of NVIDIA driver 384



          First we install a fresh Ubuntu 17.10 on a computer with an NVIDIA GPU and select "Install third-party software" during the process. Alternatively, we can add the graphics drivers repository manually:



          sudo add-apt-repository ppa:graphics-drivers/ppa
          sudo apt update


          Then we install the most recent NVIDIA driver using apt:



          sudo apt install nvidia-384 nvidia-384-dev


          We verify the installation by running:



          nvidia-smi


          We should see an output which lists the NVIDIA 384 driver and our discrete NVIDIA GPU - similar to summarized table below:



          +-----------------------------------------------------------------------------+
          | NVIDIA-SMI 384.90 Driver Version: 384.90 |
          | |
          |-------------------------------+----------------------+----------------------+
          | 0 Quadro M500M Off | 00000000:06:00.0 Off | N/A |
          | N/A 48C P0 N/A / N/A | 943MiB / 2002MiB | 26% Default |
          +-------------------------------+----------------------+----------------------+


          Preparation for installing of CUDA 9 + SDK



          We install a number of build/dev packages which we require later:



          sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev


          We notice that the default gcc/g++ version on 17.10 is 7.2.0 (Ubuntu 7.2.0-8ubuntu3)
          :



          gcc -v


          CUDA 9 requires gcc 6. Thus, we install it:



          sudo apt install gcc-6
          sudo apt install g++-6


          Note that the default gcc version is still 7.2; can be checked by running gcc -v again.



          Installation of CUDA 9 + SDK



          From the CUDA Toolkit Archive, select one of the "runfile (local)" installation packages to download a version of CUDA 9, such as



          wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


          Make the downloaded file executable and run it using sudo:



          chmod +x cuda_9.0.176_384.81_linux-run 
          sudo ./cuda_9.0.176_384.81_linux-run --override


          We install CUDA with the following configurations:



          You are attempting to install on an unsupported configuration. Do you wish to continue?
          y
          Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
          n
          Install the CUDA 9.0 Toolkit?
          y
          Enter Toolkit Location
          [default location]
          Do you want to install a symbolic link at /usr/local/cuda?
          y
          Install the CUDA 9.0 Samples?
          y
          Enter CUDA Samples Location
          [default location]


          Set up symlinks for gcc/g++:



          sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
          sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++


          Test the CUDA 9 installation using the SDK



          Build your favorite CUDA sample and run it:



          cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/smokeParticles
          make
          ../../bin/x86_64/linux/release/smokeParticles


          You may like to set up gcc/g++ symlinks after the cuda install.






          share|improve this answer



















          • 1




            Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
            – Clark Kent
            Oct 23 '17 at 2:53






          • 4




            I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
            – yauheni_selivonchyk
            Nov 3 '17 at 4:22






          • 11




            the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
            – Luis Lobo Borobia
            Nov 20 '17 at 2:32








          • 1




            Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
            – QtRoS
            Dec 2 '17 at 16:47






          • 1




            Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
            – mahmood
            Mar 17 at 6:09


















          up vote
          5
          down vote













          Getting this installed took more time than I would like to admit, and while the above answer is a good template, I had some additional steps required for my fresh install of Ubuntu 17.10:



          blacklist nouveau



          sudo vim /etc/modprobe.d/blacklist.conf


          Add the following:



          # this one might not be required for x86 32 bit users.
          blacklist amd76x_edac

          blacklist vga16fb
          blacklist nouveau
          blacklist rivafb
          blacklist nvidiafb
          blacklist rivatv


          Update initramfs disk



          sudo update-initramfs -u


          Stop gdm3



          sudo /etc/init.d/gdm3 stop

          sudo init 3


          Get content



          sudo add-apt-repository ppa:graphics-drivers/ppa
          sudo apt update
          sudo apt install nvidia-384 nvidia-384-dev
          sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

          nvidia-smi


          Get the package



          wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


          Run with --override to override compiler choice



          chmod +x cuda_9.0.176_384.81_linux-run 
          sudo ./cuda_9.0.176_384.81_linux-run --override


          After installing the package, I would get errors with nvidia-smi, so I suggest running the command again to verify it works. When I had issues, I would purge nvidia* and re-get it.



          nvidia-smi





          share|improve this answer





















          • Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
            – crypdick
            Jul 3 at 23:06


















          up vote
          0
          down vote













          I followed the accepted answer (@ubashu) and everything went well (if not exactly the same, the instructions would lead to the correct path). I would only had the export to Path (as specified also on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions)



          export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} 
          export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64 ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


          After that you can use nvcc -V to check if the install really went well.






          share|improve this answer








          New contributor




          Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















            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: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            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%2f967332%2fhow-can-i-install-cuda-9-on-ubuntu-17-10%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            51
            down vote



            accepted










            Installation of NVIDIA driver 384



            First we install a fresh Ubuntu 17.10 on a computer with an NVIDIA GPU and select "Install third-party software" during the process. Alternatively, we can add the graphics drivers repository manually:



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update


            Then we install the most recent NVIDIA driver using apt:



            sudo apt install nvidia-384 nvidia-384-dev


            We verify the installation by running:



            nvidia-smi


            We should see an output which lists the NVIDIA 384 driver and our discrete NVIDIA GPU - similar to summarized table below:



            +-----------------------------------------------------------------------------+
            | NVIDIA-SMI 384.90 Driver Version: 384.90 |
            | |
            |-------------------------------+----------------------+----------------------+
            | 0 Quadro M500M Off | 00000000:06:00.0 Off | N/A |
            | N/A 48C P0 N/A / N/A | 943MiB / 2002MiB | 26% Default |
            +-------------------------------+----------------------+----------------------+


            Preparation for installing of CUDA 9 + SDK



            We install a number of build/dev packages which we require later:



            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev


            We notice that the default gcc/g++ version on 17.10 is 7.2.0 (Ubuntu 7.2.0-8ubuntu3)
            :



            gcc -v


            CUDA 9 requires gcc 6. Thus, we install it:



            sudo apt install gcc-6
            sudo apt install g++-6


            Note that the default gcc version is still 7.2; can be checked by running gcc -v again.



            Installation of CUDA 9 + SDK



            From the CUDA Toolkit Archive, select one of the "runfile (local)" installation packages to download a version of CUDA 9, such as



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Make the downloaded file executable and run it using sudo:



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            We install CUDA with the following configurations:



            You are attempting to install on an unsupported configuration. Do you wish to continue?
            y
            Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
            n
            Install the CUDA 9.0 Toolkit?
            y
            Enter Toolkit Location
            [default location]
            Do you want to install a symbolic link at /usr/local/cuda?
            y
            Install the CUDA 9.0 Samples?
            y
            Enter CUDA Samples Location
            [default location]


            Set up symlinks for gcc/g++:



            sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
            sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++


            Test the CUDA 9 installation using the SDK



            Build your favorite CUDA sample and run it:



            cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/smokeParticles
            make
            ../../bin/x86_64/linux/release/smokeParticles


            You may like to set up gcc/g++ symlinks after the cuda install.






            share|improve this answer



















            • 1




              Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
              – Clark Kent
              Oct 23 '17 at 2:53






            • 4




              I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
              – yauheni_selivonchyk
              Nov 3 '17 at 4:22






            • 11




              the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
              – Luis Lobo Borobia
              Nov 20 '17 at 2:32








            • 1




              Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
              – QtRoS
              Dec 2 '17 at 16:47






            • 1




              Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
              – mahmood
              Mar 17 at 6:09















            up vote
            51
            down vote



            accepted










            Installation of NVIDIA driver 384



            First we install a fresh Ubuntu 17.10 on a computer with an NVIDIA GPU and select "Install third-party software" during the process. Alternatively, we can add the graphics drivers repository manually:



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update


            Then we install the most recent NVIDIA driver using apt:



            sudo apt install nvidia-384 nvidia-384-dev


            We verify the installation by running:



            nvidia-smi


            We should see an output which lists the NVIDIA 384 driver and our discrete NVIDIA GPU - similar to summarized table below:



            +-----------------------------------------------------------------------------+
            | NVIDIA-SMI 384.90 Driver Version: 384.90 |
            | |
            |-------------------------------+----------------------+----------------------+
            | 0 Quadro M500M Off | 00000000:06:00.0 Off | N/A |
            | N/A 48C P0 N/A / N/A | 943MiB / 2002MiB | 26% Default |
            +-------------------------------+----------------------+----------------------+


            Preparation for installing of CUDA 9 + SDK



            We install a number of build/dev packages which we require later:



            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev


            We notice that the default gcc/g++ version on 17.10 is 7.2.0 (Ubuntu 7.2.0-8ubuntu3)
            :



            gcc -v


            CUDA 9 requires gcc 6. Thus, we install it:



            sudo apt install gcc-6
            sudo apt install g++-6


            Note that the default gcc version is still 7.2; can be checked by running gcc -v again.



            Installation of CUDA 9 + SDK



            From the CUDA Toolkit Archive, select one of the "runfile (local)" installation packages to download a version of CUDA 9, such as



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Make the downloaded file executable and run it using sudo:



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            We install CUDA with the following configurations:



            You are attempting to install on an unsupported configuration. Do you wish to continue?
            y
            Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
            n
            Install the CUDA 9.0 Toolkit?
            y
            Enter Toolkit Location
            [default location]
            Do you want to install a symbolic link at /usr/local/cuda?
            y
            Install the CUDA 9.0 Samples?
            y
            Enter CUDA Samples Location
            [default location]


            Set up symlinks for gcc/g++:



            sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
            sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++


            Test the CUDA 9 installation using the SDK



            Build your favorite CUDA sample and run it:



            cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/smokeParticles
            make
            ../../bin/x86_64/linux/release/smokeParticles


            You may like to set up gcc/g++ symlinks after the cuda install.






            share|improve this answer



















            • 1




              Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
              – Clark Kent
              Oct 23 '17 at 2:53






            • 4




              I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
              – yauheni_selivonchyk
              Nov 3 '17 at 4:22






            • 11




              the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
              – Luis Lobo Borobia
              Nov 20 '17 at 2:32








            • 1




              Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
              – QtRoS
              Dec 2 '17 at 16:47






            • 1




              Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
              – mahmood
              Mar 17 at 6:09













            up vote
            51
            down vote



            accepted







            up vote
            51
            down vote



            accepted






            Installation of NVIDIA driver 384



            First we install a fresh Ubuntu 17.10 on a computer with an NVIDIA GPU and select "Install third-party software" during the process. Alternatively, we can add the graphics drivers repository manually:



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update


            Then we install the most recent NVIDIA driver using apt:



            sudo apt install nvidia-384 nvidia-384-dev


            We verify the installation by running:



            nvidia-smi


            We should see an output which lists the NVIDIA 384 driver and our discrete NVIDIA GPU - similar to summarized table below:



            +-----------------------------------------------------------------------------+
            | NVIDIA-SMI 384.90 Driver Version: 384.90 |
            | |
            |-------------------------------+----------------------+----------------------+
            | 0 Quadro M500M Off | 00000000:06:00.0 Off | N/A |
            | N/A 48C P0 N/A / N/A | 943MiB / 2002MiB | 26% Default |
            +-------------------------------+----------------------+----------------------+


            Preparation for installing of CUDA 9 + SDK



            We install a number of build/dev packages which we require later:



            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev


            We notice that the default gcc/g++ version on 17.10 is 7.2.0 (Ubuntu 7.2.0-8ubuntu3)
            :



            gcc -v


            CUDA 9 requires gcc 6. Thus, we install it:



            sudo apt install gcc-6
            sudo apt install g++-6


            Note that the default gcc version is still 7.2; can be checked by running gcc -v again.



            Installation of CUDA 9 + SDK



            From the CUDA Toolkit Archive, select one of the "runfile (local)" installation packages to download a version of CUDA 9, such as



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Make the downloaded file executable and run it using sudo:



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            We install CUDA with the following configurations:



            You are attempting to install on an unsupported configuration. Do you wish to continue?
            y
            Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
            n
            Install the CUDA 9.0 Toolkit?
            y
            Enter Toolkit Location
            [default location]
            Do you want to install a symbolic link at /usr/local/cuda?
            y
            Install the CUDA 9.0 Samples?
            y
            Enter CUDA Samples Location
            [default location]


            Set up symlinks for gcc/g++:



            sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
            sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++


            Test the CUDA 9 installation using the SDK



            Build your favorite CUDA sample and run it:



            cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/smokeParticles
            make
            ../../bin/x86_64/linux/release/smokeParticles


            You may like to set up gcc/g++ symlinks after the cuda install.






            share|improve this answer














            Installation of NVIDIA driver 384



            First we install a fresh Ubuntu 17.10 on a computer with an NVIDIA GPU and select "Install third-party software" during the process. Alternatively, we can add the graphics drivers repository manually:



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update


            Then we install the most recent NVIDIA driver using apt:



            sudo apt install nvidia-384 nvidia-384-dev


            We verify the installation by running:



            nvidia-smi


            We should see an output which lists the NVIDIA 384 driver and our discrete NVIDIA GPU - similar to summarized table below:



            +-----------------------------------------------------------------------------+
            | NVIDIA-SMI 384.90 Driver Version: 384.90 |
            | |
            |-------------------------------+----------------------+----------------------+
            | 0 Quadro M500M Off | 00000000:06:00.0 Off | N/A |
            | N/A 48C P0 N/A / N/A | 943MiB / 2002MiB | 26% Default |
            +-------------------------------+----------------------+----------------------+


            Preparation for installing of CUDA 9 + SDK



            We install a number of build/dev packages which we require later:



            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev


            We notice that the default gcc/g++ version on 17.10 is 7.2.0 (Ubuntu 7.2.0-8ubuntu3)
            :



            gcc -v


            CUDA 9 requires gcc 6. Thus, we install it:



            sudo apt install gcc-6
            sudo apt install g++-6


            Note that the default gcc version is still 7.2; can be checked by running gcc -v again.



            Installation of CUDA 9 + SDK



            From the CUDA Toolkit Archive, select one of the "runfile (local)" installation packages to download a version of CUDA 9, such as



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Make the downloaded file executable and run it using sudo:



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            We install CUDA with the following configurations:



            You are attempting to install on an unsupported configuration. Do you wish to continue?
            y
            Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
            n
            Install the CUDA 9.0 Toolkit?
            y
            Enter Toolkit Location
            [default location]
            Do you want to install a symbolic link at /usr/local/cuda?
            y
            Install the CUDA 9.0 Samples?
            y
            Enter CUDA Samples Location
            [default location]


            Set up symlinks for gcc/g++:



            sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
            sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++


            Test the CUDA 9 installation using the SDK



            Build your favorite CUDA sample and run it:



            cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/smokeParticles
            make
            ../../bin/x86_64/linux/release/smokeParticles


            You may like to set up gcc/g++ symlinks after the cuda install.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 14 at 4:13









            ubashu

            2,28221736




            2,28221736










            answered Oct 21 '17 at 19:05









            B0rk4

            7931712




            7931712








            • 1




              Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
              – Clark Kent
              Oct 23 '17 at 2:53






            • 4




              I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
              – yauheni_selivonchyk
              Nov 3 '17 at 4:22






            • 11




              the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
              – Luis Lobo Borobia
              Nov 20 '17 at 2:32








            • 1




              Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
              – QtRoS
              Dec 2 '17 at 16:47






            • 1




              Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
              – mahmood
              Mar 17 at 6:09














            • 1




              Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
              – Clark Kent
              Oct 23 '17 at 2:53






            • 4




              I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
              – yauheni_selivonchyk
              Nov 3 '17 at 4:22






            • 11




              the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
              – Luis Lobo Borobia
              Nov 20 '17 at 2:32








            • 1




              Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
              – QtRoS
              Dec 2 '17 at 16:47






            • 1




              Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
              – mahmood
              Mar 17 at 6:09








            1




            1




            Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
            – Clark Kent
            Oct 23 '17 at 2:53




            Been stuck on this issue for a bit. Running 17.10, trying to install CUDA 9. I'm having an issue on step 2: nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ran lspci | grep -i nvidia says I have a GeForce GTX 760. mokutil --sb-state shows SecureBoot disabled. Ran sudo apt-get purge nvidia*, ran your install command for 384, and ran dpkg -S nvidia-smi nvidia-384: /usr/lib/nvidia-384/bin/nvidia-smi. Any suggestions?
            – Clark Kent
            Oct 23 '17 at 2:53




            4




            4




            I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
            – yauheni_selivonchyk
            Nov 3 '17 at 4:22




            I had to do either sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-9.0/bin/gcc sudo ln -s /usr/bin/g++-6 /usr/local/cuda-9.0/bin/g++ or sudo ./cuda_9.0.176_384.81_linux-run --override as author below recommends to install successfully without compiler conflict
            – yauheni_selivonchyk
            Nov 3 '17 at 4:22




            11




            11




            the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
            – Luis Lobo Borobia
            Nov 20 '17 at 2:32






            the two commands to add the symbolic links for the gcc 6 compilers have to be done after installing cuda, because /usr/local/cuda does not exist before installing
            – Luis Lobo Borobia
            Nov 20 '17 at 2:32






            1




            1




            Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
            – QtRoS
            Dec 2 '17 at 16:47




            Helper a lot! The only thing I did in another way - created symlinks after cuda installation at the very end.
            – QtRoS
            Dec 2 '17 at 16:47




            1




            1




            Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
            – mahmood
            Mar 17 at 6:09




            Prior to running cuda_9.0.176_384.81_linux.run, how did you create the soft links (ln -s)? Did you manually create the cuda folder?
            – mahmood
            Mar 17 at 6:09












            up vote
            5
            down vote













            Getting this installed took more time than I would like to admit, and while the above answer is a good template, I had some additional steps required for my fresh install of Ubuntu 17.10:



            blacklist nouveau



            sudo vim /etc/modprobe.d/blacklist.conf


            Add the following:



            # this one might not be required for x86 32 bit users.
            blacklist amd76x_edac

            blacklist vga16fb
            blacklist nouveau
            blacklist rivafb
            blacklist nvidiafb
            blacklist rivatv


            Update initramfs disk



            sudo update-initramfs -u


            Stop gdm3



            sudo /etc/init.d/gdm3 stop

            sudo init 3


            Get content



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update
            sudo apt install nvidia-384 nvidia-384-dev
            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

            nvidia-smi


            Get the package



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Run with --override to override compiler choice



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            After installing the package, I would get errors with nvidia-smi, so I suggest running the command again to verify it works. When I had issues, I would purge nvidia* and re-get it.



            nvidia-smi





            share|improve this answer





















            • Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
              – crypdick
              Jul 3 at 23:06















            up vote
            5
            down vote













            Getting this installed took more time than I would like to admit, and while the above answer is a good template, I had some additional steps required for my fresh install of Ubuntu 17.10:



            blacklist nouveau



            sudo vim /etc/modprobe.d/blacklist.conf


            Add the following:



            # this one might not be required for x86 32 bit users.
            blacklist amd76x_edac

            blacklist vga16fb
            blacklist nouveau
            blacklist rivafb
            blacklist nvidiafb
            blacklist rivatv


            Update initramfs disk



            sudo update-initramfs -u


            Stop gdm3



            sudo /etc/init.d/gdm3 stop

            sudo init 3


            Get content



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update
            sudo apt install nvidia-384 nvidia-384-dev
            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

            nvidia-smi


            Get the package



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Run with --override to override compiler choice



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            After installing the package, I would get errors with nvidia-smi, so I suggest running the command again to verify it works. When I had issues, I would purge nvidia* and re-get it.



            nvidia-smi





            share|improve this answer





















            • Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
              – crypdick
              Jul 3 at 23:06













            up vote
            5
            down vote










            up vote
            5
            down vote









            Getting this installed took more time than I would like to admit, and while the above answer is a good template, I had some additional steps required for my fresh install of Ubuntu 17.10:



            blacklist nouveau



            sudo vim /etc/modprobe.d/blacklist.conf


            Add the following:



            # this one might not be required for x86 32 bit users.
            blacklist amd76x_edac

            blacklist vga16fb
            blacklist nouveau
            blacklist rivafb
            blacklist nvidiafb
            blacklist rivatv


            Update initramfs disk



            sudo update-initramfs -u


            Stop gdm3



            sudo /etc/init.d/gdm3 stop

            sudo init 3


            Get content



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update
            sudo apt install nvidia-384 nvidia-384-dev
            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

            nvidia-smi


            Get the package



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Run with --override to override compiler choice



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            After installing the package, I would get errors with nvidia-smi, so I suggest running the command again to verify it works. When I had issues, I would purge nvidia* and re-get it.



            nvidia-smi





            share|improve this answer












            Getting this installed took more time than I would like to admit, and while the above answer is a good template, I had some additional steps required for my fresh install of Ubuntu 17.10:



            blacklist nouveau



            sudo vim /etc/modprobe.d/blacklist.conf


            Add the following:



            # this one might not be required for x86 32 bit users.
            blacklist amd76x_edac

            blacklist vga16fb
            blacklist nouveau
            blacklist rivafb
            blacklist nvidiafb
            blacklist rivatv


            Update initramfs disk



            sudo update-initramfs -u


            Stop gdm3



            sudo /etc/init.d/gdm3 stop

            sudo init 3


            Get content



            sudo add-apt-repository ppa:graphics-drivers/ppa
            sudo apt update
            sudo apt install nvidia-384 nvidia-384-dev
            sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

            nvidia-smi


            Get the package



            wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run


            Run with --override to override compiler choice



            chmod +x cuda_9.0.176_384.81_linux-run 
            sudo ./cuda_9.0.176_384.81_linux-run --override


            After installing the package, I would get errors with nvidia-smi, so I suggest running the command again to verify it works. When I had issues, I would purge nvidia* and re-get it.



            nvidia-smi






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 24 '17 at 12:24









            Clark Kent

            1513




            1513












            • Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
              – crypdick
              Jul 3 at 23:06


















            • Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
              – crypdick
              Jul 3 at 23:06
















            Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
            – crypdick
            Jul 3 at 23:06




            Some people may need to stop lightdm instead of gdm3, see askubuntu.com/a/65867/422690
            – crypdick
            Jul 3 at 23:06










            up vote
            0
            down vote













            I followed the accepted answer (@ubashu) and everything went well (if not exactly the same, the instructions would lead to the correct path). I would only had the export to Path (as specified also on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions)



            export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} 
            export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64 ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


            After that you can use nvcc -V to check if the install really went well.






            share|improve this answer








            New contributor




            Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






















              up vote
              0
              down vote













              I followed the accepted answer (@ubashu) and everything went well (if not exactly the same, the instructions would lead to the correct path). I would only had the export to Path (as specified also on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions)



              export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} 
              export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64 ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


              After that you can use nvcc -V to check if the install really went well.






              share|improve this answer








              New contributor




              Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.




















                up vote
                0
                down vote










                up vote
                0
                down vote









                I followed the accepted answer (@ubashu) and everything went well (if not exactly the same, the instructions would lead to the correct path). I would only had the export to Path (as specified also on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions)



                export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} 
                export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64 ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


                After that you can use nvcc -V to check if the install really went well.






                share|improve this answer








                New contributor




                Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                I followed the accepted answer (@ubashu) and everything went well (if not exactly the same, the instructions would lead to the correct path). I would only had the export to Path (as specified also on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions)



                export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} 
                export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64 ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


                After that you can use nvcc -V to check if the install really went well.







                share|improve this answer








                New contributor




                Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered Nov 16 at 22:51









                Pedro Esmeriz

                1




                1




                New contributor




                Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Pedro Esmeriz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f967332%2fhow-can-i-install-cuda-9-on-ubuntu-17-10%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    數位音樂下載

                    When can things happen in Etherscan, such as the picture below?

                    格利澤436b