Puget Systems print logo
Read this article at https://www.pugetsystems.com/guides/1236
Dr Donald Kinghorn (Scientific Computing Advisor )

How To Install CUDA 10 (together with 9.2) on Ubuntu 18.04 with support for NVIDIA 20XX Turing GPUs

Written on September 27, 2018 by Dr Donald Kinghorn

NVIDIA recently released version 10.0 of CUDA. This is an upgrade from the 9.x series and has support for the new Turing GPU architecture. This CUDA version has full support for Ubuntu 18.4 as well as 16.04 and 14.04. The CUDA 10.0 release is bundled with the new 410.x display driver for Linux which will be needed for the 20xx Turing GPU's. If you are doing development work with CUDA or running packages that require you to have the CUDA toolkit installed then you will probably want to upgrade to this. I'll go though how to do the install of CUDA 10.0 either by itself or along with an existing CUDA 9.2 install.

Do I need to install CUDA 10?

This is an important question to ask yourself. I believe that many people do CUDA installs when they really don't need to do so. The most important thing to keep in mind is that,

CUDA GPU acceleration run-time libraries are included with the NVIDIA display driver. You do not need CUDA installed for most GPU accelerated applications.

You need to install CUDA 10 if;

  • You are doing fresh development work writing low level CUDA kernels and need access to nvcc, AND you want to build on the latest platform with support for NVIDIA's new Turing GPU's.
  • You are recompiling existing packages and want to link in the most recent libraries. For example, if you are doing a TensorFlow build from source and want to try the latest GPU support.
  • You want to use a software package that explicitly states that you need to have the CUDA "toolkit" installed. Most GPU accelerated software does not require a CUDA install.
  • You just can't stand the thought of not having it installed on your system because you might want to try messing with it. Hey, that's OK, I understand that!

You do NOT need to install CUDA 10 if;

  • You are a developer working with CUDA 9.x or earlier in your code base and there are no compelling new features that you want to risk breaking your application to try. See the release notes.
  • You are working with Python machine learning frameworks AND using Anaconda Python. Most of the frameworks have up-to-date builds available from Anaconda Cloud that include the needed CUDA libraries i.e. you don't have to install anything outside of the package you want.
  • You are using GPU accelerated software packages that only depend on CUDA run-time support from the display driver. That includes most "ready to use" or commercial software.
  • You don't know what CUDA is. In that case then, well, thanks for reading my post. I hope you enjoy it and learn something from it.

Can I install CUDA 10 on a system that already has CUDA 9.2 installed?

Yes! CUDA 10.0 is the first CUDA release with official support for Ubuntu 18.04. Many people have followed my guide, How to install CUDA 9.2 on Ubuntu 18.04. That is a good general guide for doing a CUDA install. If you are doing a fresh CUDA install you may want to have both 9.2 and 10.0 installed at the same time. You can do that. Use the guide linked above to get CUDA 9.2 working.

We could almost do the same thing that I did in the 9.2 guide for CUDA 10, but, there is one problem (at least at the time I am writing this). The problem is that the NVIDIA driver needed for CUDA 10.0 is version 410 or greater. That driver is in beta right now and the ppa's have not packaged it yet. That means you would have to do a "raw" install of the driver from NVIDIA's base package. That's something you can do but I generally don't recommend it unless you really understand what you are doing. That's because you can run into configuration and dependency problems that can make a mess on your system that is hard to fix and maintain. I highly recommend sticking with ppa's, or, what I'm going to do below.

Steps to install CUDA 10.0 on Ubuntu 18.04

Step 1) [Optional] Install CUDA 9.2 if you want to have both that and CUDA 10.0 on your system.

[If you don't have Ubuntu 18.04 installed yet then see my note at the end of this step.]

If you want to have CUDA 9.2 along with CUDA 10.0 then it might be best to install 9.2 first. You can follow my guide, How to install CUDA 9.2 on Ubuntu 18.04. You don't strictly have to install 9.2 first but it might be less confusing if you do. That guide for the 9.2 install is pretty general, and is a safe way to install older versions of CUDA (but don't down-grade your display driver if you have a newer version!). The only real change from that guide will be where you get the "run" file. It will now be in the "Legacy Releases" section of the CUDA download site.

CUDA Legacy

Once you have the CUDA 9.2 "run" file from the 17.10 Ubuntu release the rest of my guide linked above should get you a working CUDA 9.2.

Note: If you are doing a "clean" OS install of Ubuntu 18.04 then you might want to look at The Best Way To Install Ubuntu 18.04 with NVIDIA Drivers and any Desktop Flavor.

Step 2) Install CUDA "dependencies"

There are a few dependencies that are good to install first since they don't always get pulled along with a CUDA install from the "deb" file.

You will certainly need the build-tools and dkms,

sudo apt-get install build-essential dkms
sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev

Those packages will get the needed GL, GLU, Xi, Xmu libs and several other libraries that will be installed as dependencies from those.

Step 3) Get the CUDA 10 "deb" file to set up the package repository

Go to the CUDA Zone and click the Download Now button. Then click the link buttons until you get the following,

CUDA download

Notice those 18.04 16.04 14.04 buttons! Nice! I am using the [deb (network)] file for the install. When you run that it will setup the apt repository configuration on your system. Then when you do the CUDA install it will pull the packages from NVIDIA over the network. You can use the [deb(local)] file if you want to download the entire repository to your system. That can be useful if you want to install on multiple machines or want stricter version control against updates.

Step 4) Do the install!

The instructions listed in that image above are what you should do.

sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub

sudo apt-get update
sudo apt-get install cuda

This will pull down and install all of the CUDA 10 packages along with dependencies AND the 410 NVIDIA display driver.

Now reboot. When your system restarts you will be running the NVIDIA 410 display driver and have CUDA 10 installed in /usr/local.

