installing cuda 10.2 on ubuntu 18.04.3

hello, I downloaded and installed cuda 10.2 using:

sudo sh

my driver is nvidia-driver-430:

Then I rebooted my PC but as soon as a run the vectorAdd samples I get this error:

nhrnhr0@nhrnhr0-pc:~/Desktop/cudaInstall/cuda-testing/samples/0_Simple/vectorAdd$ make vectorAdd
/usr/local/cuda/bin/nvcc -ccbin g++   -m64      -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o vectorAdd vectorAdd.o 
mkdir -p ../../bin/x86_64/linux/release
cp vectorAdd ../../bin/x86_64/linux/release
nhrnhr0@nhrnhr0-pc:~/Desktop/cudaInstall/cuda-testing/samples/0_Simple/vectorAdd$ ./vectorAdd 
[Vector addition of 50000 elements]
Failed to allocate device vector A (error code CUDA driver version is insufficient for CUDA runtime version)!

What do I do wrong? and how do I solve it?

sudo sh

should have installed driver 440.33.01

But you are saying you have nvidia-driver-430

That won’t work. To find out why the 440.33 driver didn’t install you would need to inspect the installer logs.

They should be in /var/log/cuda-installer.log and /var/log/nvidia-installer.log

Since you previously (evidently) had a package manager installed driver from Ubuntu PPA, it would be necessary to remove that first as called out in the linux install guide:

You may wish to read the whole guide and follow it carefully.