{"id":13936,"date":"2024-06-05T00:32:48","date_gmt":"2024-06-04T21:32:48","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=13936"},"modified":"2024-06-05T00:32:49","modified_gmt":"2024-06-04T21:32:49","slug":"how-to-install-cuda-on-ubuntu-24-04-noble-numbat","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-cuda-on-ubuntu-24-04-noble-numbat\/","title":{"rendered":"How to Install Cuda on Ubuntu 24.04 Noble Numbat"},"content":{"rendered":"\n
CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model developed by NVIDIA. It allows developers to use NVIDIA GPUs for general-purpose processing. If you’re running Ubuntu 24.04 Noble Numbat and need to leverage CUDA<\/a> for your projects, this guide will help you install and configure it correctly.<\/p>\n\n\n\n Before we start, ensure you have the following:<\/p>\n\n\n\n First, make sure your system is up-to-date by running the following commands:<\/p>\n\n\n\n To use CUDA, you need the appropriate NVIDIA<\/a> drivers. You can install them from the official NVIDIA repository:<\/p>\n\n\n\n After installing CUDA, you need to set up the environment variables. Add the following lines to your Source the To verify the installation, compile and run the sample programs provided with the CUDA toolkit:<\/p>\n\n\n\n Congratulations! You have successfully installed and configured CUDA on Ubuntu 24.04 Noble Numbat. You can now harness the power of your NVIDIA GPU for parallel computing tasks. For more detailed information and advanced usage, refer to the NVIDIA CUDA Toolkit documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model developed by NVIDIA. It allows developers to use NVIDIA GPUs for general-purpose processing. If you’re running Ubuntu…<\/p>\n","protected":false},"author":1,"featured_media":13963,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,24,9,25,28,16,18],"tags":[33,43,146,172,265,280,282,350,412,433,449,471,544,545,591],"yoast_head":"\nPrerequisites<\/h2>\n\n\n\n
\n
Step 1: Update Your System<\/h2>\n\n\n\n
$ sudo apt update\n$ sudo apt upgrade -y<\/code><\/pre>\n\n\n\n
Step 2: Install NVIDIA Drivers<\/h2>\n\n\n\n
\n
$ sudo apt install ubuntu-drivers-common && sudo add-apt-repository ppa:graphics-drivers\/ppa && sudo apt update<\/code><\/li>\n\n\n\n
$ sudo ubuntu-drivers autoinstall<\/code><\/li>\n\n\n\n
$ sudo reboot<\/code><\/li>\n\n\n\n
$ nvidia-smi <\/code>
You should see a table with information about your GPU.<\/li>\n<\/ol>\n\n\n\nStep 3: Install CUDA Toolkit<\/h2>\n\n\n\n
\n
.deb<\/code> file. Alternatively, you can download it via the terminal:
$ wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/12.0.1\/local_installers\/cuda-repo-ubuntu2404-12-0-local_12.0.1-1_amd64.deb<\/code><\/li>\n\n\n\n
$ sudo dpkg -i cuda-repo-ubuntu2404-12-0-local_12.0.1-1_amd64.deb && sudo cp \/var\/cuda-repo-ubuntu2404-12-0-local\/cuda-*-keyring.gpg \/usr\/share\/keyrings\/<\/code><\/li>\n\n\n\n
$ sudo apt update && sudo apt install cuda<\/code><\/li>\n\n\n\n
$ sudo reboot<\/code><\/li>\n<\/ol>\n\n\n\n
Step 4: Set Up Environment Variables<\/h2>\n\n\n\n
~\/.bashrc<\/code> file:<\/p>\n\n\n\n
$ export PATH=\/usr\/local\/cuda-12.0\/bin${PATH:+:${PATH}}\n$ export LD_LIBRARY_PATH=\/usr\/local\/cuda-12.0\/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}<\/code><\/pre>\n\n\n\n
~\/.bashrc<\/code> file to apply the changes:<\/p>\n\n\n\n
$ source ~\/.bashrc<\/code><\/pre>\n\n\n\n
Step 5: Verify the CUDA Installation<\/h2>\n\n\n\n
\n
$ cd \/usr\/local\/cuda-12.0\/samples<\/code><\/li>\n\n\n\n
$ sudo make<\/code><\/li>\n\n\n\n
$ cd bin\/x86_64\/linux\/release .\/deviceQuery <\/code>.
If the installation is successful, you should see output indicating that the program has detected your GPU and displays its properties.<\/li>\n<\/ol>\n\n\n\nConclusion<\/h2>\n\n\n\n