Step 5) Setup your CUDA environment

First look at /usr/local to see what you got from the install.

kinghorn@u18:~$ ls -l /usr/local/
lrwxrwxrwx  1 root root    9 Sep 26 09:28 cuda -> cuda-10.0
drwxr-xr-x 16 root root 4096 Sep 26 09:27 cuda-10.0
drwxr-xr-x 19 root root 4096 Sep 25 19:59 cuda-9.2

Notice that the CUDA 10 install created a symbolic link from /user/local/cuda to the cuda-10.0 directory.

Checking nvidia-smi you will see the new driver is running.

kinghorn@u18:~$ nvidia-smi
Wed Sep 26 13:32:50 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 1070    Off  | 00000000:01:00.0  On |                  N/A |
|  0%   49C    P8    11W / 151W |     42MiB /  8116MiB |      0%      Default |

| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|    0       934      G   /usr/lib/xorg/Xorg                            39MiB |

That is my old Puget Systems Peak Mini with a GTX 1070 in it, not my wonderful new Peak Single that has a 1080Ti and Titan V in it ... and will soon have an RTX 2080Ti Turing GPU in it! (I will be doing the CUDA install in this post on my new system too. I tested the install on the older machine.)

How to setup environments for both CUDA 9.2 and 10.0

In this section I'll go through a convenient way to setup your environment for "personal" use. This will be easy for switching back and forth between the CUDA versions if you want to do that. For a "system wide" multi-user environment that is configured automatically on login. Have a look at the post for installing CUDA 9.2 on Ubuntu 18.04.

To make it easy to switch back and forth between CUDA 10 and 9.2 you can make the following files,


export PATH=$PATH:/usr/local/cuda-9.2/bin
export CUDADIR=/usr/local/cuda-9.2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.2/lib64


export PATH=$PATH:/usr/local/cuda-10.0/bin
export CUDADIR=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64

You can put these files anywhere you want. I out them in ~/misc/ i.e. misc in my home directory.

You would use (and check) these like this,

kinghorn@u18:~/projects$ source ~/misc/cuda10.0-env

kinghorn@u18:~/projects$ env | grep -i cuda

kinghorn@u18:~/projects$ source ~/misc/cuda9.2-env

kinghorn@u18:~/projects$ env | grep -i cuda

We'll use these scripts in the testing section below.

Step 6) Test CUDA by building the "samples" from source for both CUDA 9.2 and CUDA 10.0

I'll create a cuda-testing directory in my projects directory and then copy the sample directories from both version of CUDA.

kinghorn@u18:~/projects$ mkdir cuda-testing
kinghorn@u18:~/projects$ cd cuda-testing/

kinghorn@u18:~/projects/cuda-testing$ cp -a /usr/local/cuda-10.0/samples samples-10.0

kinghorn@u18:~/projects/cuda-testing$ cp -a /usr/local/cuda-9.2/samples samples-9.2

kinghorn@u18:~/projects/cuda-testing$ ls
samples-10.0  samples-9.2

Now set the environment and build the samples,

kinghorn@u18:~/projects/cuda-testing$ cd samples-9.2/
kinghorn@u18:~/projects/cuda-testing/samples-9.2$ source ~/misc/cuda9.2-env
kinghorn@u18:~/projects/cuda-testing/samples-9.2$ make -j 4

You will see compile lines that start with,

/usr/local/cuda-9.2"/bin/nvcc -ccbin g++  ...

Now lets do that with CUDA 10.0,

kinghorn@u18:~/projects/cuda-testing/samples-9.2$ cd ../samples-10.0/
kinghorn@u18:~/projects/cuda-testing/samples-10.0$ source ~/misc/cuda10.0-env
kinghorn@u18:~/projects/cuda-testing/samples-10.0$ make -j 4

This time the compile lines start like,

/usr/local/cuda-10.0/bin/nvcc -ccbin g++  ...

To finish up here's a screenshot of two copies of "nbody" running on this system. One built with CUDDA 10.0 and the other built with CUDA 9.2.

nbody builds from CUDA 9.2 and 10.0

It looks like CUDA 10.0 is a great release. Check out the release notes to see some of the new features and changes in CUDA 10.0

Happy computing! --dbk

Tags: CUDA, NVIDIA, GPU, Ubuntu

Hi, I'm pretty new to CUDA and Ubuntu - you're tutorial really saved me a lot of stress, thank you! CUDA 10 runs perfectly however I need CUDA 9.2 for compatibility with a speech synthesis toolkit I am using. When I try and install CUDA 9.2 (following your guide and others) I run into all sorts of problems that result into a broken install. I end up removing all remnants of CUDA and starting again. This is frustrating, I would like both versions, but 9.2 has only given me trouble. I am running Ubuntu 18.04, and would appreciate any help you can offer to install CUDA 9.2 robustly on top of CUDA 10 in a way I can access both (as suggested in this tutorial). Thanks, Mar

Posted on 2018-10-05 15:47:04
Donald Kinghorn

Hi Mark, Really I wrote this for people in your situation. I'm really sorry it didn't go well! The biggest trick in doing a setup with multiple cuda version is knowing what the installers are doing. However, if you are new to CUDA then how would you know that! Here's some ideas try again and post back if you run into trouble myself or others reading the posts may be able to help.

Try this;
First do the install of cuda 10 as in this post. That will
install the 410 driver,
it will install package dependencies for cuda,
it will put the cuda toolkit in a directory /usr/local/cuda-10.0,
and create a symbolic link from that directory to /usr/local/cuda.
It should also create /etc/ld.so.conf.d/cuda-10-0.conf which adds a path for the system linker /usr/local/cuda-10.0/targets/x86_64-linux/lib

That's your cuda 10 setup and if you use the source the environment script like I have in this post then all of that will bi on your path and ready to go... Reboot and test your CUDA 10 build by compiling the samples.

