This question already has an answer here:

How do I install Cuda in 18.04 LTS while its state in software that I used that currently using nvidia driver metapackage nvidia-driver-390

marked as duplicate by Jim, Fabby, Volker Siegel, Kulfy, karel Apr 28 at 14:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.