Skip to content

moj4code/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated NVIDIA GPU Driver and Container Toolkit Installation for Ubuntu . ############################################################################

Bash script that automates the installation of the NVIDIA GPU driver, CUDA toolkit, and NVIDIA container toolkit

Enhanced Version Control and User Flexibility

Fallback Mechanism The script incorporates a safety net by defaulting to proven, stable versions (specifically 12.8.1 and 570.124.06) which were the most recent releases at the time of the script's creation.

User Customization To accommodate individual preferences, the script allows users to specify their desired versions, overriding the pre-set defaults if needed.

Immediate Environment Updates For improved usability, the script exports relevant variables directly to the current shell environment. This enables instant functionality of tools like nvidia-smi without the need to start a new login session.

Copy the script below and Save vi <script_name>.sh

Make it executable chmod +x <script_name>.sh

Run the script sudo ./<script_name>.sh

Herein is the script The script has been updated to handle different Ubuntu versions (20.04, 22.04, and 24.04) with their specific GCC requirements. The key improvements: Ubuntu Version Detection: The script now detects the Ubuntu version and sets appropriate compiler settings.

GCC Version Handling:

Ubuntu 24.04: Uses GCC 13.2.0

Ubuntu 22.04: Uses GCC 12.3.0

Ubuntu 20.04: Uses GCC 9.4.0

Compiler Configuration:

Installs the correct GCC version packages for each Ubuntu release

Uses update-alternatives to set the appropriate compiler as default

Installs the required libstdc++ development packages

Installation Adjustments:

Uses --override flag for newer Ubuntu versions when running the CUDA installer

Adds specific CUDA installation parameters for compatibility with different GCC versions

Docker Testing:

Uses the appropriate CUDA Docker image for each Ubuntu version when testing

Improved Environment Configuration:

Better LD_LIBRARY_PATH configuration by creating a .conf file for ldconfig

Enhanced output with more system information for easier troubleshooting

This script now properly identifies the Ubuntu version and adjusts the installation process to ensure compatibility with the specific GCC version requirements for each release.

Cross-Platform NVIDIA GPU & Container Toolkit Installation Script (Ubuntu & RedHat). ###############################################################################################################################

Key Features Retained from Working Script: Ubuntu-specific GCC version management (13 for 24.04, 12 for 22.04, 9 for 20.04)

Complete environment persistence - adds CUDA paths to all user .bashrc files

Ubuntu version-specific CUDA installation parameters

Boot-time driver configuration for automatic loading

Comprehensive error checking at each step

New Multi-OS Support: Automatic OS detection and family classification

Package manager abstraction (apt/dnf/yum)

OS-specific repository configuration for NVIDIA Container Toolkit

Appropriate Docker test images for different OS families

RHEL/CentOS specific configurations (EPEL repository, different package names)

Critical Improvements: Preserves Ubuntu optimizations - does not sacrifice the working Ubuntu logic

Proper GCC handling - only applies Ubuntu-specific GCC management to Ubuntu systems

Enhanced user environment setup - ensures persistence across reboots for all users

OS-aware Docker testing - uses appropriate container images for each OS

Better error handling - maintains the robust error checking from the original

This script is designed to work reliably across both tested Ubuntu environments and newly supported RHEL-based systems. It preserves the stable, production-tested functionality from Ubuntu script while introducing proper multi-OS compatibility.

Nouveau Driver Conflicts Automatic Resolution for Cross-Platform NVIDIA GPU and Container Toolkit Installer.... ################################################################################################################################################# Installing NVIDIA GPU drivers and the container toolkit on Linux can often be a challenge, especially when the open-source Nouveau driver interferes. Since Nouveau and NVIDIA's proprietary drivers are incompatible, having Nouveau enabled can lead to installation failures, broken CUDA functionality, or an unresponsive GPU .

Multi-Distribution Docker Installer with Compose Plugin and Standalone Support ###################################################################################################################################################

This is a cross-platform Bash script designed to automate the installation of Docker, Docker Compose, and related components on both Debian-based systems (e.g., Ubuntu, Debian) and Red Hat-based systems (e.g., CentOS, RHEL, Fedora).

==> The script installs:

Docker Engine

Containerd

Docker Compose (both as a plugin and as a standalone binary at /usr/local/bin/docker-compose)

Docker CLI

Docker Buildx

It also ensures that Docker services are started and enabled, and adds the current user to the docker group to allow non-root access to Docker commands.

==> Follow this Steps: Copy and paste the script below into a file and execute it.

Save the script to a file, e.g., install_docker.sh.

vi <file_name>.sh Make it executable: chmod +x install_docker.sh.

chmod +x <file_name>.sh Run it with sudo: sudo ./install_docker.sh.

./<file_name>.sh

About

installations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages