We are going to teach you How to Install and Use CUDA on Debian 11. CUDA is a parallel computing platform and programming model developed by NVIDIA. CUDA enables developers to use the power of GPUs to implement parallel programming and process complex and massive calculations much faster.
Prerequisites
1. A Linux VPS Server with Debian 11 OS
2. Please install the GPGPU computing platform for CUDA, which is provided by NVIDIA.
3. NVIDIA graphics card from CUDA-Enabled
If your computer has an NVIDIA graphics card, install the NVIDIA Graphic Driver to improve graphics performance.
After installation, restart the computer to load the default general driver into the new NVIDIA driver.
vi /etc/apt/sources.list
Then, you should add [non-free] to the main line. Also if contrib is not set, add it, too as the following commands:
deb http://deb.debian.org/debian/ bullseye main contrib non-free
If your card is before the GeForce 600 series or similar products, install [nvidia-legacy-390xx-driver] using the following command:
apt update
apt -y install nvidia-driver firmware-misc-nonfree
Disable the default nouveau driver using the following command:
cat /etc/modprobe.d/nvidia-blacklists-nouveau.conf
update-initramfs -u
Finally, you can reboot the system using the following command:
reboot
Please confirm the installation to view the status of the graphics card. Using the following command:
nvidia-smi
Before starting How to Install CUDA on Debian 11, it is necessary to install NVIDIA Graphics Driver by running the following command. Therefore, it is necessary to perform the following steps in order.
By default, you add the words [contrib non-free] to the following command in the APT source, as in the previous step:
apt -y install nvidia-cuda-toolkit nvidia-cuda-dev
nvcc --version
In the next step, you should verify the installation with a common user to run a sample program using the following command:
git clone https://github.com/zchee/cuda-sample.git
cd ./cuda-sample/1_Utilities/deviceQuery
/cuda-sample/1_Utilities/deviceQuery$ vi Makefile
Now you should change line 37 as follows:
CUDA_PATH?=/usr
You should also change line 192 as follows:
SMS ?= 70
Compile the device query sample using the following command:
/cuda-sample/1_Utilities/deviceQuery$ make
Run the deviceQuery sample using the following command:
/cuda-sample/1_Utilities/deviceQuery$ ./deviceQuery
It should be noted that you should try to run a bandwidth test sample using the following command:
cd ~/cuda-sample/1_Utilities/bandwidthTest
/cuda-sample/1_Utilities/bandwidthTest$ vi Makefile
Again you need to change line 37 as follows:
CUDA_PATH?=/usr
change line 192 as follows:
SMS ?= 70
/cuda-sample/1_Utilities/bandwidthTest$ make /cuda-sample/1_Utilities/bandwidthTest$ ./bandwidthTest
By following the steps outlined in this article, you can easily install and use CUDA on Debian 11 to accelerate your high-performance computing tasks. Leveraging the power of your NVIDIA GPU for general-purpose processing tasks can significantly improve the performance of your applications and allow you to tackle computationally intensive workloads with ease. So, go ahead and harness the power of CUDA on Debian 11 for faster and more efficient computing. If you are also using the Ubuntu operating system, we recommend that you read the article The Ultimate Guide to Installing CUDA on Ubuntu 22.04.
How useful was this post?
Click on a star to rate it!
Average rating 5 / 5. Vote count: 1
No votes so far! Be the first to rate this post.
The world of Linux is vast and diverse, with numerous distributions catering to different preference...
You need packages to install the program in Linux. But the method of preparing these packages is dif...
What is your opinion about this Blog?