From f5859a6112cac9f18283f83022e9ceb2a819123b Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sat, 30 Nov 2019 23:40:14 +0200 Subject: [PATCH 1/6] add patch for Nvidia FBC --- patch-fbc.sh | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100755 patch-fbc.sh diff --git a/patch-fbc.sh b/patch-fbc.sh new file mode 100755 index 0000000..48d0e1e --- /dev/null +++ b/patch-fbc.sh @@ -0,0 +1,165 @@ +#!/bin/bash +# halt on any error for safety and proper pipe handling +set -euo pipefail ; # <- this semicolon and comment make options apply +# even when script is corrupt by CRLF line terminators (issue #75) +# empty line must follow this comment for immediate fail with CRLF newlines + +backup_path="/opt/nvidia/libnvidia-fbc-backup" +silent_flag='' + +print_usage() { printf ' +SYNOPSIS + patch-fbc.sh [-s] [-r|-h|-c VERSION|-l] + +DESCRIPTION + The patch for Nvidia drivers to allow FBC on consumer devices + + -s Silent mode (No output) + -r Rollback to original (Restore lib from backup) + -h Print this help message + -c VERSION Check if version VERSION supported by this patch. + Returns true exit code (0) if version is supported. + -l List supported driver versions + +' +} + +# shellcheck disable=SC2209 +opmode="patch" + +while getopts 'rshc:l' flag; do + case "${flag}" in + r) opmode="${opmode}rollback" ;; + s) silent_flag='true' ;; + h) opmode="${opmode}help" ;; + c) opmode="${opmode}checkversion" ; checked_version="$OPTARG" ;; + l) opmode="${opmode}listversions" ;; + *) echo "Incorrect option specified in command line" ; exit 2 ;; + esac +done + +if [[ $silent_flag ]]; then + exec 1> /dev/null +fi + +declare -A patch_list=( + ["440.36"]='s/\x85\xc0\x89\xc3\x0f\x85\xa9\xfa\xff\xff/\x31\xc0\x89\xc3\x0f\x85\xa9\xfa\xff\xff/' +) + +declare -A object_list=( + ["440.36"]='libnvidia-fbc.so' +) + +check_version_supported () { + local ver="$1" + [[ "${patch_list[$ver]+isset}" && "${object_list[$ver]+isset}" ]] +} + +get_supported_versions () { + for drv in "${!patch_list[@]}"; do + [[ "${object_list[$drv]+isset}" ]] && echo "$drv" + done | sort -t. -n + return 0 +} + +patch_common () { + NVIDIA_SMI="$(command -v nvidia-smi || true)" + if [[ ! "$NVIDIA_SMI" ]] ; then + echo 'nvidia-smi utility not found. Probably driver is not installed.' + exit 1 + fi + + if ! driver_version=$("$NVIDIA_SMI" --query-gpu=driver_version --format=csv,noheader,nounits | head -n 1) ; then + echo 'Something went wrong. Check nvidia driver' + exit 1 + fi + + echo "Detected nvidia driver version: $driver_version" + + if ! check_version_supported "$driver_version" ; then + echo "Patch for this ($driver_version) nvidia driver not found." + echo "Patch is available for versions: " + get_supported_versions + exit 1 + fi + + patch="${patch_list[$driver_version]}" + object="${object_list[$driver_version]}" + + declare -a driver_locations=( + '/usr/lib/x86_64-linux-gnu' + '/usr/lib/x86_64-linux-gnu/nvidia/current/' + '/usr/lib64' + "/usr/lib/nvidia-${driver_version%%.*}" + ) + + dir_found='' + for driver_dir in "${driver_locations[@]}" ; do + if [[ -e "$driver_dir/$object.$driver_version" ]]; then + dir_found='true' + break + fi + done + + [[ "$dir_found" ]] || { echo "ERROR: cannot detect driver directory"; exit 1; } + +} + +rollback () { + patch_common + if [[ -f "$backup_path/$object.$driver_version" ]]; then + cp -p "$backup_path/$object.$driver_version" \ + "$driver_dir/$object.$driver_version" + echo "Restore from backup $object.$driver_version" + else + echo "Backup not found. Try to patch first." + exit 1 + fi +} + +patch () { + patch_common + if [[ -f "$backup_path/$object.$driver_version" ]]; then + bkp_hash="$(sha1sum "$backup_path/$object.$driver_version" | cut -f1 -d\ )" + drv_hash="$(sha1sum "$driver_dir/$object.$driver_version" | cut -f1 -d\ )" + if [[ "$bkp_hash" != "$drv_hash" ]] ; then + echo "Backup exists and driver file differ from backup. Skipping patch." + return 0 + fi + else + echo "Attention! Backup not found. Copying current $object to backup." + mkdir -p "$backup_path" + cp -p "$driver_dir/$object.$driver_version" \ + "$backup_path/$object.$driver_version" + fi + sha1sum "$backup_path/$object.$driver_version" + sed "$patch" "$backup_path/$object.$driver_version" > \ + "${PATCH_OUTPUT_DIR-$driver_dir}/$object.$driver_version" + sha1sum "${PATCH_OUTPUT_DIR-$driver_dir}/$object.$driver_version" + ldconfig + echo "Patched!" +} + +query_version_support () { + if check_version_supported "$checked_version" ; then + echo "SUPPORTED" + exit 0 + else + echo "NOT SUPPORTED" + exit 1 + fi +} + +list_supported_versions () { + get_supported_versions +} + +case "${opmode}" in + patch) patch ;; + patchrollback) rollback ;; + patchhelp) print_usage ; exit 2 ;; + patchcheckversion) query_version_support ;; + patchlistversions) list_supported_versions ;; + *) echo "Incorrect combination of flags. Use option -h to get help." + exit 2 ;; +esac From 153b1bc3e64f867f3a654fc48e7cdb57241baed8 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 1 Dec 2019 17:15:26 +0200 Subject: [PATCH 2/6] fbc: update driver db structure --- drivers.json | 76 ++++++++++++++++++++++++- tools/readme-autogen/migrate_patches.py | 15 +++-- 2 files changed, 82 insertions(+), 9 deletions(-) diff --git a/drivers.json b/drivers.json index 94809b2..a193095 100644 --- a/drivers.json +++ b/drivers.json @@ -4,149 +4,223 @@ "drivers": [ { "version": "375.39", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run" }, { "version": "390.77", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/390.77/NVIDIA-Linux-x86_64-390.77.run" }, { "version": "390.87", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/390.87/NVIDIA-Linux-x86_64-390.87.run" }, { "version": "396.24", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/396.24/NVIDIA-Linux-x86_64-396.24.run" }, { "version": "396.26", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/396.26/NVIDIA-Linux-x86_64-396.26.run" }, { "version": "396.37", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/396.37/NVIDIA-Linux-x86_64-396.37.run" }, { "version": "396.54", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/396.54/NVIDIA-Linux-x86_64-396.54.run" }, { - "version": "410.48" + "version": "410.48", + "nvenc_patch": true, + "nvfbc_patch": false }, { "version": "410.57", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/410.57/NVIDIA-Linux-x86_64-410.57.run" }, { "version": "410.73", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/410.73/NVIDIA-Linux-x86_64-410.73.run" }, { "version": "410.78", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/410.78/NVIDIA-Linux-x86_64-410.78.run" }, { "version": "410.79", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/410.79/NVIDIA-Linux-x86_64-410.79.run" }, { "version": "410.93", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run" }, { "version": "410.104", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/410.104/NVIDIA-Linux-x86_64-410.104.run" }, { "version": "415.18", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/415.18/NVIDIA-Linux-x86_64-415.18.run" }, { "version": "415.25", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/415.25/NVIDIA-Linux-x86_64-415.25.run" }, { "version": "415.27", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/415.27/NVIDIA-Linux-x86_64-415.27.run" }, { "version": "418.30", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/418.30/NVIDIA-Linux-x86_64-418.30.run" }, { "version": "418.43", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/418.43/NVIDIA-Linux-x86_64-418.43.run" }, { "version": "418.56", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://download.nvidia.com/XFree86/Linux-x86_64/418.56/NVIDIA-Linux-x86_64-418.56.run" }, { "version": "418.67", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/418.67/NVIDIA-Linux-x86_64-418.67.run" }, { "version": "418.74", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/418.74/NVIDIA-Linux-x86_64-418.74.run" }, { "version": "418.87.00", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.00.run" }, { "version": "418.87.01", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.01.run" }, { "version": "418.88", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/418.88/NVIDIA-Linux-x86_64-418.88.run" }, { "version": "430.09", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/430.09/NVIDIA-Linux-x86_64-430.09.run" }, { "version": "430.14", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/430.14/NVIDIA-Linux-x86_64-430.14.run" }, { "version": "430.26", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/430.26/NVIDIA-Linux-x86_64-430.26.run" }, { "version": "430.34", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/430.34/NVIDIA-Linux-x86_64-430.34.run" }, { "version": "430.40", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/430.40/NVIDIA-Linux-x86_64-430.40.run" }, { "version": "430.50", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/430.50/NVIDIA-Linux-x86_64-430.50.run" }, { "version": "435.17", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/435.17/NVIDIA-Linux-x86_64-435.17.run" }, { "version": "435.21", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/435.21/NVIDIA-Linux-x86_64-435.21.run" }, { "version": "440.26", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/440.26/NVIDIA-Linux-x86_64-440.26.run" }, { "version": "440.31", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/440.31/NVIDIA-Linux-x86_64-440.31.run" }, { "version": "440.33.01", + "nvenc_patch": true, + "nvfbc_patch": false, "driver_url": "https://international.download.nvidia.com/tesla/440.33.01/NVIDIA-Linux-x86_64-440.33.01.run" }, { "version": "440.36", + "nvenc_patch": true, + "nvfbc_patch": true, "driver_url": "https://international.download.nvidia.com/XFree86/Linux-x86_64/440.36/NVIDIA-Linux-x86_64-440.36.run" } ], diff --git a/tools/readme-autogen/migrate_patches.py b/tools/readme-autogen/migrate_patches.py index 5d61198..f64ad5e 100755 --- a/tools/readme-autogen/migrate_patches.py +++ b/tools/readme-autogen/migrate_patches.py @@ -59,15 +59,14 @@ def main(): with open(DATAFILE_PATH) as data_file: data = json.load(data_file) - drivers = data[OSKind.Windows.value]['x86_64']['drivers'] + drivers = data[OSKind.Linux.value]['x86_64']['drivers'] for d in drivers: - base, sep, tail = d['patch64_url'].rpartition('/') - assert sep - assert tail - d['patch64_url'] = base + '/' + 'nvencodeapi64.1337' - d['patch32_url'] = base + '/' + 'nvencodeapi.1337' - d['driver_url'] = d['driver_url'] - validate_patch(d['patch64_url'], d['patch32_url']) + d['nvenc_patch'] = True + d['nvfbc_patch'] = False + if 'driver_url' in d: + driver_url = d['driver_url'] + del d['driver_url'] + d['driver_url'] = driver_url with open(DATAFILE_PATH, 'w') as data_file: json.dump(data, data_file, indent=4) From 6a9d1ff885dd3966b8ce98d8a27414ca6e3951d8 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 1 Dec 2019 17:39:27 +0200 Subject: [PATCH 3/6] fbc: rewrite autogen and linux readme to accomodate to new patch kind --- README.md | 81 ++++++++++--------- tools/readme-autogen/readme_autogen.py | 19 +++-- .../templates/linux_driver_row.tmpl | 1 + .../templates/linux_link_row.tmpl | 1 - .../templates/linux_nolink_row.tmpl | 1 - .../templates/linux_readme_master.tmpl | 7 +- .../templates/markdown_false.tmpl | 1 + .../templates/markdown_true.tmpl | 1 + 8 files changed, 66 insertions(+), 46 deletions(-) create mode 100644 tools/readme-autogen/templates/linux_driver_row.tmpl delete mode 100644 tools/readme-autogen/templates/linux_link_row.tmpl delete mode 100644 tools/readme-autogen/templates/linux_nolink_row.tmpl create mode 100644 tools/readme-autogen/templates/markdown_false.tmpl create mode 100644 tools/readme-autogen/templates/markdown_true.tmpl diff --git a/README.md b/README.md index 3ef19b9..04074f7 100644 --- a/README.md +++ b/README.md @@ -10,44 +10,49 @@ Requirements: - x86\_64 system architecture - GNU/Linux operating system - nvenc-compatible gpu (https://developer.nvidia.com/video-encode-decode-gpu-support-matrix#Encoder) -- Nvidia driver. Patch available for: - - [375.39](https://download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run) - - [390.77](https://download.nvidia.com/XFree86/Linux-x86_64/390.77/NVIDIA-Linux-x86_64-390.77.run) - - [390.87](https://download.nvidia.com/XFree86/Linux-x86_64/390.87/NVIDIA-Linux-x86_64-390.87.run) - - [396.24](https://download.nvidia.com/XFree86/Linux-x86_64/396.24/NVIDIA-Linux-x86_64-396.24.run) - - [396.26](https://international.download.nvidia.com/tesla/396.26/NVIDIA-Linux-x86_64-396.26.run) - - [396.37](https://international.download.nvidia.com/tesla/396.37/NVIDIA-Linux-x86_64-396.37.run) - - [396.54](https://download.nvidia.com/XFree86/Linux-x86_64/396.54/NVIDIA-Linux-x86_64-396.54.run) - - 410.48 - - [410.57](https://download.nvidia.com/XFree86/Linux-x86_64/410.57/NVIDIA-Linux-x86_64-410.57.run) - - [410.73](https://download.nvidia.com/XFree86/Linux-x86_64/410.73/NVIDIA-Linux-x86_64-410.73.run) - - [410.78](https://download.nvidia.com/XFree86/Linux-x86_64/410.78/NVIDIA-Linux-x86_64-410.78.run) - - [410.79](https://international.download.nvidia.com/tesla/410.79/NVIDIA-Linux-x86_64-410.79.run) - - [410.93](https://download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run) - - [410.104](https://international.download.nvidia.com/XFree86/Linux-x86_64/410.104/NVIDIA-Linux-x86_64-410.104.run) - - [415.18](https://download.nvidia.com/XFree86/Linux-x86_64/415.18/NVIDIA-Linux-x86_64-415.18.run) - - [415.25](https://download.nvidia.com/XFree86/Linux-x86_64/415.25/NVIDIA-Linux-x86_64-415.25.run) - - [415.27](https://download.nvidia.com/XFree86/Linux-x86_64/415.27/NVIDIA-Linux-x86_64-415.27.run) - - [418.30](https://download.nvidia.com/XFree86/Linux-x86_64/418.30/NVIDIA-Linux-x86_64-418.30.run) - - [418.43](https://download.nvidia.com/XFree86/Linux-x86_64/418.43/NVIDIA-Linux-x86_64-418.43.run) - - [418.56](https://download.nvidia.com/XFree86/Linux-x86_64/418.56/NVIDIA-Linux-x86_64-418.56.run) - - [418.67](https://international.download.nvidia.com/tesla/418.67/NVIDIA-Linux-x86_64-418.67.run) - - [418.74](https://international.download.nvidia.com/XFree86/Linux-x86_64/418.74/NVIDIA-Linux-x86_64-418.74.run) - - [418.87.00](https://international.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.00.run) - - [418.87.01](https://international.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.01.run) - - [418.88](https://international.download.nvidia.com/XFree86/Linux-x86_64/418.88/NVIDIA-Linux-x86_64-418.88.run) - - [430.09](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.09/NVIDIA-Linux-x86_64-430.09.run) - - [430.14](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.14/NVIDIA-Linux-x86_64-430.14.run) - - [430.26](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.26/NVIDIA-Linux-x86_64-430.26.run) - - [430.34](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.34/NVIDIA-Linux-x86_64-430.34.run) - - [430.40](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.40/NVIDIA-Linux-x86_64-430.40.run) - - [430.50](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.50/NVIDIA-Linux-x86_64-430.50.run) - - [435.17](https://international.download.nvidia.com/XFree86/Linux-x86_64/435.17/NVIDIA-Linux-x86_64-435.17.run) - - [435.21](https://international.download.nvidia.com/XFree86/Linux-x86_64/435.21/NVIDIA-Linux-x86_64-435.21.run) - - [440.26](https://international.download.nvidia.com/XFree86/Linux-x86_64/440.26/NVIDIA-Linux-x86_64-440.26.run) - - [440.31](https://international.download.nvidia.com/XFree86/Linux-x86_64/440.31/NVIDIA-Linux-x86_64-440.31.run) - - [440.33.01](https://international.download.nvidia.com/tesla/440.33.01/NVIDIA-Linux-x86_64-440.33.01.run) - - [440.36](https://international.download.nvidia.com/XFree86/Linux-x86_64/440.36/NVIDIA-Linux-x86_64-440.36.run) +- Nvidia driver. Patch available for versions in version table below. + +## Version Table + +| Version | NVENC patch | NVFBC patch | Driver link | +|---------|-------------|-------------|-------------| +| 375.39 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run) | +| 390.77 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/390.77/NVIDIA-Linux-x86_64-390.77.run) | +| 390.87 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/390.87/NVIDIA-Linux-x86_64-390.87.run) | +| 396.24 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/396.24/NVIDIA-Linux-x86_64-396.24.run) | +| 396.26 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/396.26/NVIDIA-Linux-x86_64-396.26.run) | +| 396.37 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/396.37/NVIDIA-Linux-x86_64-396.37.run) | +| 396.54 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/396.54/NVIDIA-Linux-x86_64-396.54.run) | +| 410.48 | :heavy_check_mark: | :x: | | +| 410.57 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/410.57/NVIDIA-Linux-x86_64-410.57.run) | +| 410.73 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/410.73/NVIDIA-Linux-x86_64-410.73.run) | +| 410.78 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/410.78/NVIDIA-Linux-x86_64-410.78.run) | +| 410.79 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/410.79/NVIDIA-Linux-x86_64-410.79.run) | +| 410.93 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run) | +| 410.104 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/410.104/NVIDIA-Linux-x86_64-410.104.run) | +| 415.18 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/415.18/NVIDIA-Linux-x86_64-415.18.run) | +| 415.25 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/415.25/NVIDIA-Linux-x86_64-415.25.run) | +| 415.27 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/415.27/NVIDIA-Linux-x86_64-415.27.run) | +| 418.30 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/418.30/NVIDIA-Linux-x86_64-418.30.run) | +| 418.43 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/418.43/NVIDIA-Linux-x86_64-418.43.run) | +| 418.56 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/418.56/NVIDIA-Linux-x86_64-418.56.run) | +| 418.67 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/418.67/NVIDIA-Linux-x86_64-418.67.run) | +| 418.74 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/418.74/NVIDIA-Linux-x86_64-418.74.run) | +| 418.87.00 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.00.run) | +| 418.87.01 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.01.run) | +| 418.88 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/418.88/NVIDIA-Linux-x86_64-418.88.run) | +| 430.09 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.09/NVIDIA-Linux-x86_64-430.09.run) | +| 430.14 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.14/NVIDIA-Linux-x86_64-430.14.run) | +| 430.26 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.26/NVIDIA-Linux-x86_64-430.26.run) | +| 430.34 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.34/NVIDIA-Linux-x86_64-430.34.run) | +| 430.40 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.40/NVIDIA-Linux-x86_64-430.40.run) | +| 430.50 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/430.50/NVIDIA-Linux-x86_64-430.50.run) | +| 435.17 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/435.17/NVIDIA-Linux-x86_64-435.17.run) | +| 435.21 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/435.21/NVIDIA-Linux-x86_64-435.21.run) | +| 440.26 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/440.26/NVIDIA-Linux-x86_64-440.26.run) | +| 440.31 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/440.31/NVIDIA-Linux-x86_64-440.31.run) | +| 440.33.01 | :heavy_check_mark: | :x: | [Driver link](https://international.download.nvidia.com/tesla/440.33.01/NVIDIA-Linux-x86_64-440.33.01.run) | +| 440.36 | :heavy_check_mark: | :heavy_check_mark: | [Driver link](https://international.download.nvidia.com/XFree86/Linux-x86_64/440.36/NVIDIA-Linux-x86_64-440.36.run) | ## Synopsis diff --git a/tools/readme-autogen/readme_autogen.py b/tools/readme-autogen/readme_autogen.py index ba6d953..bb01f05 100755 --- a/tools/readme-autogen/readme_autogen.py +++ b/tools/readme-autogen/readme_autogen.py @@ -23,15 +23,24 @@ WIN_SERIES_LABELS = { def linux_readme(data): master_tmpl = template('linux_readme_master.tmpl') - nolink_row_tmpl = template('linux_nolink_row.tmpl', True) - link_row_tmpl = template('linux_link_row.tmpl', True) + row_tmpl = template('linux_driver_row.tmpl', True) + link_tmpl = template('markdown_link.tmpl', True) + md_true = template('markdown_true.tmpl', True).substitute() + md_false = template('markdown_false.tmpl', True).substitute() drivers = sorted(data['drivers'], key=linux_driver_key) def row_gen(): for drv in drivers: driver_url = drv.get('driver_url') - t = nolink_row_tmpl if driver_url is None else link_row_tmpl - yield t.substitute(driver_version=drv['version'], - driver_url=driver_url) + if driver_url: + driver_link = link_tmpl.substitute(text="Driver link", url=driver_url) + else: + driver_link = '' + nvenc_patch = md_true if drv['nvenc_patch'] else md_false + nvfbc_patch = md_true if drv['nvfbc_patch'] else md_false + yield row_tmpl.substitute(version=drv['version'], + nvenc_patch=nvenc_patch, + nvfbc_patch=nvfbc_patch, + driver_link=driver_link) version_list = "\n".join(row_gen()) latest_version = drivers[-1]['version'] example_driver = find_driver(drivers, diff --git a/tools/readme-autogen/templates/linux_driver_row.tmpl b/tools/readme-autogen/templates/linux_driver_row.tmpl new file mode 100644 index 0000000..8261b54 --- /dev/null +++ b/tools/readme-autogen/templates/linux_driver_row.tmpl @@ -0,0 +1 @@ +| $version | $nvenc_patch | $nvfbc_patch | $driver_link | diff --git a/tools/readme-autogen/templates/linux_link_row.tmpl b/tools/readme-autogen/templates/linux_link_row.tmpl deleted file mode 100644 index 4613098..0000000 --- a/tools/readme-autogen/templates/linux_link_row.tmpl +++ /dev/null @@ -1 +0,0 @@ - - [$driver_version]($driver_url) diff --git a/tools/readme-autogen/templates/linux_nolink_row.tmpl b/tools/readme-autogen/templates/linux_nolink_row.tmpl deleted file mode 100644 index 741a30f..0000000 --- a/tools/readme-autogen/templates/linux_nolink_row.tmpl +++ /dev/null @@ -1 +0,0 @@ - - $driver_version diff --git a/tools/readme-autogen/templates/linux_readme_master.tmpl b/tools/readme-autogen/templates/linux_readme_master.tmpl index 7be4101..8cb5248 100644 --- a/tools/readme-autogen/templates/linux_readme_master.tmpl +++ b/tools/readme-autogen/templates/linux_readme_master.tmpl @@ -10,7 +10,12 @@ Requirements: - x86\_64 system architecture - GNU/Linux operating system - nvenc-compatible gpu (https://developer.nvidia.com/video-encode-decode-gpu-support-matrix#Encoder) -- Nvidia driver. Patch available for: +- Nvidia driver. Patch available for versions in version table below. + +## Version Table + +| Version | NVENC patch | NVFBC patch | Driver link | +|---------|-------------|-------------|-------------| $version_list ## Synopsis diff --git a/tools/readme-autogen/templates/markdown_false.tmpl b/tools/readme-autogen/templates/markdown_false.tmpl new file mode 100644 index 0000000..c942e9e --- /dev/null +++ b/tools/readme-autogen/templates/markdown_false.tmpl @@ -0,0 +1 @@ +:x: diff --git a/tools/readme-autogen/templates/markdown_true.tmpl b/tools/readme-autogen/templates/markdown_true.tmpl new file mode 100644 index 0000000..6439b5f --- /dev/null +++ b/tools/readme-autogen/templates/markdown_true.tmpl @@ -0,0 +1 @@ +:heavy_check_mark: From 9689e1ab31cef9ffaf5cbd17b8417fee14b4afbe Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 1 Dec 2019 17:44:38 +0200 Subject: [PATCH 4/6] fbc: fancy table alignment --- README.md | 2 +- tools/readme-autogen/templates/linux_readme_master.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04074f7..3434070 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Requirements: ## Version Table | Version | NVENC patch | NVFBC patch | Driver link | -|---------|-------------|-------------|-------------| +| :--- | :---: | :---: | ---: | | 375.39 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run) | | 390.77 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/390.77/NVIDIA-Linux-x86_64-390.77.run) | | 390.87 | :heavy_check_mark: | :x: | [Driver link](https://download.nvidia.com/XFree86/Linux-x86_64/390.87/NVIDIA-Linux-x86_64-390.87.run) | diff --git a/tools/readme-autogen/templates/linux_readme_master.tmpl b/tools/readme-autogen/templates/linux_readme_master.tmpl index 8cb5248..2ba8a2b 100644 --- a/tools/readme-autogen/templates/linux_readme_master.tmpl +++ b/tools/readme-autogen/templates/linux_readme_master.tmpl @@ -15,7 +15,7 @@ Requirements: ## Version Table | Version | NVENC patch | NVFBC patch | Driver link | -|---------|-------------|-------------|-------------| +| :--- | :---: | :---: | ---: | $version_list ## Synopsis From 52bf29dbc4651ea954d0bff899d63afe6f8748bf Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 1 Dec 2019 18:00:25 +0200 Subject: [PATCH 5/6] fbc: add required notice in readme --- README.md | 2 +- tools/readme-autogen/templates/linux_readme_master.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3434070..653b10d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![GitHub last commit](https://img.shields.io/github/last-commit/keylase/nvidia-patch.svg) ![Latest version](https://img.shields.io/badge/latest%20linux%20driver%20version-440.36-brightgreen.svg) -This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs. +This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs. Also there is experimental NvFBC patch available which allows to use NvFBC on consumer-grade GPUs. It should be applied same way as NVENC `patch.sh`, except you have to use `patch-fbc.sh` instead. Main target operating system is **GNU/Linux**, but for **Windows** support see [**win**](win). diff --git a/tools/readme-autogen/templates/linux_readme_master.tmpl b/tools/readme-autogen/templates/linux_readme_master.tmpl index 2ba8a2b..fa59c06 100644 --- a/tools/readme-autogen/templates/linux_readme_master.tmpl +++ b/tools/readme-autogen/templates/linux_readme_master.tmpl @@ -2,7 +2,7 @@ ![GitHub last commit](https://img.shields.io/github/last-commit/keylase/nvidia-patch.svg) ![Latest version](https://img.shields.io/badge/latest%20linux%20driver%20version-${latest_version}-brightgreen.svg) -This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs. +This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs. Also there is experimental NvFBC patch available which allows to use NvFBC on consumer-grade GPUs. It should be applied same way as NVENC `patch.sh`, except you have to use `patch-fbc.sh` instead. Main target operating system is **GNU/Linux**, but for **Windows** support see [**win**](win). From 220f4596109c3d234bd7ebee0ecad9090bbccb24 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 1 Dec 2019 18:02:52 +0200 Subject: [PATCH 6/6] fbc: update add_driver tooling --- tools/readme-autogen/add_driver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/readme-autogen/add_driver.py b/tools/readme-autogen/add_driver.py index 2c525bb..360a50d 100755 --- a/tools/readme-autogen/add_driver.py +++ b/tools/readme-autogen/add_driver.py @@ -187,6 +187,8 @@ def main(): else: new_driver = { "version": args.version, + "nvenc_patch": True, + "nvfbc_patch": True, "driver_url": url, } key_fun = linux_driver_key