Now for 9.2,
Grab the 9.2 ".run" file for Ubuntu 17.10 from the cuda archives along with the .run file for "Patch 1". Then go to step 4) in the post about installing 9.2,
sudo sh cuda_9.2.88_396.26_linux.run

Now here is where you have to be careful! I'm going to put a copy of the answers to the questions the installer asks here,

You are attempting to install on an unsupported configuration. Do you wish to continue?
(y)es/(n)o [ default is no ]: y

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 396.26?
(y)es/(n)o/(q)uit: n

Install the CUDA 9.2 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
[ default is /usr/local/cuda-9.2 ]:

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: n

Install the CUDA 9.2 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
[ default is /home/kinghorn ]: /usr/local/cuda-9.2

The 2 key things are saying no to installing the driver and saying no to adding the symbolic link. (you could do that but I would suggest you just leave the link pointing at cuda 10 )

You should also install the cuBLAS patch
sudo sh cuda_9.2.88.1_linux.run

That's it! What you will have is the cuda 9.2 toolkit installed in /usr/local/cuda-9.2

Note: this might overwrite the linker path in /etc/ld.so.conf.d/ hopefully is just adds another file for cuda-9.2 However, you don't even really need to keep those files in there for the linker if you use the environment script to set your PATH and LD_LIBRARY_PATH when you work on a project.

Really this should work. Key things to keep in mind: The "run-time" libraries for CUDA applications are contained in the display driver and that should support all older cuda versions. When you are building CUDA code you need to have your local shell environment pointing to the correct cuda toolkit. You will be using nvcc and the libs in that toolkit directory. So, set your environment with by running "source" on the appropriate script that I have in this post and then check your environment with the "env" command. When you run env you should see that the proper version of cuda is on your PATH and LD_LIBRARY_PATH. Then you should be set to do a code build. But, the code you are building needs to have any makefile environment set correctly too. You should be able to build the cuda 9.2 samples from the makefile included with then after you have set your environment.

There! I think this is good to have here in the comments. It makes the post better. If this doesn't work and you run into issues post them back here ... Best wishes Don

Posted on 2018-10-05 17:25:44

Hi Don,

Thank you so much for such a detailed and helpful reply!

I have followed your installation steps for CUDA-10.0 and whilst I can successfully test the samples, no cuda dir is made in /usr/local/ and therefore there is no symlink from cuda-10-0 pointing there - will that be problematic?



Posted on 2018-10-08 08:57:10

Hi Don,

The instructions you gave me (missing cuda dir or not) seemed to have done the trick!

Thanks so much,


Posted on 2018-10-08 09:39:09
Donald Kinghorn

good! glad you got it working. the link is just "convenience" It really is probably best to set environment vars for the exact version you want. The one thing to keep in mind is that on occasion you may run into a program that has a hard coded path to /usr/local/cuda. You can manually add (or change) the link with, for example,

sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda

you can remove the link wihtout affecting what it is linked to i.e.
sudo rm /usr/local/cuda just removes the link itself

Posted on 2018-10-08 17:50:14
oguz canbek

Hi Don,

Thanks for the detailed article but I seem to have a problem when I try to install CUDA 10.0 with the command "sudo apt-get install cuda" I get the following error:

" E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. "

Attached you can also find the whole output of the install command.


I don't know what I can try to do. I am both an Ubuntu and CUDA newbie. As GPU, a have a notebook model GeForce 1060M. If you have any advice you can share with be that would be great! Thank you very much in advance,


Posted on 2018-10-09 12:15:32
Donald Kinghorn

Oh yuk! I hate those dependency errors and held package stuff. I have run into that before from various problems. I have even backed out completely and reinstalled OS to fix it. I don't think you will have to do that.

First make sure that you are actually seeing the cuda 10 repo. There should be a file /etc/apt/sources.list.d/cuda.list that has an entry for the Ubuntu 18.04 repo Then be sure that you have run sudo apt-get update

You are getting dep errors related to the 396 driver but cuda 10 will be installing the 410 driver ??? I can't really advise you very well on this because I'm not really sure what the system state is. You could try to update or reinstall the older 396 driver and see if dep tree gets repaired and then try the cuda 10 install again. You may have to purge the old 396 driver too ???

Before you do anything else make sure you have important data and directories backed up somewhere. Check your cuda repo, they to update your old driver, and then you could also try doing sudo apt-get install -f to "fix" the failed install sometimes that works If you are still having trouble after that then I suggest searching around the web for some of those exact lines that have the "Depends:" error ... that would be what I would be doing.

I wish I had better advise for you!

Posted on 2018-10-09 22:37:07

Thank you very much. This article helped me get started with cuda development.

Posted on 2018-10-23 03:43:37
Gustaf Sundberg

Hi great article. I got it working on my new RTX 2080. (I have been doing approx 10 install trying to get tensorflow-gpu and keras working, but it complains about libcublas.9.0). I have seen you did a lot of tensorflow stuff, what are the approximate steps to continue from here to get tf and keras installed? I assume installing cudnn-10 and libcupta and then tensorflow-gpu

Thanks for the great article!

Posted on 2018-10-28 13:34:32
Donald Kinghorn

Honestly, my recommendation is to use Anaconda Python and use TF and Keras from their builds. The following post would be a good guide for that,

That post is a little bit out of date but you should be OK since you have the new driver from doing the CUDA install. I need to do a refresh on this stuff myself, I've been doing hardware testing and working with PyTorch. I haven't had TF fired up except running in docker containers for the hardware testing posts.

Posted on 2018-10-29 21:23:32

This new graphic card has troubled me for two days for initial setup but luckily I found your blog to help me getting going. I went through driver installation from ppa (using sudo apt-get install nvidia-driver-410) and directly download 410 driver and install. Neither worked. Thank you for the great article!

