Updates
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
# Installing Webmin and Docker on Ubuntu
|
||||
|
||||
This guide walks you through installing Webmin on Ubuntu and expanding logical volumes via Webmin’s interface. Additionally, it covers Docker installation on Ubuntu.
|
||||
|
||||
---
|
||||
|
||||
## Part 1: Installing Webmin on Ubuntu
|
||||
|
||||
Webmin is a web-based interface for managing Unix-like systems, making tasks such as user management, server configuration, and software installation easier.
|
||||
|
||||
### Step 1: Update Your System
|
||||
|
||||
Before installing Webmin, update your system to ensure all packages are up to date.
|
||||
|
||||
```bash
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
### Step 2: Add the Webmin Repository and Key
|
||||
|
||||
To add the Webmin repository, download and run the setup script.
|
||||
|
||||
```bash
|
||||
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
|
||||
sudo sh setup-repos.sh
|
||||
```
|
||||
|
||||
### Step 3: Install Webmin
|
||||
|
||||
With the repository set up, install Webmin:
|
||||
|
||||
```bash
|
||||
sudo apt-get install webmin --install-recommends
|
||||
```
|
||||
|
||||
### Step 4: Access Webmin
|
||||
|
||||
Once installed, Webmin runs on port 10000. You can access it by opening a browser and navigating to:
|
||||
|
||||
```
|
||||
https://<your-server-ip>:10000
|
||||
```
|
||||
|
||||
If you are using a firewall, allow traffic on port 10000:
|
||||
|
||||
```bash
|
||||
sudo ufw allow 10000
|
||||
```
|
||||
|
||||
You can now log in to Webmin using your system's root credentials.
|
||||
|
||||
---
|
||||
|
||||
## Part 2: Expanding a Logical Volume Using Webmin
|
||||
|
||||
Expanding a logical volume through Webmin’s Logical Volume Management (LVM) interface is a simple process.
|
||||
|
||||
### Step 1: Access Logical Volume Management
|
||||
|
||||
Log in to Webmin and navigate to:
|
||||
|
||||
**Hardware > Logical Volume Management**
|
||||
|
||||
Here, you can manage physical volumes, volume groups, and logical volumes.
|
||||
|
||||
### Step 2: Add a New Physical Volume
|
||||
|
||||
If you've added a new disk or partition to your system, you need to allocate it to a volume group before expanding the logical volume. To do this:
|
||||
1. Locate your volume group in the Logical Volume Management module.
|
||||
2. Click **Add Physical Volume**.
|
||||
3. Select the new partition or RAID device and click **Add to volume group**. This action increases the available space in the group.
|
||||
|
||||
### Step 3: Resize the Logical Volume
|
||||
|
||||
To extend a logical volume:
|
||||
1. In the **Logical Volumes** section, locate the logical volume you wish to extend.
|
||||
2. Select **Resize**.
|
||||
3. Specify the additional space or use all available free space in the volume group.
|
||||
4. Click **Apply** to resize the logical volume.
|
||||
|
||||
### Step 4: Resize the Filesystem
|
||||
|
||||
After resizing the logical volume, expand the filesystem to match:
|
||||
1. Click on the logical volume to view its details.
|
||||
2. For supported filesystems like ext2, ext3, or ext4, click **Resize Filesystem**. The filesystem will automatically adjust to the new size of the logical volume.
|
||||
|
||||
---
|
||||
|
||||
## Part 3: Installing Docker on Ubuntu
|
||||
|
||||
This section covers installing Docker on Ubuntu.
|
||||
|
||||
### Step 1: Remove Older Versions
|
||||
|
||||
If you have previous versions of Docker installed, remove them:
|
||||
|
||||
```bash
|
||||
sudo apt remove docker docker-engine docker.io containerd runc
|
||||
```
|
||||
|
||||
### Step 2: Add Docker's Official GPG Key and Repository
|
||||
|
||||
Add Docker’s GPG key and repository to your system’s Apt sources:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
sudo apt-get update
|
||||
```
|
||||
|
||||
### Step 3: Install Docker
|
||||
|
||||
Now, install Docker:
|
||||
|
||||
```bash
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
```
|
||||
|
||||
### Step 4: Post-Installation Steps
|
||||
|
||||
To allow your user to run Docker commands without `sudo`, add your user to the Docker group:
|
||||
|
||||
```bash
|
||||
sudo usermod -aG docker $USER
|
||||
newgrp docker
|
||||
```
|
||||
|
||||
Test your Docker installation by running the following command:
|
||||
|
||||
```bash
|
||||
docker run hello-world
|
||||
```
|
||||
|
||||
For more information, visit the official [Docker installation page](https://docs.docker.com/engine/install/ubuntu/).
|
||||
182
AIServerSetup/01-Ubuntu Server Setup/02-NvidiaDriversSetup.md
Normal file
182
AIServerSetup/01-Ubuntu Server Setup/02-NvidiaDriversSetup.md
Normal file
@@ -0,0 +1,182 @@
|
||||
# How to Install the Latest Version of NVIDIA CUDA on Ubuntu 22.04 LTS
|
||||
|
||||
If you’re looking to unlock the power of your NVIDIA GPU for scientific computing, machine learning, or other parallel workloads, CUDA is essential. Follow this step-by-step guide to install the latest CUDA release on Ubuntu 22.04 LTS.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before proceeding with installing CUDA, ensure your system meets the following requirements:
|
||||
|
||||
- **Ubuntu 22.04 LTS** – This version is highly recommended for stability and compatibility.
|
||||
- **NVIDIA GPU + Drivers** – CUDA requires having an NVIDIA GPU along with proprietary Nvidia drivers installed.
|
||||
|
||||
To check for an NVIDIA GPU, open a terminal and run:
|
||||
```bash
|
||||
lspci | grep -i NVIDIA
|
||||
```
|
||||
If an NVIDIA GPU is present, it will be listed. If not, consult NVIDIA’s documentation on installing the latest display drivers.
|
||||
|
||||
## Step 1: Install Latest NVIDIA Drivers
|
||||
|
||||
Install the latest NVIDIA drivers matched to your GPU model and CUDA version using Ubuntu’s built-in Additional Drivers utility:
|
||||
|
||||
1. Open **Settings -> Software & Updates -> Additional Drivers**
|
||||
2. Select the recommended driver under the NVIDIA heading
|
||||
3. Click **Apply Changes** and **Reboot**
|
||||
|
||||
Verify the driver installation by running:
|
||||
```bash
|
||||
nvidia-smi
|
||||
```
|
||||
This should print details on your NVIDIA GPU and driver version.
|
||||
|
||||
## Step 2: Add the CUDA Repository
|
||||
|
||||
Add NVIDIA’s official repository to your system to install CUDA:
|
||||
|
||||
1. Visit NVIDIA’s CUDA Download Page and select "Linux", "x86_64", "Ubuntu", "22.04", "deb(network)"
|
||||
2. Copy the repository installation commands for Ubuntu 22.04:
|
||||
```bash
|
||||
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
|
||||
sudo dpkg -i cuda-keyring_1.1-1_all.deb
|
||||
sudo apt-get update
|
||||
```
|
||||
Run these commands to download repository metadata and add the apt source.
|
||||
|
||||
## Step 3: Install CUDA Toolkit
|
||||
|
||||
Install CUDA using apt:
|
||||
```bash
|
||||
sudo apt-get -y install cuda
|
||||
```
|
||||
Press **Y** to proceed and allow the latest supported version of the CUDA toolkit to install.
|
||||
|
||||
## Step 4: Configure Environment Variables
|
||||
|
||||
Update environment variables to recognize the CUDA compiler, tools, and libraries:
|
||||
|
||||
Open `/etc/profile.d/cuda.sh` and add the following configuration:
|
||||
```bash
|
||||
export PATH=/usr/local/cuda/bin:$PATH
|
||||
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
|
||||
```
|
||||
Save changes and refresh environment variables:
|
||||
```bash
|
||||
source /etc/profile.d/cuda.sh
|
||||
```
|
||||
Alternatively, reboot to load the updated environment variables.
|
||||
|
||||
## Step 5: Verify Installation
|
||||
|
||||
Validate the installation:
|
||||
|
||||
1. Check the `nvcc` compiler version:
|
||||
```bash
|
||||
nvcc --version
|
||||
```
|
||||
This should display details on the CUDA compile driver, including the installed version.
|
||||
|
||||
2. Verify GPU details with NVIDIA SMI:
|
||||
```bash
|
||||
nvidia-smi
|
||||
```
|
||||
|
||||
# Optional: Setting Up cuDNN with CUDA: A Comprehensive Guide
|
||||
|
||||
This guide will walk you through downloading cuDNN from NVIDIA's official site, extracting it, copying the necessary files to the CUDA directory, and setting up environment variables for CUDA.
|
||||
|
||||
## Step 1: Download cuDNN
|
||||
|
||||
1. **Visit the NVIDIA cuDNN Archive**:
|
||||
Navigate to the [NVIDIA cuDNN Archive](https://developer.nvidia.com/rdp/cudnn-archive).
|
||||
|
||||
2. **Select the Version**:
|
||||
Choose the appropriate version of cuDNN compatible with your CUDA version. For this guide, we'll assume you are downloading `cudnn-linux-x86_64-8.9.7.29_cuda12-archive`.
|
||||
|
||||
3. **Download the Archive**:
|
||||
Download the `tar.xz` file to your local machine.
|
||||
|
||||
## Step 2: Extract cuDNN
|
||||
|
||||
1. **Navigate to the Download Directory**:
|
||||
Open a terminal and navigate to the directory where the archive was downloaded.
|
||||
|
||||
```bash
|
||||
cd ~/Downloads
|
||||
```
|
||||
|
||||
2. **Extract the Archive**:
|
||||
Use the `tar` command to extract the contents of the archive.
|
||||
|
||||
```bash
|
||||
tar -xvf cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
|
||||
```
|
||||
|
||||
This will create a directory named `cudnn-linux-x86_64-8.9.7.29_cuda12-archive`.
|
||||
|
||||
## Step 3: Copy cuDNN Files to CUDA Directory
|
||||
|
||||
1. **Navigate to the Extracted Directory**:
|
||||
Move into the directory containing the extracted cuDNN files.
|
||||
|
||||
```bash
|
||||
cd cudnn-linux-x86_64-8.9.7.29_cuda12-archive
|
||||
```
|
||||
|
||||
2. **Copy Header Files**:
|
||||
Copy the header files to the CUDA include directory.
|
||||
|
||||
```bash
|
||||
sudo cp include/cudnn*.h /usr/local/cuda-12.5/include/
|
||||
```
|
||||
|
||||
3. **Copy Library Files**:
|
||||
Copy the library files to the CUDA lib64 directory.
|
||||
|
||||
```bash
|
||||
sudo cp lib/libcudnn* /usr/local/cuda-12.5/lib64/
|
||||
```
|
||||
|
||||
4. **Set Correct Permissions**:
|
||||
Ensure the copied files have the appropriate permissions.
|
||||
|
||||
```bash
|
||||
sudo chmod a+r /usr/local/cuda-12.5/include/cudnn*.h /usr/local/cuda-12.5/lib64/libcudnn*
|
||||
```
|
||||
|
||||
## Step 4: Set Up Environment Variables
|
||||
|
||||
1. **Open Your Shell Profile**:
|
||||
Open your `.bashrc` or `.bash_profile` file in a text editor.
|
||||
|
||||
```bash
|
||||
nano ~/.bashrc
|
||||
```
|
||||
|
||||
2. **Add CUDA to PATH and LD_LIBRARY_PATH**:
|
||||
Add the following lines to set the environment variables for CUDA. This example assumes CUDA 12.5.
|
||||
|
||||
```bash
|
||||
export PATH=/usr/local/cuda-12.5/bin:$PATH
|
||||
export LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64:$LD_LIBRARY_PATH
|
||||
```
|
||||
|
||||
3. **Apply the Changes**:
|
||||
Source the file to apply the changes immediately.
|
||||
|
||||
```bash
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
1. **Check CUDA Installation**:
|
||||
Verify that CUDA is correctly set up by running:
|
||||
|
||||
```bash
|
||||
nvcc --version
|
||||
```
|
||||
|
||||
2. **Check cuDNN Installation**:
|
||||
Optionally, you can compile and run a sample program to ensure cuDNN is working correctly.
|
||||
|
||||
By following these steps, you will have downloaded and installed cuDNN, integrated it into your CUDA setup, and configured your environment variables for smooth operation. This ensures that applications requiring both CUDA and cuDNN can run without issues.
|
||||
@@ -0,0 +1,85 @@
|
||||
# OPTIONAL: Setting NVIDIA GPU Power Limit at System Startup
|
||||
|
||||
## Overview
|
||||
|
||||
This guide explains how to set the power limit for NVIDIA GPUs at system startup using a systemd service. This ensures the power limit setting is persistent across reboots.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Create and Configure the Service File
|
||||
|
||||
1. Open a terminal and create a new systemd service file:
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/nvidia-power-limit.service
|
||||
```
|
||||
|
||||
2. Add the following content to the file, replacing `270` with the desired power limit (e.g., 270 watts for your GPUs):
|
||||
|
||||
- For Dual GPU Setup:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Set NVIDIA GPU Power Limit
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/nvidia-smi -i 0 -pl 270
|
||||
ExecStart=/usr/bin/nvidia-smi -i 1 -pl 270
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
- For Quad GPU Setup:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Set NVIDIA GPU Power Limit
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/nvidia-smi -i 0 -pl 270
|
||||
ExecStart=/usr/bin/nvidia-smi -i 1 -pl 270
|
||||
ExecStart=/usr/bin/nvidia-smi -i 2 -pl 270
|
||||
ExecStart=/usr/bin/nvidia-smi -i 3 -pl 270
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Save and close the file.
|
||||
|
||||
### 2. Apply and Enable the Service
|
||||
|
||||
1. Reload the systemd manager configuration:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
2. Enable the service to ensure it runs at startup:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable nvidia-power-limit.service
|
||||
```
|
||||
|
||||
### 3. (Optional) Start the Service Immediately
|
||||
|
||||
To apply the power limit immediately without rebooting:
|
||||
|
||||
```bash
|
||||
sudo systemctl start nvidia-power-limit.service
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
Check the power limits using `nvidia-smi`:
|
||||
|
||||
```bash
|
||||
nvidia-smi -q -d POWER
|
||||
```
|
||||
|
||||
Look for the "Power Management" section to verify the new power limits.
|
||||
|
||||
By following this guide, you can ensure that your NVIDIA GPUs have a power limit set at every system startup, providing consistent and controlled power usage for your GPUs.
|
||||
Reference in New Issue
Block a user