<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://serverrental.store/index.php?action=history&amp;feed=atom&amp;title=Setting_Up_NVIDIA_CUDA_on_Linux</id>
	<title>Setting Up NVIDIA CUDA on Linux - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://serverrental.store/index.php?action=history&amp;feed=atom&amp;title=Setting_Up_NVIDIA_CUDA_on_Linux"/>
	<link rel="alternate" type="text/html" href="https://serverrental.store/index.php?title=Setting_Up_NVIDIA_CUDA_on_Linux&amp;action=history"/>
	<updated>2026-04-14T23:04:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://serverrental.store/index.php?title=Setting_Up_NVIDIA_CUDA_on_Linux&amp;diff=5793&amp;oldid=prev</id>
		<title>Admin: New server guide</title>
		<link rel="alternate" type="text/html" href="https://serverrental.store/index.php?title=Setting_Up_NVIDIA_CUDA_on_Linux&amp;diff=5793&amp;oldid=prev"/>
		<updated>2026-04-13T10:01:10Z</updated>

		<summary type="html">&lt;p&gt;New server guide&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Setting Up NVIDIA CUDA on Linux =&lt;br /&gt;
&lt;br /&gt;
This guide provides a comprehensive walkthrough for installing and configuring the NVIDIA CUDA Toolkit on a Linux system. CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model created by NVIDIA. It enables software developers and engineers to use a CUDA-enabled graphics processing unit (GPU) for general purpose processing – an approach known as GPGPU (General-Purpose computing on Graphics Processing Units). This is particularly useful for computationally intensive tasks such as machine learning, deep learning, scientific simulations, and video processing.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before you begin, ensure your system meets the following requirements:&lt;br /&gt;
&lt;br /&gt;
* '''NVIDIA GPU:''' A CUDA-enabled NVIDIA graphics card is essential. You can check compatibility on the [[https://developer.nvidia.com/cuda-gpus|NVIDIA CUDA GPUs]] list.&lt;br /&gt;
* '''Linux Distribution:''' A supported Linux distribution (e.g., Ubuntu, CentOS, Debian, Fedora, RHEL). This guide primarily uses examples for Ubuntu/Debian-based systems, but commands can be adapted for others.&lt;br /&gt;
* '''Root or sudo privileges:''' You will need administrative access to install software and modify system configurations.&lt;br /&gt;
* '''Internet connection:''' To download the CUDA Toolkit and drivers.&lt;br /&gt;
* '''Basic Linux command-line familiarity:''' Understanding of package management, file system navigation, and text editing.&lt;br /&gt;
&lt;br /&gt;
For readily available GPU-accelerated computing, consider exploring options at [https://en.immers.cloud/signup/r/20241007-8310688-334/ Immers Cloud], offering GPU servers starting from $0.23/hr for inference.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Identify Your NVIDIA GPU ==&lt;br /&gt;
&lt;br /&gt;
First, confirm that your NVIDIA GPU is recognized by the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;lspci | grep -i nvidia&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command should output information about your NVIDIA graphics card.&lt;br /&gt;
&lt;br /&gt;
== Step 2: Install NVIDIA Drivers ==&lt;br /&gt;
&lt;br /&gt;
The CUDA Toolkit requires compatible NVIDIA drivers. It's generally recommended to install the drivers *before* the CUDA Toolkit.&lt;br /&gt;
&lt;br /&gt;
'''Option A: Using the Distribution's Package Manager (Recommended for ease of use)'''&lt;br /&gt;
&lt;br /&gt;
For Ubuntu/Debian:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt update&lt;br /&gt;
sudo apt install nvidia-driver-XXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
Replace `XXX` with the recommended driver version for your distribution or GPU. You can often find the recommended version by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ubuntu-drivers devices&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then install the recommended one:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo ubuntu-drivers autoinstall&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For CentOS/RHEL:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo yum update&lt;br /&gt;
sudo yum install epel-release&lt;br /&gt;
sudo yum install xorg-x11-drv-nvidia-XXX&amp;lt;/pre&amp;gt;&lt;br /&gt;
Replace `XXX` with the appropriate version.&lt;br /&gt;
&lt;br /&gt;
After installation, reboot your system:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Option B: Downloading Drivers from NVIDIA (More control, but more complex)'''&lt;br /&gt;
&lt;br /&gt;
1.  Visit the [[https://www.nvidia.com/Download/index.aspx|NVIDIA Driver Downloads]] page.&lt;br /&gt;
2.  Select your GPU model, operating system, and download type (e.g., &amp;quot;Production Branch&amp;quot;).&lt;br /&gt;
3.  Download the `.run` file.&lt;br /&gt;
4.  Before running the installer, you might need to stop your display manager. For example, on Ubuntu:&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo systemctl stop display-manager&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  Navigate to the directory where you downloaded the file and run it with root privileges:&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo sh NVIDIA-Linux-x86_64-XXX.XX.run&amp;lt;/pre&amp;gt;&lt;br /&gt;
    Follow the on-screen prompts.&lt;br /&gt;
6.  Reboot your system:&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3: Verify Driver Installation ==&lt;br /&gt;
&lt;br /&gt;
After rebooting, check if the NVIDIA driver is loaded correctly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nvidia-smi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command should display information about your GPU(s), including the driver version and CUDA version supported by the driver.&lt;br /&gt;
&lt;br /&gt;
If `nvidia-smi` fails, it indicates a problem with the driver installation. Consult the troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
== Step 4: Install the CUDA Toolkit ==&lt;br /&gt;
&lt;br /&gt;
NVIDIA provides several methods for installing the CUDA Toolkit. The most common are using a package manager (deb/rpm) or a runfile installer.&lt;br /&gt;
&lt;br /&gt;
'''Option A: Using the CUDA Repository (Recommended)'''&lt;br /&gt;
&lt;br /&gt;
This method is generally preferred as it integrates well with your system's package manager and simplifies updates.&lt;br /&gt;
&lt;br /&gt;
1.  '''Add the CUDA Repository:'''&lt;br /&gt;
    Visit the [[https://developer.nvidia.com/cuda-downloads|NVIDIA CUDA Downloads]] page. Select your Operating System, Architecture, Distribution, Version, and Installer Type (e.g., `deb (local)` or `rpm (network)`). The page will provide the exact commands.&lt;br /&gt;
&lt;br /&gt;
    For Ubuntu (example using `deb (local)`):&lt;br /&gt;
    &amp;lt;pre&amp;gt;wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb&lt;br /&gt;
    sudo dpkg -i cuda-keyring_1.1-1_all.deb&lt;br /&gt;
    sudo apt-get update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    For CentOS/RHEL (example using `rpm (network)`):&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo rpm --import https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/7fa2af80.pub&lt;br /&gt;
    sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo&lt;br /&gt;
    sudo dnf clean all&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  '''Install the CUDA Toolkit:'''&lt;br /&gt;
    For Ubuntu:&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo apt-get -y install cuda&amp;lt;/pre&amp;gt;&lt;br /&gt;
    This installs the latest CUDA Toolkit and its dependencies. If you need a specific version, you might install `cuda-toolkit-XX-Y` (e.g., `cuda-toolkit-12-2`).&lt;br /&gt;
&lt;br /&gt;
    For CentOS/RHEL:&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo dnf -y install cuda&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.  '''Set Environment Variables:'''&lt;br /&gt;
    Add CUDA to your PATH and LD_LIBRARY_PATH. This is crucial for the system to find CUDA executables and libraries.&lt;br /&gt;
    Add the following lines to your `~/.bashrc` or `~/.zshrc` file:&lt;br /&gt;
    &amp;lt;pre&amp;gt;export PATH=/usr/local/cuda/bin:$PATH&lt;br /&gt;
    export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH&amp;lt;/pre&amp;gt;&lt;br /&gt;
    Then, apply the changes to your current session:&lt;br /&gt;
    &amp;lt;pre&amp;gt;source ~/.bashrc&amp;lt;/pre&amp;gt;&lt;br /&gt;
    (Or `source ~/.zshrc` if you use Zsh)&lt;br /&gt;
&lt;br /&gt;
'''Option B: Using the Runfile Installer'''&lt;br /&gt;
&lt;br /&gt;
1.  Download the CUDA Toolkit runfile (`.run` extension) from the [[https://developer.nvidia.com/cuda-downloads|NVIDIA CUDA Downloads]] page, selecting the appropriate OS and version.&lt;br /&gt;
2.  Make the runfile executable:&lt;br /&gt;
    &amp;lt;pre&amp;gt;chmod +x cuda_XXX.XX_linux.run&amp;lt;/pre&amp;gt;&lt;br /&gt;
3.  Run the installer with root privileges. It's often recommended to *not* install the driver if you've already installed a compatible one.&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo sh cuda_XXX.XX_linux.run&amp;lt;/pre&amp;gt;&lt;br /&gt;
    Follow the on-screen prompts. When asked about installing the driver, choose &amp;quot;no&amp;quot; if you already have one installed and verified.&lt;br /&gt;
4.  Set environment variables as described in Option A, Step 3.&lt;br /&gt;
&lt;br /&gt;
== Step 5: Verify CUDA Toolkit Installation ==&lt;br /&gt;
&lt;br /&gt;
After installing the toolkit and setting environment variables, verify that CUDA is accessible.&lt;br /&gt;
&lt;br /&gt;
1.  '''Check nvcc version:'''&lt;br /&gt;
    The `nvcc` (NVIDIA CUDA Compiler) is the compiler for CUDA.&lt;br /&gt;
    &amp;lt;pre&amp;gt;nvcc --version&amp;lt;/pre&amp;gt;&lt;br /&gt;
    This should display the installed CUDA Toolkit version.&lt;br /&gt;
&lt;br /&gt;
2.  '''Compile and run CUDA Samples:'''&lt;br /&gt;
    CUDA Toolkit typically includes sample applications. These are usually located in `/usr/local/cuda/samples`.&lt;br /&gt;
    First, navigate to the samples directory.&lt;br /&gt;
    &amp;lt;pre&amp;gt;cd /usr/local/cuda/samples&amp;lt;/pre&amp;gt;&lt;br /&gt;
    Then, compile a sample, for example, the deviceQuery sample:&lt;br /&gt;
    &amp;lt;pre&amp;gt;sudo make &amp;amp;amp;&amp;amp;amp; cd bin/x86_64/linux/release/&lt;br /&gt;
    ./deviceQuery&amp;lt;/pre&amp;gt;&lt;br /&gt;
    This utility will list your CUDA-enabled devices and report if they are CUDA-capable. You should see a &amp;quot;Result = PASS&amp;quot; at the end.&lt;br /&gt;
&lt;br /&gt;
    You can also compile and run the `bandwidthTest` sample:&lt;br /&gt;
    &amp;lt;pre&amp;gt;cd ../../../&lt;br /&gt;
    make bandwidthTest &amp;amp;amp;&amp;amp;amp; cd bin/x86_64/linux/release/&lt;br /&gt;
    ./bandwidthTest&amp;lt;/pre&amp;gt;&lt;br /&gt;
    This tests memory bandwidth between the host and device. It should also report &amp;quot;Result = PASS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
*   '''`nvidia-smi` command not found or fails:'''&lt;br /&gt;
    *   Ensure the NVIDIA driver is correctly installed and loaded. Rebooting often helps.&lt;br /&gt;
    *   Check if `/usr/bin/nvidia-smi` or a similar path exists.&lt;br /&gt;
    *   Verify that the `nvidia` kernel module is loaded: &amp;lt;pre&amp;gt;lsmod | grep nvidia&amp;lt;/pre&amp;gt;&lt;br /&gt;
*   '''`nvcc: command not found` or CUDA samples don't compile:'''&lt;br /&gt;
    *   Ensure the CUDA environment variables (`PATH` and `LD_LIBRARY_PATH`) are correctly set in your `~/.bashrc` or `~/.zshrc` and that you've sourced the file (`source ~/.bashrc`).&lt;br /&gt;
    *   Check if `/usr/local/cuda/bin/nvcc` exists.&lt;br /&gt;
    *   Verify that the CUDA Toolkit was installed correctly. Reinstall if necessary.&lt;br /&gt;
*   '''Driver/Toolkit Version Mismatch:'''&lt;br /&gt;
    *   The `nvidia-smi` output shows the maximum CUDA version supported by the driver. The CUDA Toolkit version you install should be less than or equal to this supported version. If you install a newer CUDA Toolkit than your driver supports, you might encounter issues. You may need to update your NVIDIA driver or install an older CUDA Toolkit.&lt;br /&gt;
*   '''Secure Boot Issues:'''&lt;br /&gt;
    *   If you have Secure Boot enabled on your system, you might need to sign the NVIDIA kernel modules. This is often handled during driver installation, but if not, you might need to manually sign them or disable Secure Boot.&lt;br /&gt;
&lt;br /&gt;
== Related Articles ==&lt;br /&gt;
&lt;br /&gt;
*   [[NVIDIA Driver Installation]]&lt;br /&gt;
*   [[Introduction to Machine Learning]]&lt;br /&gt;
*   [[GPU Computing]]&lt;br /&gt;
&lt;br /&gt;
For powerful GPU servers that simplify deployment, explore options at [https://en.immers.cloud/signup/r/20241007-8310688-334/ Immers Cloud].&lt;br /&gt;
&lt;br /&gt;
[[Category:AI and GPU]]&lt;br /&gt;
[[Category:System Administration]]&lt;br /&gt;
[[Category:NVIDIA]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>