Posted on 2018-11-02 02:15:25
Mi Cha Ga

Hello all, i installed the tensorflow-gpu nightly build tf-nightly-gpu 1.13.0.dev20181113 from https://pypi.org/project/tf... and everything works fine now. Tensorflow detects my 2080 Ti and i was able to train all my nets with that step.

Here is my setup:
CUDA 10.0
cudNN 7.4.1 for CUDA 10.0
nvidia display driver 410.48
Tensorflow 1.12

This was the easiest workaround for me because you dont have to build tensorflow-gpu from bazel.

Posted on 2018-11-15 15:01:05
Donald Kinghorn

Great! Thanks for posting that!

Posted on 2018-11-15 17:20:28

Thank you for this step by step tutorial.

I have an issue and I don't no why.

I have Ubuntu 18.04 and cuda 10.0

I get the following warning:
>>> WARNING - simpleGLES is not supported on Linux x86_64 - waiving sample <<<

How can I solve this?

Posted on 2018-12-14 10:44:17
Donald Kinghorn

This is expected. Not all of those samples build correctly and as the messages hints some of them don't work on Linux. That's one of them. I'm not sure of the status of openGL ES but ... It is designed for "embedded systems", that's what the ES part stands for.

If you have done this ...

sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev

Then that should pull in the GL dependencies for nearly everything that does work.

Posted on 2018-12-17 17:48:11
Punit Naik

I followed the process described by you and now I am getting this error:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Please help!

Posted on 2018-12-22 12:06:48

Try rebooting the PC

Posted on 2019-02-12 14:59:12
Donald Kinghorn

what Kek said :-) ... You get that error if there is no driver running.

Doing the CUDA 10 install from the repo will get you a 4.10 driver that will work with everything up to and including the new RTX cards.

Posted on 2019-02-14 03:00:21
Kerry Ling

Hi Donald,
I have been following all your benchmark and setup instruction articles. They are really helpful on my gtx 1050 ti setup. Thanks!
But I ran into problem on tensorflow on my RTX 2080 ti setup for the last 2 days. No problem on installation but on running tensorflow, kernel kept dying. See the output below. Will you please help!
Ubuntu 18.04, Python 3.6.7 env, Driver 410.48, cuda 10.0.130

runfile('/mnt/rtxshare/Deep_Learning_A_Z/Section08_CNN/cnn.py', wdir='/mnt/rtxshare/Deep_Learning_A_Z/Section08_CNN')
Using TensorFlow backend.
Found 8000 images belonging to 2 classes.
Found 2000 images belonging to 2 classes.
Epoch 1/25
2018-12-26 05:40:18.277380: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-12-26 05:40:18.407665: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-12-26 05:40:18.408044: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: GeForce RTX 2080 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.635
pciBusID: 0000:01:00.0
totalMemory: 10.73GiB freeMemory: 10.26GiB
2018-12-26 05:40:18.408056: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2018-12-26 05:40:18.623086: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-12-26 05:40:18.623103: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2018-12-26 05:40:18.623108: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2018-12-26 05:40:18.623248: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 9897 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5)

Kernel died, restarting
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from layers import Dense
classifier = Sequential()
classifier.add(Conv2D(32, (3, 3), input_shape = (64, 64, 3), activation = 'relu'))
classifier.add(MaxPooling2D(pool_size = (2, 2)))
classifier.add(Conv2D(32, (3, 3), activation = 'relu'))
classifier.add(MaxPooling2D(pool_size = (2, 2)))
classifier.add(Dense(units = 128, activation = 'relu'))
classifier.add(Dense(units = 1, activation = 'sigmoid'))
classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
from keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale = 1./255,
shear_range = 0.2,
zoom_range = 0.2,
horizontal_flip = True)
test_datagen = ImageDataGenerator(rescale = 1./255)
training_set = train_datagen.flow_from_directory('dataset/training_set',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
test_set = test_datagen.flow_from_directory('dataset/test_set',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
steps_per_epoch = 8000,
epochs = 25,
validation_data = test_set,
validation_steps = 2000)

Posted on 2018-12-26 14:13:28
Luan Weba

Hey Donald

As a new student of CUDA and Ubuntu, your guide to install CUDA and Nvidia drivers along Ubuntu server was very helpful!! Thank you very much, but there is some question i want to know before i install CUDA 10.0. My driver now is Nvidia 415, but you say they will install the 410 driver, it will be any kind of problem?

Posted on 2019-02-26 19:30:16


Posted on 2019-03-20 22:19:52

I'm giving you 24 hours to edit this to remove the profanity, and to add something constructive to your post, or it will be marked as spam and deleted. Criticism is fine, if given politely, and questions or concerns about how this is supposed to work (or why it isn't working for you) are also fine... but crude language and insults are not. 24 hours.

Posted on 2019-03-20 23:46:52

Any chance this may work with Ubuntu 19.04 beta? Nvidia 4.18 drivers installation worked flawlessly; however, I noticed 19.04 is not among the listed supported systems for CUDA. So I was wondering if installing the version for 18.10 may work anyway or if there was any workaround?

Posted on 2019-04-06 03:04:01
Donald Kinghorn

It does work! In fact put up a post on Friday talking about it. I installed 10.1 on Ubuntu 19.04 and you could use the same ideas to add other cuda versins if needed. I used the .run file for Ubuntu 18.10 see ...

Posted on 2019-04-08 15:52:30
Nenko Nenov

Thank you for the guide. I followed everything and as a beginner I had problem with creating a environment file which I had to look up elsewhere to see how to do. I think it would be your tutorial self sufficient even for noobs like me if you include that.
The second thing is that in the very last testing section it looks like it worked but I couldn't see the nbody anywhere thought the code was working it seems.

Posted on 2019-04-06 22:07:17
Donald Kinghorn

