From ee66288b66e65c5207b24dd09e46df2482d858e7 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sat, 5 Jan 2019 14:49:13 +0200 Subject: [PATCH] revamp docs and help --- README.md | 43 +++++++++++++++++++++++++++++++++++-------- patch.sh | 5 +++-- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 434cc1b..fe733d0 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,33 @@ Requirements: Tested on Ubuntu 18.04 LTS (GNU/Linux 4.15.0-23-generic x86\_64) -## step-by-step : +## Synopsis + +``` +# bash ./patch.sh -h + +SYNOPSIS + patch.sh [OPTION]... + +DESCRIPTION + The patch for Nvidia drivers to increase encoder sessions + + -s Silent mode (No output) + -r Rollback to original (Restore lib from backup) + -h Print this help message + +``` + +## Step-by-Step guide + +Examples are provided for driver version 410.78. All commands are runned as root. ### Download driver + [https://download.nvidia.com/XFree86/Linux-x86\_64/410.78/NVIDIA-Linux-x86\_64-410.78.run](https://download.nvidia.com/XFree86/Linux-x86_64/410.78/NVIDIA-Linux-x86_64-410.78.run) -### Install driver (410.78) +### Install driver + ```bash mkdir /opt/nvidia && cd /opt/nvidia wget https://download.nvidia.com/XFree86/Linux-x86_64/410.78/NVIDIA-Linux-x86_64-410.78.run @@ -37,21 +58,27 @@ chmod +x ./NVIDIA-Linux-x86_64-410.78.run ``` ### Check driver + ```bash nvidia-smi ``` -### Patch libnvidia-encode.so (with backup) +Output should show no errors and details about your driver and GPU. + +### Patch driver + +This patch performs backup of original file prior to making changes. + ```bash bash ./patch.sh ``` -### Silent patch libnvidia-encode.so -```bash -bash ./patch.sh -s -``` +You're all set! + +## Rollback + +If something got broken you may restore patched driver from backup: -### Rollback libnvidia-encode.so (restore from backup) ```bash bash ./patch.sh -r ``` diff --git a/patch.sh b/patch.sh index 44350a9..907225b 100755 --- a/patch.sh +++ b/patch.sh @@ -12,15 +12,16 @@ SYNOPSIS patch.sh [OPTION]... DESCRIPTION - The patch for libnvidia-encode to increase encoder sessions + The patch for Nvidia drivers to increase encoder sessions -s Silent mode (No output) -r Rollback to original (Restore lib from backup) + -h Print this help message ' } -while getopts 'rs' flag; do +while getopts 'rsh' flag; do case "${flag}" in r) rollback_flag='true' ;; s) silent_flag='true' ;;