From ee8d1af0274beaf0f99e494c536ff4c41a6d1a76 Mon Sep 17 00:00:00 2001 From: Admin9705 <24727006+Admin9705@users.noreply.github.com> Date: Sun, 11 Aug 2024 11:22:56 -0400 Subject: [PATCH] Update README.md --- README.md | 179 ++++++++++++++++++++---------------------------------- 1 file changed, 65 insertions(+), 114 deletions(-) diff --git a/README.md b/README.md index b67a731..e34e3b0 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,54 @@ -# AV1 Flow + Enable Intel ARC + Tdarr Node Killer - Script Guide +# AV1 | Tdarr Setup and/or Node Killer (Optional) | Unraid Plugin - Guide ## Purpose -This guide aims to help users optimize their media libraries by using AV1 encoding and efficiently managing GPU resources between Plex and Tdarr. The AV1 Flow provides a highly efficient way to compress video files, saving significant storage space, while the Tdarr Node Killer Script ensures that your Intel ARC GPU is dedicated to Plex when needed, without interrupting other processes. - -### What You Will Accomplish - -- **AV1 Encoding**: Learn how to use AV1 encoding to significantly reduce the size of your video files, freeing up storage space while maintaining video quality. -- **Efficient GPU Management**: Implement a script that automatically manages your GPU resources, ensuring that Plex has dedicated access to your Intel ARC GPU when it needs to transcode video, without interrupting Tdarr's video processing tasks. -- **Optimized Media Library**: By following this guide, you will be able to compress a large media library, potentially reducing a 300TB library to 75-100TB, making it easier to manage and store. - -### Why This Is Helpful - -For users with large media libraries, storage space can quickly become an issue. The AV1 Flow provides an effective solution by drastically reducing the size of your video files. Additionally, the Tdarr Node Killer Script ensures that your Intel ARC GPU is used efficiently, preventing conflicts between Plex and Tdarr and ensuring that Plex users experience smooth, uninterrupted playback. +This guide is designed to help users optimize their media libraries using AV1 encoding while efficiently managing GPU resources between Plex and Tdarr. By following this guide, you will learn how to reduce video file sizes, freeing up significant storage space, and how to automate GPU resource allocation to ensure Plex users experience smooth playback without interference from Tdarr processes. --- -## AV1 Encoding Flow (Compatible with Intel ARC GPUs) +## Table of Contents + +- [Upgrading to Unraid 7.0 and Installing Required Plugins](#upgrading-to-unraid-70-and-installing-required-plugins) + - [Installing Intel GPU TOP Plugin](#installing-intel-gpu-top-plugin) + - [Installing GPU Statistics Plugin](#installing-gpu-statistics-plugin) +- [AV1 Tdarr Flow](#av1-tdarr-flow) +- [Tdarr Node Killer Script](#tdarr-node-killer-script) +- [Experimental: Running the Script on Other Operating Systems](#experimental-running-the-script-on-other-operating-systems) + +--- + +## Upgrading to Unraid 7.0 and Installing Required Plugins + +Before setting up the AV1 Tdarr Flow or the Tdarr Node Killer Script, ensure that you are running Unraid 7.0 and have the necessary plugins installed to monitor and manage your Intel ARC GPU. + +### Installing Intel GPU TOP Plugin + +The first plugin to install is the **Intel GPU TOP** by ich777. This plugin is essential for monitoring your Intel ARC GPU’s performance. + +- **Plugin Developer**: ich777 +- **Installation**: Available through the Unraid Community Applications +- **GitHub Repository**: [Intel GPU TOP by ich777](https://github.com/ich777) + +![Intel GPU TOP Plugin](https://i.imgur.com/0bHRqya.png) + +### Installing GPU Statistics Plugin + +Next, install the **GPU Statistics** plugin by b3rs3rk. This plugin provides detailed statistics on GPU usage, helping you verify that your Intel ARC GPU is working correctly. + +- **Plugin Developer**: b3rs3rk +- **Installation**: Available through the Unraid Community Applications + +![GPU Statistics Plugin](https://i.imgur.com/lJZgPvC.png) + +With these plugins installed, you can monitor your Intel ARC GPU during transcoding and other tasks. Below are examples of what you can expect to see when your Intel ARC GPU is in use: + +![GPU in Use Example 1](https://i.imgur.com/toOvgvN.png) + +![GPU in Use Example 2](https://i.imgur.com/jDbrB5a.png) + +--- + +## AV1 Tdarr Flow ![AV1 Flow](https://i.imgur.com/FiFVxgT.png) @@ -31,26 +63,6 @@ The AV1 encoding flow is a process that converts video data into the AV1 format, **Note:** This flow should work on any operating system that has an Intel ARC GPU card. You just need to ensure that the ARC GPU is exposed in your Tdarr Docker container. ---- - -## Tdarr Node Killer Script Overview (Designed for Unraid, Works on Any OS) - -This section explains how the Tdarr Node Killer Script works to manage your GPU resources, ensuring that Plex can have dedicated access when needed. - -**Note:** While this script is designed to work seamlessly on Unraid, it can technically work on any operating system as long as you create a service. An experimental service script for Ubuntu is provided at the end of this guide. - -### Prerequisites for Unraid - -Before adding the Tdarr Node Killer Script, ensure that you have installed the [User Scripts] plugin by Andrew. This plugin is essential for running scripts on Unraid. - -![User Scripts Plugin](https://i.imgur.com/JA90q6x.png) - -Once the plugin is installed, set the script to run at "First Array Start Only." This setting ensures that the script starts with the array and continues to run. If it's determined that the script stops when the array is stopped, adjust it to "Start of Array Every Time." - -![Set Script at First Array Start](https://i.imgur.com/MpG4lP8.png) - -**Note:** Ignore the other two nodes in the photos. The selected node is dedicated to Plex. The purpose of this setup is to ensure that the GPU is put to work without disrupting Plex users. There are two ARC 380 GPUs (one dedicated to Plex) and one ARC 310 GPU. The ARC 380 GPUs can handle up to 7 streams each for Tdarr, while the ARC 310 handles up to 5 streams at a time. - ### Setting Up the Tdarr Node Docker Container in Unraid To ensure your Tdarr node is properly configured in Unraid, follow these steps: @@ -78,91 +90,22 @@ By following these steps, you’ll deploy a proper Tdarr node container, ensurin --- -## Tdarr Node Killer Script Behavior +## Tdarr Node Killer Script -### Step 1: Tdarr Node Running, No Plex Transcoding +### Overview -![Tdarr Node Running, No Plex Transcoding](https://i.imgur.com/PHRITk0.png) +The Tdarr Node Killer Script is designed to manage your GPU resources between Plex and Tdarr efficiently. It ensures that when Plex starts transcoding, the Tdarr node using the same GPU is automatically stopped, preventing any conflicts. -**Explanation**: The Tdarr node is running, and Plex is not currently transcoding any videos. This means Tdarr is using the GPU resources for video processing tasks. +### Script Behavior -### Step 2: Script Monitoring for Plex Transcoding +1. **Monitoring Plex**: The script continuously monitors Plex for any transcoding activity. When Plex starts transcoding, the script kills the Tdarr node using the same GPU. +2. **Five-Minute Check Cycle**: After stopping the Tdarr node, the script checks every 5 seconds for 5 minutes to see if Plex has finished transcoding. + - If no transcoding is detected during this time, the Tdarr node is restarted. + - If transcoding is detected at any point, the timer resets, and the script continues monitoring. -![Script Monitoring, No Transcoding Detected](https://i.imgur.com/tveaVA5.png) +This setup allows you to put the GPU back to work when Plex is idle, while ensuring Plex users always get priority when transcoding is required. -**Explanation**: The script continuously checks if Plex is transcoding. At this point, no transcoding is detected, so Tdarr continues using the GPU. - -### Step 3: Plex User Starts Transcoding - -![Plex User Starts Transcoding](https://i.imgur.com/AT6hCUV.png) - -**Explanation**: A Plex user starts watching a video, causing Plex to begin transcoding. This might happen if the video is in a format like AV1, H.264, or H.265, which requires transcoding for older devices or specific user settings. - -### Step 4: Script Detects Plex Transcoding, Stops Tdarr Node - -![Script Detects Plex Transcoding, Stops Tdarr Node](https://i.imgur.com/iwob8yB.png) - -**Explanation**: The script detects that Plex is transcoding and stops the Tdarr node. This action frees up the Intel ARC GPU so that Plex can use it exclusively for transcoding. - -### Step 5: Tdarr Node Is Stopped - -![Tdarr Node Stopped](https://i.imgur.com/KzdXHKf.png) - -**Explanation**: Inside Tdarr, you can see that the node has been stopped by the script. This ensures that Plex has full access to the GPU for efficient transcoding. - -### Step 6: Tdarr Node Dead - -![Tdarr Node Dead](https://i.imgur.com/4gIzOkW.png) - -**Explanation**: The Tdarr node is completely stopped, ensuring that Plex has exclusive access to the GPU. - ---- - -## Script Behavior After Plex Transcoding Stops - -The script doesn't immediately restart the Tdarr node after Plex stops transcoding. Instead, it checks every 5 seconds for 5 minutes to ensure that Plex isn't going to start transcoding again. This prevents the Tdarr node from constantly stopping and starting, which could be inefficient. - -### Step 7: Countdown Before Restarting Tdarr Node - -![Countdown Before Restarting Tdarr Node](https://i.imgur.com/59AGRlv.png) - -**Explanation**: The script is counting down, checking every 5 seconds to see if Plex starts transcoding again. If Plex does start, the timer resets, ensuring that the Tdarr node stays off as long as Plex needs the GPU. - -### Step 8: Tdarr Node Restarted After 5 Minutes - -![Tdarr Node Restarted](https://i.imgur.com/ExHsAQI.png) - -**Explanation**: After 5 minutes with no Plex transcoding detected, the script restarts the Tdarr node. The process then continues to check if Plex starts transcoding, so the node can be stopped again if needed. - -### Step 9: Tdarr Node Coming Back Online - -![Tdarr Node Coming Back Online](https://i.imgur.com/TTPVyt0.png) - -**Explanation**: Inside Tdarr, you can see that the node is coming back online after being restarted by the script. - -### Step 10: Tdarr Node Fully Online - -![Tdarr Node Fully Online](https://i.imgur.com/M1M2vSL.png) - -**Explanation**: The Tdarr node is now fully operational and visible on the dashboard. The script will continue to monitor Plex and manage the node as needed. - ---- - -## Data Savings with AV1 Encoding - -Running this setup with three ARC GPUs has shown significant data savings over two weeks. With AV1 encoding, a savings of 37TB was achieved, covering only 10-15% of the library. - -![Data Savings](https://i.imgur.com/Saic5J4.png) - -**Explanation**: AV1 encoding can drastically reduce storage needs. For example, a 300TB library could be reduced to 75-100TB, making it an efficient solution for large media libraries. - ---- - -## Experimental: Running the Script as a Service on Ubuntu - -If you're using a different operating system like Ubuntu, you can run this script as a service. Below is an experimental service script to help you set it up. - -### Creating the Service +### Step-by-Step Implementation 1. **Save the Script**: Save your Tdarr Node Killer Script as `tdarr_node_killer.sh` in `/usr/local/bin/`. @@ -179,7 +122,7 @@ If you're using a different operating system like Ubuntu, you can run this scrip sudo chown root:root /usr/local/bin/tdarr_node_killer.sh ``` -3. **Create a Service File**: Create a service file for the script: +3. **Create a Service File (For Non-Unraid Users)**: If you're not using Unraid, you can run this script as a service on your operating system. Create a service file for the script: ```bash sudo nano /etc/systemd/system/tdarr_node_killer.service @@ -214,7 +157,15 @@ If you're using a different operating system like Ubuntu, you can run this scrip sudo systemctl enable tdarr_node_killer.service ``` -This will allow the script to run automatically on startup and ensure that it stays active in the background, just like it would on Unraid. +By following these steps, the script will run automatically on startup and ensure that it stays active in the background, managing your GPU resources efficiently. + +--- + +## Experimental: Running the Script on Other Operating Systems + +While this script is designed to work seamlessly on Unraid, it can technically work on any operating system that supports Docker and systemd services. The steps provided in the Tdarr Node Killer Script section above can be adapted for use on systems like Ubuntu, CentOS, or any other Linux distribution that uses systemd. + +If you’re using a different operating system and want to try this setup, follow the steps provided for saving the script, setting permissions, and creating a service file. The service will automatically start on boot and manage the Tdarr node and Plex transcoding as described. ---