



If you are seeing this tutorial from the future and the newer versions of Cuda are so horrible that you think that is a good idea to go back to some older version, you should first check your gcc and g++ version, because each version of Cuda have a different maximum version supported for these two packages, Cuda 11.4 will support gcc and g++ up to version 10, if yours are higher you should downgrade, to do this follow this: sudo apt install build-essential sudo apt -y install gcc-8 g++-8 gcc-9 g++-9 sudo update-alternatives -install /usr/bin/gcc gcc /usr/bin/gcc-8 8 sudo update-alternatives -install /usr/bin/g++ g++ /usr/bin/g++-8 8 sudo update-alternatives -install /usr/bin/gcc gcc /usr/bin/gcc-9 9 sudo update-alternatives -install /usr/bin/g++ g++ /usr/bin/g++-9 9 sudo update-alternatives -config gcc 3.Installing Cuda 11.4 and driversĪfter purging Nvidia and downgrading gcc/g++ if you are from the future, you should be ready to go to the next level, but first use: nvidia-smi sudo apt-get -purge remove "*cublas*" "*cufft*" "*curand*" \ "*cusolver*" "*cusparse*" "*npp*" "*nvjpeg*" "cuda*" "nsight*" sudo apt-get -purge remove "*nvidia*" sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /usr/local/cuda* 2. 1.Uninstalling any cuda/cudnn/nvidia drivers from previous installationsįirst of all I would highly recommend you to do this process on a fresh Ubuntu install, but if you can’t, you can follow these steps to kill and purge any remains of Nvidia software on your Ubuntu. Also this installation was aimed to use they on YoloV4 and worked on it, so the Opencv flags are related to that. Ok first of all, a big DISCLAIMER here, Nvidia sucks as once said Linus Torvalds, and before trying to install Cuda and company, I never knew why, but after some weeks redoing the process trying a lot of versions and meeting a lot of mistakes I found a way to install these three nightmares in a way that worked for me, now this may not work for you for some reason but at least it is one more tutorial following a different path that may solve yours nightmares.
