A record for installing NVIDIA driver on Ubuntu 18.04

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/csdnicewing/article/details/80923819

        There's something wrong with my system that I can only type English right now. In order not to forget what I've suffered, I use English this time.

          In order to install tensorflow with GPU, fist I've got to install NVIDIA driver for my GTX1050. I used Kylin before, but this operation system was not mature and caused me great trouble. So I decide to turn to the original ubuntu18.04.

         Follow "https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux", I promote my solution here.

          First, NVIDIA driver is a third-party driver for Ubuntu. So in order to install correctly, we have to disable the secure boot first. The concrete steps of this can be googled online.

           Second, use

sudo ubuntu-drivers autoinstall

           If you don't have the tool, just download one. If you find your processing is stuck, don't worry. It's a bug, asking for a password but failing to display. Just type your password for 3 or 4 times, and the procedure will go on. Thanks to https://devtalk.nvidia.com/default/topic/1036167/stuck-trying-to-intall-nvidia-390-ubuntu-18-04-lts-/

           But unluckily, I typed the wrong password, and the terminal was locked. I forced to shut the terminal and restart the installation,  but found the dpkg was locked. Don't worry. Follow the steps.  Thanks for https://www.reddit.com/r/Ubuntu/comments/8r3zov/stuck_at_building_initial_module/

          First, download the modules according to your system manually using google . For example, I need to download  linux-modules-4.15.0-23-generic_4.15.0-23.25_amd64.deb. And then use dpkg to install. Lucily, this is not locked. Then everything went on well.

           Then, I realized that there's  another tool. It's a Ubuntu plugin and originally exists in the system called "software and update". There's one option just help me to install a third party driver. So I purged the existence file of NVIDIA  using

"sudo apt-get purge nvidia*)

          But don't auto-remove. We need the required files. Then use the system tool. When asking for a secure boot and enrolling a new Machine-Owner Key, just choose No. Then reboot the computer.

            Open one terminal. Use the order "nvidia-smi" to check.

           Everything is done! Thank God!


猜你喜欢

转载自blog.csdn.net/csdnicewing/article/details/80923819