Thanks for the feedback. I try to be complete but sometimes there are things I don't even think of or just leave out. I've done similar post to this in the past with more detail. Including one I put up on Friday (that is an experimental install but the ideas are the same and I included 2 ways of setting up environment)
https://www.pugetsystems.co... have a look at that post.

Once you have your install and environment setup you can copy /usr/local/cuda/samples to somewhere in your home directory and then cd into it and just run

make -j 4

where the 4 can be the number of CPU cores your system has. The make file in there should build all of the sample and put the executables in
bin/x86_64/linux/release/ You can also go into any of the source directories and run make That should build jsut that code and leave the executable in that directory.

If you are not seeing the nbody display when you run it be sure you have the openGL extras installed. The following should do it,

sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev

Posted on 2019-04-08 16:09:13

Just a note on this - if you follow the instructions as written (and as per nvidia's instructions), you currently end up with CUDA 10.1 regardless of which deb file you download and install (well that's my experience anyway), see https://docs.nvidia.com/cud...

If you really want 10.0 you need to install the specific metapackage at step 4

sudo apt-get install cuda-10-0

Posted on 2019-04-13 23:41:22
Donald Kinghorn

That's a good point DaveW Thanks! They often just replace the "dot" updates. But some code will break on a new dot release. I looked at TensorFlow 2 alpha last week and it was linked to 10.0 (subject to change of course!)

Posted on 2019-04-15 16:16:19

Thanks a bunch. This screwed me up. Doesn't seem like 10.1 works with tensorflow yet. This seems like a major flaw with Nvidia's download page.

Posted on 2019-06-17 19:30:57

Yeah tensorflow don't update to the latest cuda very often, I think the beta of v2 does. Also if you follow this install method, be aware that each time Nvidia release a new version of either the driver or cuda you'll be prompted to update. I disabled in Software and Updates

Posted on 2019-06-17 23:20:03
Donald Kinghorn

I just did an install to V2 it is still (as of now) linked to cuda 10.0 I did the install using Anaconda python. I did the normal install for TF 1.13 which brings cuda 10.0 and cudnn 7.6 along with it and then just did a pip install of TF v2 in that env. Worked OK! I'll probably be writing up a blog post about that soon.

The apt install of cuda 10.0 should also be OK for V2 ... new env, then pip install tensorflow-gpu==2.0.0-beta1

Posted on 2019-06-18 21:53:31
Donald Kinghorn

Yes, it is annoying! This is the main problem with doing TensorFlow install as suggested by Google. Getting the proper CUDA toolkit in-place is a pain. As Dave pointed out TF is linked against CUDA 10.0 You can pull the 10.0 cuda .run file from their archives and install it along with any other cuda versions (like in this post) or you can do an apt-get install with the specific version. I generally don't like to use the apt packaged cuda because it drops stuff all over your system instead of just /usr/local (among other reasons) but it it gets you running then great!

