How to install CUDA in Ubuntu.

TensorFlow is an open-source software library for dataflow programming across a range of tasks. It is a symbolic math library, and also used for machine learning applications such as neural networks.
Now we see a general way to install CUDA drivers from Nvidia on Ubuntu. Kindly note that the tutorial somehow remains the same for other Linux based Distro’s as well.

To install the Nvidia driver you can do the following:

In Ubuntu somehow hunt for “Additional Drivers” (You might also do System Settings->Software and Updates->Additional Drivers)

In the menu that appears select one of the Nvidia Drivers and click “Apply Changes”.(This step uses the internet)

Reboot your system.

Open a terminal window and type nvidia-smi. If your driver has been installed correctly you should see something like :

You can easily install CUDA according to the previous link. Now run all the commands one by one as root user.

apt-get install linux-headers-$(uname -r)

Download a deb file from here and then install the .deb file (replace name accordingly)

dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb

then run:

apt-get update
apt-get install cuda

Voila, You’re done !

Akash Angle

I am a Full time Linux user who has quit using Windows for unknown reasons, making my life truly open source.

Recent Posts

Get the most juice from your ISP/router — setting MTU size & other handy tweaks

This is not an ad-vocation by any means for TP-link branding, however a real life…

7 months ago

How to make any Android phone up-to 3x faster – Developer options unleashed

First of all we need to hit the kernel version on any Android device. You…

7 months ago

systemd-resolve command not found in Ubuntu Desktop

Use resolvectl status instead. It's like something deprecates and suddenly things get broken! In systemd…

12 months ago

How to exclude multiple directories with rsync?

Geeky question: This is what people and friends have tried: rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john…

12 months ago

How to resolve apt-get -f not working

You might encounter this error which appears to be very common on Debian based Distro's…

12 months ago

How to install Broadcom STA wireless drivers on Kali Linux

PS: This article is for only Kali Linux users, that too having a Broadcom Wireless…

1 year ago