Deep learning has revolutionized industries like healthcare, finance, and gaming by enabling the creation of highly sophisticated models capable of performing complex tasks. These models, however, require immense computational power, and GPUs (Graphics Processing Units) play a critical role in accelerating this process. Atlantic.Net’s GPU dedicated servers offer a high-performance GPU infrastructure, making it an ideal platform for deep learning projects.

This guide will walk you through the entire process of setting up a deep learning environment on an Atlantic.Net GPU Server.

Prerequisites

  • An Ubuntu 22.04 GPU Server
  • CUDA Toolkit and cuDNN Installed
  • A root or sudo privileges

Verify NVIDIA GPU

The first step in any GPU-accelerated setup is ensuring that your system detects the GPU. Atlantic.Net GPU server instances come pre-configured with GPU hardware, but verifying its availability is crucial.

lspci | grep -i nvidia

Output.

00:1e.0 3D controller: NVIDIA Corporation GP102 [Tesla P40] (rev a1)

If no GPU is detected, ensure that your server is configured with GPU support.

Install Anaconda

Anaconda is a powerful tool for managing Python environments and packages, which is especially useful in deep learning projects where dependency management is critical.

Visit the official Anaconda Archives Directory to find the latest installer. For this guide, we’ll use a specific version.

wget https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-x86_64.sh

Execute the downloaded script:

bash Anaconda3-2024.10-1-Linux-x86_64.sh

You will be asked the following:

  • Accept the license agreement by typing yes.
  • Confirm the installation directory (default is typically /home/your-username/anaconda3).
  • Allow the installer to initialize Anaconda.

Reload your .bashrc file to enable Anaconda.

source ~/.bashrc

Confirm that Anaconda is correctly installed by checking its version.

conda --version

Output.

conda 24.9.2

Set Up Your Deep Learning Environment

Creating an isolated environment for deep learning ensures that dependencies and libraries do not conflict with other projects.

Create a new conda environment.

conda create -n deep_learning python=3.9

Activate the environment.

conda activate deep_learning

Your terminal prompt should now include (deep_learning), indicating the environment is active.

Install TensorFlow and PyTorch with GPU Support

Leveraging GPU acceleration with TensorFlow and PyTorch drastically improves the speed of training deep learning models.

Install TensorFlow using conda.

conda install -c conda-forge tensorflow

Install the NVIDIA CUDA Toolkit for the Anaconda environment.

conda install -c "nvidia/label/cuda-12.4.1" cuda 

Install PyTorch and libraries.

pip install torch torchvision torchaudio --pre -f https://download.pytorch.org/whl/nightly/cu124/torch_nightly.html

This installs the nightly version of PyTorch optimized for CUDA 12.4.

Install additional libraries.

conda install numpy pandas matplotlib

These libraries are useful for:

  • Data manipulation (numpy, pandas).
  • Visualization (matplotlib).

Test Your Installation

Now, you will need to ensures that TensorFlow, PyTorch, and GPU acceleration are working as expected.

Start Python using the following command.

python3

In the Python shell, import both tensorflow and torch library.

>>> import tensorflow as tf
>>> import torch

Check the TensorFlow version.

>>> print("TensorFlow version:", tf.__version__)

Output.

TensorFlow version: 2.17.0

Verify the PyTorch version.

>>> print("PyTorch version:", torch.__version__)

Output.

PyTorch version: 2.5.1+cu124

Press CTRL+D to exit from the Python shell.

Check if TensorFlow detects the GPU.

python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

Expected output:

[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

Conclusion

Congratulations! You have successfully set up a deep learning environment on an Atlantic.Net GPU server. With TensorFlow and PyTorch configured to leverage GPU acceleration, you can now train and deploy complex models efficiently.

Atlantic.Net GPU Server Hosting provides a robust platform for AI and deep learning, empowering you to focus on innovation without worrying about hardware limitations.