My recommendation for TF is to use Anaconda python which has the proper cuda bundled along with the conda install (this keeps it in it's own env ). That's what I do in the post that are titled something like "How to install Tensorflow with GPU support without installing cuda" That works equally well on Linux and Windows.

However, if you are up and running then don't mess with things :-)

Posted on 2019-06-18 21:46:51
Rahul Venugopal

https://uploads.disquscdn.c... Hi ,

Thanks for nice tutorial . But my system will not boot up after installing Nvidia driver or CUDA.

I am trying to install nvidia driver with RTX 2080 Ti in Ubuntu 18.04 LTS

After Installing nvidia-driver (version 418.56) , the system will not boot . The following output comes and the screen stays blinking :

[code]/dev/sda4: recovering journal
/dev/sda4: clean, some numbers / some numbers file, some numbers / some numbers blocks [/code]

Output of following commands are :

lspci |grep -i nvidia

[code]65:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
65:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
65:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Controller (rev a1)
65:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 UCSI Controller (rev a1)[/code]

uname -m && cat /etc/*release

VERSION="18.04.2 LTS (Bionic Beaver)"
PRETTY_NAME="Ubuntu 18.04.2 LTS"

gcc --version

[code]gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO

uname -r


I tried installing Nvidia driver through three different following methods :

Using PPA :

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-418

Through Nvidia site directly :

downloaded the display driver for Linux from

chmod +x NVIDIA-Linux-x86_64–410.57.run

sudo ./NVIDIA-Linux-x86_64–410.57.run –no-x-check

Along with Cuda

Using sudo apt-get install cuda


In all cases the result is same and the system would not boot and gets stuck at the error mentioned before .


Please help if possible


Posted on 2019-04-16 07:26:14
Donald Kinghorn

Wow that is giving you trouble ... sorry I didn't see your message earlier ... One thing I can think of to check; In your BIOS settings look for settings related to "Secure Boot" make sure that is disabled and see if there is an option to set "OS" to "Other" (rather than Windows) . NVIDIA does not have a signature for drivers but Ubuntu does! That can cause strange trouble.

The other thing is to ... In fact I think this is the problem!! I should have thought of this as soon as I saw your screen shot!

Look at Step 4) in this post https://www.pugetsystems.co...

You need to do a nomodeset That post will show you where to add it during the grub boot sequence. Do that and then see if things are working OK to get the driver installed. If you reboot again and it still comes up badly then add nomodeset to the grub boot line again to bring the system up and then edit the file

so that the grub defaults line in there to look like (if there are other thing on that line then just add the nomodeset to them)


then run

sudo grub-mkconfig

Posted on 2019-04-22 16:30:36
Kevin Liu

Dear Sir--

thank you for the post. this certainly helps me a lot in my struggle in the last couple of days. In the end, I was able to get Nvidia 410.48 driver installed along with CUDA 10.0 on my brand new ubuntu 18.04 server. I followed most of your instruction strictly and it works for me. just one minor issue on viewing the n-body Nvidia sample. the graphs do not show up at the end. however, most of the installation seems ok. It seems ubuntu 18.04 has some issue with OpenGL. I got the same warming:

>>> WARNING - simpleGLES is not supported on Linux x86_64 - waiving sample <<<.

In any case, my server seems running fine with the newly installed Anaconda and Pytorch 1.0 on CUDA 10.0 and nvidia driver 410.48 on my RTX 2080 Ti card. thanks a lot!!

Posted on 2019-04-19 20:46:02
Donald Kinghorn

Glad you got things working !
The following usually takes care of dependencies for openGL stuff

sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev

Posted on 2019-04-22 16:05:00

Thank you so much for the series of articles on ubuntu/cuda installation. I finally got my system to work after numerous futile attempts following other guides.

Posted on 2019-05-01 17:42:22

What kind of issues may I run into if my ubuntu version is different? i.e Ubuntu 16.04.1

Posted on 2019-05-12 07:47:31

I'm glad for these instructions!
So I have ubuntu 18.04 and have cuda 10.1 installed, along with 10.0
I can confirm this by running nvidia-smi.
When I run nvcc --version, it gives me Cuda compilation tools, release 9.1, V9.1.85

I also have tensorflow installed, However, when I try to import tensorflow in python 3, I'm getting :
libcublas.so.10.0: cannot open shared object file: No such file or directory
I was told this is a cuda error. I'm not sure what is going on. Any suggestions?

Posted on 2019-05-17 06:03:09
Donald Kinghorn

First thing I'd try is

export LD_LIBRARY_PATH=/user/local/cuda10.0/lib64:$LD_LIBRARY_PATH

before starting up python. (note that I put the cuda-10.0 path before the existing path)

Also, check that the library file is in there! Let me check something ... OK, I just started up a docker container with cuda-10.0 The lib is in that path I listed above but check anyway :-)

You have to be careful with your environment. For multiple version installs it's probably best to do the "per shell" setup i.e.

export PATH=$PATH:/usr/local/cuda-10.0/bin
export CUDADIR=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64

Keep in mind that if you set global env stuff in /etc/profile.d/ an /etc/ld.so.conf.d/ the that may interfere...

Also, try importing tensorflow from a python prompt in a terminal and see if it works OK. If you are importing in a Jupyter notebook your path may not be what you expect ??? I'm not sure about that but it is worth checking. In a notebook you could do !env | grep -i cuda to see your setup that the notebook is seeing.

Honestly my preferred way to run tensorflow with GPU is using Anaconda Python (or a docker image) because then you don't even need a cuda install. But, I can understand why you might want to use "pure" Python.org python! It's just that life may sometimes be more difficult :-)

Posted on 2019-05-18 00:10:13
Julius Ledoux

Hi Donald,
Thank you for your post, it was really useful to me. Following your post I managed to install Cuda 10.1. A couple of questions: When I run: 'which nvcc' on my system it shows: /usr/bin/nvcc and when I run nvcc -V it shows version 9.1. When I look in the /usr/local/ directory, I only have the cuda-10.1 directory, but not the 9.1 at all. I tested and everything seems to run fine. Somehow, it seems that the default Cuda version (on my system) is 9.1?
When I run nvidia-smi it shows: Driver Version: 418.56 and Cuda Version: 10.1.? A little bit confusing.... Thanks!

Posted on 2019-05-25 07:29:20
Donald Kinghorn

That is confusing! I think you have a cuda install from the Ubuntu packages (that you would have gotten from something like apt-get install cuda) That would be an older version and it would have put stuff all over the system ... like in /usr/bin ... what you did here from this post will be in /usr/local/cuda/bin look in there you should see nvcc there. ( cd in there and do ./nvcc -V ) An easy work-around would be to set your PATH so that /usr/local/cuda/bin comes before the system PATH i.e.

Instead of
export PATH=$PATH:/usr/local/cuda-10.0/bin
export CUDADIR=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64

export PATH=/usr/local/cuda-10.0/bin:$PATH
export CUDADIR=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH

I guess you would want 10.1 in there. What is happening is that in your shell you are hitting the "system" PATH before the /usr/local PATH

nvidia-smi is reporting the capability of the cuda runtime in the "driver" and since you have a newer driver it is showing 10.1 It would do that even without any cuda install ( the runtime is just in the driver the toolkit and build tools are in the cuda install)

Hope that clears things up.

If you want to clean out the old cuda from apt-get you do an apt-get purge cuda* but if you do that be very careful! and check what will be getting removed before you say "yes"
Try that at the command line with out sudo, just apt-get purge cuda* and then hit [tab] to see what all packages expand for the * completion. If it looks OK then you could do the real thing but still check to see if it wants to remove any dependencies along with it ... you may want to keep them ???

Posted on 2019-05-29 00:38:08
Anjul Sharma

hi, i pretty new to CUDA. your tutorial is very helpful, thank you!

But i got little confused in cuDNN installation, do i need to install different - different cuDNN [cuDNN7.0 for cuda9.0 and cuDNN > 7.4 for cuda10]. Because while switching cuda version will need cuDNN respectively, do it cause any problem or it will take care itself?
Or is there there any specific cuDNN version for both cuda versions.
What should i do?
Thanks, anjul

Posted on 2019-08-26 15:55:47
Donald Kinghorn

That's a good question! Fortunately cudnn install is pretty simple i.e download the tar file expand it and copy the files to the appropriate places in the cuda install dir. Here's the nvidia guide link as a reference https://docs.nvidia.com/dee...

Your intuition is correct. If you are doing work where you need different cuda versions then copy the needed cudnn files into the the different cuda install directories. They will be on your path and lib path from the cuda setup environment that you pick ( I recommend using an environment script for changing versions) The cudnn install doc assumes /usr/local/cuda you will want to use the "versioned" directory i.e. /usr/local/cuda-9.0 etc..

Posted on 2019-08-26 19:51:41

Thank you for this and other great tutorials. I installed cuda-10.2 and had no problem. thanks

Posted on 2020-01-26 09:42:38
E. Andrade Velásquez

Hello and thank you very much for your tutorial.
I have two questions:

1. In the instructions to set up the environments, after exporting the paths, you say "You can put these files anywhere you want. I out them in ~/misc/ i.e. misc in my home directory". How do I 'out' them wherever I want?
2. I am only interested in installing CUDA 10.0 (I already have CUDA10.1 installed in my system). I successfully installed the version I wanted but I think I screwed up with its compatible cuDNN version. I used v.7.4.2 and included all relevant files in the appropriate CUDA directories, or so I thought. The question is: after installing CUDA10.0 (or any version), do I need to manually install cuDNN too? how can I make sure I have the right version of cuDNN for my version of CUDA?

As a bit of background, I am trying to train a deep neural network (in a virtual env in Ubuntu 18.04., TensorFlow-gpu v.1.14.0, Python 3.6), but by the time I run it, this error comes: tensorflow.python.framework.errors_impl.NotFoundError: libcudart.so.10.0: cannot open shared object file: No such file or directory
Doing some research, I believe the error came because I have incompatible versions of CUDA and cuDNN. Is this the case?

Thanks for any help

I am also very new to CUDA as you can see. Thank you for your help!

Posted on 2020-03-11 12:12:08
Donald Kinghorn

1) that was a typo it should be "put" This post was written 2 years ago and we changed our editor, I can not go back and change it now :-)

2) You need to install the cuDDN libs in with the CUDA version library directory and then it would be good to do
sudo ldconfig

However, since what you are wanting to do is use TensorFlow I highly suggest that you install Anaconda Python and set up the envs you need with conda
Doing that you will not need to worry about CUDA at all since the evn's will contain the versions they need.

Read these 3 posts to understand how to do the setup and to see some examples. I included both Windows and Linux. They are mostly the same after you install Anaconda. The Linux post is old but would be good to look at too. The most recent post was using TF 2 beta. Version 2 is now the default when you install with conda i.e.

conda install tensorflow-gpu

Will give you TensorFlow 2 and all the CUDA libraries that are needed to use it with NVIDIA GPU's ... it's that easy! Best wishes --Don




Posted on 2020-03-11 15:20:11
E. Andrade Velásquez

Hi Don,

Thank you very much for such detailed answer!
I found out I would need to downgrade my tensorflow to version 1.2 instead of 2beta. Would the installation with Anaconda also work in this case, i.e. if I write 'conda install tensorflow-gpu==1.2', would it also give me the necessary CUDA libraries?

Posted on 2020-03-11 15:55:51
Donald Kinghorn

Yes, you can set any version you want when you create the env It will pull the correct CUDA and cdDNN dependencies into the env. That's the beauty of it! You can have separate envs with different versions for different projects.

Use conda to create the env and install TF, you don't need to do anything like the pip install hack that I did in that TF beta post. That was just because it wasn't available for Anaconda at that time. It's good to read that post though because it gives you an understanding of how everything works. [it's possible to pull in packages with pip in a conda env ... I have occasionally had to do that for specific openCV builds ... but always try to use conda packages first]

To see what options you have you can go to Anaconda cloud and look up packages https://anaconda.org/
The anaconda tensorflow-gpu build is here https://anaconda.org/anacon...
if you then click on the "files" tab you will see a list of all of the packages https://anaconda.org/anacon...
It looks like the default is now at 2.1 but the 1.12 that you need is there too :-)

Posted on 2020-03-11 18:25:47
E. Andrade Velásquez

Hi Don,
Thanks again for your reply. I have tried to install the version of TF that I need, but conda would not let me because the CUDA drivers already installed in my system are incompatible to those I would install with conda. I get this:

"The following specifications were found to be incompatible with your CUDA driver:
- feature:/linux-64::__cuda==10.1=0
Your installed CUDA driver is: 10.1"

Do you have a suggestion as to how to get around this issue?


Posted on 2020-03-12 17:42:31
You can put these files anywhere you want. I out them in ~/misc/ i.e. misc in my home directory.

Um, I'm a noob so I didn't understand this. What files are you talking about here? Should I copy everything in /usr/local/cuda-10.2 and paste them in /misc folder at the home directory?

Posted on 2020-06-04 16:29:43
Donald Kinghorn

Nope, just the little script that sets your PATH and other environment variables. That's just a convenience so you would be able to switch environments without too much trouble.

for example if you create a file my-cuda10.2-env.sh with the following

export PATH=$PATH:/usr/local/cuda-10.2/bin
export CUDADIR=/usr/local/cuda-10.2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.2/lib64

It sets PATH CUDADIR and LD_LIBRARY_PATH to point to what you have installed in /usr/local/cuda-10.2 when you do

source my-cuda10.2-env.sh

the "source" command just tells your shell to read those 3 export lines to set those vars for the current shell (and any subshells because of the "export" command)

When you install CUDA you are installing the development tools and libraries for building cuda kernels with the nvcc compiler
Doing development work like this you will want to completely understand how environment variables work because it is one of the biggest sources of puzzling problems you will encounter.
Best wishes --Don

Posted on 2020-06-05 15:36:28

What about the gcc compiler ,for cuda version 9.X gcc 6 is required which is not availble on 18.04, even not able to install it. Does it effect use of cuda 9.x in anyway?

Posted on 2020-06-30 21:50:19
Donald Kinghorn

I didn't have any issues with gcc 7 together with the CUDA 9.x (or 10.x) dev libs and nvcc. Everything in cuda samples built without trouble.

My guess is that gcc v8 and the v9 in 20.04 would be fine too ... but I have not confirmed that

Posted on 2020-07-01 18:30:06


I was able to resolve the issue of the source list file not being created and apt-get update runs successfully. Now I am challenged with my original issue of broken packages.

apt-get update
Get:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 InRelease
Ign:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 InRelease
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release [574 B]
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release [574 B]
Reading package lists... Done
root@USFRYLNCNGLHP45:/home/user# apt-get install cuda
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
cuda : Depends: cuda-10-2 (>= 10.2.89) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I have checked for broken packages and nothing returns.

There is an Nvidia driver installed and it also says CUDA ver 10.2 is installed but I can't find the path to it.

cat /usr/local/cuda/version.txtcat: /usr/local/cuda/version.txt: No such file or directory

If I run nvidia-smi;

Tue Aug 4 08:30:03 2020
| NVIDIA-SMI 440.59 Driver Version: 440.59 CUDA Version: 10.2 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| 0 Quadro T1000 Off | 00000000:01:00.0 Off | N/A |
| N/A 39C P8 5W / N/A | 232MiB / 3911MiB | 0% Default |

| Processes: GPU Memory |
| GPU PID Type Process name Usage |
| 0 1450 G /usr/lib/xorg/Xorg 128MiB |
| 0 1913 G /usr/bin/gnome-shell 101MiB |

Posted on 2020-08-10 13:18:25
Donald Kinghorn

First thing, what you see from nvidia-smi "CUDA Version: 10.2 " is referring to the cuda-runtime that is part of the nvidia display driver install. The cuda development toolkit is a separate thing. CUDA apps that are built with less-than-or-equal to cuda 10.2 should run

Hey Mike, I was writing this and realized that things may have changed a lot with the cuda deb packaging! I am going to do a new setup and check thing out before I get back to you. This post likely needs a rewrite! (it at least needs an update since it is 2 years old). This is important stuff and it's easy to get a mess on your system ... which I'm afraid may have happened to you. I'll help you get it straightened out --Don

Posted on 2020-08-10 16:30:02

Thank you Don. I trying several different work arounds in the meantime.

Posted on 2020-08-11 14:21:36
Donald Kinghorn

Hey Mike,

I went through a multi version CUDA setup on a system. I'm going to outline it here but it may be a few days before I put up a fresh blog post.

I started with a clean Ubuntu 20.04.1 install

Then did a new CUDA 11.0 install using the "Package manager" method described here

That is setting up an nvidia repo and installing cuda from there. That install will refresh the NV driver to the latest 450 too. This worked fine and gives you a nice CUDA 11.0 setup in /usr/local

I then went to the legacy "button" on the cuda download page and got the .run installer for cuda 10.2 and installed it like

sudo sh cuda_10.2.89_440.33.01_linu... --toolkit --samples --override

it still asked questions because I didn't use --silent ... you have to use override because of gcc 9 on Ubuntu 20.04
be sure to not install the nvidia driver from this .run file. It will give you a selection page, un-select the driver!
question answers are basically ... continue, accept, deselect driver, No for symlink.

That installs in /usr/local/cuda-10.2

Then create a script to set the environment for this cuda version. I called it set-cuda10.2-env with the following content,

echo "Seting CUDA developemnt environment to version 10.2"
export PATH=/usr/local/cuda-10.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH

you can source that in a terminal and you will have the correct path and libs for cuda-10.2
You should probably make one for the cuda-11.0 dir too.

There is one catch! Ubuntu 20.04 is using gcc 9 and cuda-10.2 will complain and halt during compiles. The easy fix is to comment out the line that checks the gcc version :-) gcc 9 works fine!

The file to change will be

you need to find the line and comment it out. It was at line 138 in that file.


After doing this I was able to compile the nbody code from the cuda samples with both cuda-11.0 and cuda-10.2

Posted on 2020-08-12 00:14:07
Donald Kinghorn


Posted on 2020-08-12 00:27:30

I am working with Ubuntu 18.04 and CUDA 10.2.89. I am testing with a fresh build directly from the ISO and installing CUDA from the Nvidia site. This seems to work as documented. The problem comes in when I try to incorporate into my custom ISO build. that is where i get the errors i posted earlier.

Posted on 2020-08-12 17:05:15

Following your post:
apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxi-dev is already the newest version (2:1.7.9-1).
libxi-dev set to manually installed.
freeglut3 is already the newest version (2.8.1-3).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed or
Depends: libglu1-mesa-dev but it is not going to be installed or
E: Unable to correct problems, you have held broken packages.

Posted on 2020-08-10 13:21:47
Abdul Basit

HI donald , so let me put this way,
I am doing project on tensor flow having ubuntu
I have gtx 960 x . My tensor flow looks for cuda 10.01 ,but when i intalled nvidia driver , it comes with cuda 11
I am stuck , and i read your article , will try this but i want to ask do you have a article for installing nvidia drivers on ubntu 18.04

Posted on 2020-08-11 23:53:38
Donald Kinghorn

Hi Abdul, You don't need to install CUDA for TensorFlow. The best way to work with GPU acceleration for ML frameworks is to use Anaconda Python with conda. You create an "env" for it. Install into that. All of the cuda library (and other) dependencies will install along with it.

Here's a brief outline;

Go to https://www.anaconda.com/pr... and get the installer script and install Anaconda

Then in a terminal ...

create env:
conda create --name tf2-gpu

activate env:
conda activate tf2-gpu

install TensorFlow:
conda install tensorflow-gpu

install jupyter ipykernel:
conda install jupyter ipykernel

add jupyter kernel spec:
python -m ipykernel install --user --name tf2-gpu --display-name "TensorFlow2-GPU"

Then start up a jupyter notebook and enjoy!:
jupyter notebook

The above is really the way to do it ... really! :-) --Don

Posted on 2020-08-12 15:18:23