Skip to content

Deployment Overview of PyTorch on Server

Prerequisites and Basic Requirements

Before beginning the installation, ensure the server meets the following requirements:

  • Operating System: Debian or Ubuntu.

  • Privileges: Root access is required for initial system configuration and driver installation.

  • Hardware Requirement: For GPU acceleration, an NVIDIA H100 (specifically [10de:2330] GH100 SXM5 80GB) or similar compatible hardware is recommended to trigger specific kernel optimizations.

  • Network Access: The server must have outbound internet access to download system updates, NVIDIA drivers, CUDA toolkits, and Python packages.

FQDN of the final panel on the hostkey.in domain

Parameter Value
Prefix pytorch
Domain hostkey.in
Full template pytorch{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The following files and directories are created during the installation process:

  • /root/install_script.sh: The primary installation script used to configure drivers and system dependencies.

  • /root/user_credentials: A file containing the generated password for the user account.

  • /home/user/pytorch.sh: A helper script to activate the PyTorch virtual environment.

  • /home/user/venv/: The Python virtual environment directory containing PyTorch and its dependencies.

Application installation process

The application is installed through a two-stage process involving system-level configuration followed by user-level environment setup:

  1. System Configuration: An installation script (install_script.sh) is executed to perform the following actions:

  2. Updates the package repository and upgrades existing packages.

  3. Installs essential utilities such as curl, wget, and sudo.

  4. Detects NVIDIA hardware; if an H100 model is detected, it installs the linux-generic-hwe-22.04 kernel package.

  5. Installs recommended NVIDIA drivers via ubuntu-drivers-common.

  6. Installs the CUDA toolkit by adding the official NVIDIA repository for the specific Ubuntu release version.

  7. Configures environment variables (PATH and LD_LIBRARY_PATH) in the user's .bashrc to ensure CUDA is accessible.

  8. User Environment Setup: A secondary script (pytorch_install.sh) is executed under a dedicated user account:

  9. Creates a Python 3.10 virtual environment (venv).

  10. Installs torch, torchvision, and torchaudio via pip.

  11. Verifies the installation by running a test script to check for CUDA availability.

Access Rights and Security

  • User Account: A non-root user named user is created with a home directory at /home/user.

  • Sudo Privileges: The user account is added to the sudo group to allow administrative tasks when required.

  • Credentials: A random 8-character password is generated during installation and stored in /root/user_credentials.

Databases

No databases are deployed as part of this application configuration.

Docker Containers and Their Deployment

This application does not utilize Docker containers; it is installed directly on the host operating system's runtime environment.

Custom Scripts and Additional Setup

The installation utilizes several scripts to automate complex configurations:

  • install_script.sh: Performs low-level system setup, including driver installation, CUDA configuration, user creation, and Python environment preparation.

  • pytorch_install.sh: Handles the creation of the Python virtual environment and the installation of deep learning libraries.

  • pytorch.sh: A utility script located in /home/user/ used to quickly activate the PyTorch virtual environment by running source venv/bin/activate.

Application Update Instructions

To update the PyTorch environment, follow these steps:

  1. Log in as the user account.

  2. Navigate to the application directory: cd ~/.

  3. Activate the environment: ./pytorch.sh.

  4. Update the packages via pip: pip install --upgrade torch torchvision torchaudio.

Location of configuration files and data

  • Virtual Environment: /home/user/venv

  • User Credentials: /root/user_credentials

  • System CUDA Configuration: /usr/local/cuda

Available ports for connection

No specific network ports are opened by this application as it operates via the command line and local Python execution.

Starting and Stopping the application

The application is managed through the Python virtual environment:

  • To start using PyTorch:

  • Log in as user.

  • Run ./pytorch.sh to enter the environment.

  • To stop/exit the environment:

  • Type deactivate within the active shell.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×