Coder Social home page Coder Social logo

keylase / nvidia-patch Goto Github PK

View Code? Open in Web Editor NEW
3.3K 59.0 265.0 2.1 MB

This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs.

Shell 33.68% Python 54.11% Dockerfile 0.21% C 4.03% Assembly 0.64% C++ 3.79% HTML 2.78% Batchfile 0.37% PowerShell 0.38%

nvidia-patch's Introduction

NVENC and NvFBC patches for Nvidia drivers

GitHub last commit Latest version

NVENC patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs.

NvFBC patch 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 (clickable).


If you like this project, best way to contribute is by sending PRs and fixing documentation.

If you want to donate, please send it to your favorite open source organizations, for example FFmpeg, VideoLAN


Requirements

Version Table

Version NVENC patch NVFBC patch Driver link
375.39 YES NO Driver link
390.77 YES NO Driver link
390.87 YES NO Driver link
390.147 YES NO Driver link
396.24 YES NO Driver link
396.26 YES NO Driver link
396.37 YES NO Driver link
396.54 YES NO Driver link
410.48 YES NO
410.57 YES NO Driver link
410.73 YES NO Driver link
410.78 YES NO Driver link
410.79 YES NO Driver link
410.93 YES NO Driver link
410.104 YES NO Driver link
415.18 YES NO Driver link
415.25 YES NO Driver link
415.27 YES NO Driver link
418.30 YES NO Driver link
418.43 YES NO Driver link
418.56 YES NO Driver link
418.67 YES NO Driver link
418.74 YES NO Driver link
418.87.00 YES NO Driver link
418.87.01 YES NO Driver link
418.88 YES NO Driver link
418.113 YES NO Driver link
430.09 YES NO Driver link
430.14 YES NO Driver link
430.26 YES NO Driver link
430.34 YES NO Driver link
430.40 YES NO Driver link
430.50 YES NO Driver link
430.64 YES NO Driver link
435.17 YES NO Driver link
435.21 YES NO Driver link
440.26 YES YES Driver link
440.31 YES YES Driver link
440.33.01 YES YES Driver link
440.36 YES YES Driver link
440.43.01 YES YES
440.44 YES YES Driver link
440.48.02 YES YES
440.58.01 YES YES
440.58.02 YES YES
440.59 YES YES Driver link
440.64 YES YES Driver link
440.64.00 YES YES Driver link
440.66.02 YES YES
440.66.03 YES YES
440.66.04 YES YES
440.66.08 YES YES
440.66.09 YES YES
440.66.11 YES YES
440.66.12 YES YES
440.66.14 YES YES
440.66.15 YES YES
440.66.17 YES YES
440.82 YES YES Driver link
440.95.01 YES YES Driver link
440.100 YES YES Driver link
440.118.02 YES YES Driver link
450.36.06 YES YES Driver link
450.51 YES YES Driver link
450.51.05 YES YES Driver link
450.51.06 YES YES Driver link
450.56.01 YES YES
450.56.02 YES YES
450.56.06 YES YES
450.56.11 YES YES
450.57 YES YES Driver link
450.66 YES YES Driver link
450.80.02 YES YES Driver link
450.102.04 YES NO Driver link
455.22.04 YES NO
455.23.04 YES YES Driver link
455.23.05 YES YES
455.26.01 YES YES
455.26.02 YES YES
455.28 YES YES Driver link
455.32.00 YES YES
455.38 YES YES Driver link
455.45.01 YES YES Driver link
455.46.01 YES YES
455.46.02 YES YES
455.46.04 YES YES
455.50.02 YES YES
455.50.03 NO YES
455.50.04 YES YES
455.50.05 YES YES
455.50.07 YES YES
455.50.10 YES YES
460.27.04 YES YES Driver link
460.32.03 YES YES Driver link
460.39 YES YES Driver link
460.56 YES YES Driver link
460.67 YES YES Driver link
460.73.01 YES YES Driver link
460.80 YES YES Driver link
460.84 YES YES Driver link
460.91.03 YES YES Driver link
465.19.01 YES YES Driver link
465.24.02 YES YES Driver link
465.27 YES YES Driver link
465.31 YES YES Driver link
470.42.01 YES YES Driver link
470.57.02 YES YES Driver link
470.62.02 YES YES
470.62.05 YES YES
470.63.01 YES YES Driver link
470.74 YES YES Driver link
470.82.00 YES YES Driver link
470.82.01 YES YES Driver link
470.86 YES YES Driver link
470.94 YES YES Driver link
470.103.01 YES YES Driver link
470.129.06 YES YES Driver link
470.141.03 YES YES Driver link
470.161.03 YES YES Driver link
470.182.03 YES YES Driver link
470.199.02 YES YES Driver link
470.223.02 YES YES Driver link
470.239.06 YES YES Driver link
470.256.02 YES YES Driver link
495.29.05 YES YES Driver link
495.44 YES YES Driver link
495.46 YES YES Driver link
510.39.01 YES YES Driver link
510.47.03 YES YES Driver link
510.54 YES YES Driver link
510.60.02 YES YES Driver link
510.68.02 YES YES Driver link
510.73.05 YES YES Driver link
510.73.08 YES YES Driver link
510.85.02 YES YES Driver link
510.108.03 YES YES Driver link
515.43.04 YES YES Driver link
515.48.07 YES YES Driver link
515.57 YES YES Driver link
515.65.01 YES YES Driver link
515.76 YES YES Driver link
515.86.01 YES YES Driver link
515.105.01 YES YES Driver link
520.56.06 YES YES Driver link
520.61.05 YES YES Driver link
525.60.11 YES YES Driver link
525.60.13 YES YES
525.78.01 YES YES Driver link
525.85.05 YES YES Driver link
525.85.12 YES YES
525.89.02 YES YES Driver link
525.105.17 YES YES Driver link
525.116.03 YES YES Driver link
525.116.04 YES YES Driver link
525.125.06 YES YES Driver link
525.147.05 YES YES Driver link
530.30.02 YES YES Driver link
530.41.03 YES YES Driver link
535.43.02 YES YES Driver link
535.43.25 YES YES Driver link
535.54.03 YES YES Driver link
535.86.05 YES YES Driver link
535.86.10 YES YES
535.98 YES YES Driver link
535.104.05 YES YES Driver link
535.104.12 YES YES Driver link
535.113.01 YES YES Driver link
535.129.03 YES YES Driver link
535.146.02 YES YES Driver link
535.154.05 YES YES Driver link
535.161.07 YES YES Driver link
535.161.08 YES YES
535.171.04 YES YES Driver link
535.183.01 YES YES Driver link
545.23.06 YES YES Driver link
545.23.08 YES YES
545.29.02 YES YES Driver link
545.29.06 YES YES Driver link
550.40.07 YES YES Driver link
550.54.14 YES YES Driver link
550.54.15 YES YES
550.67 YES YES Driver link
550.76 YES YES Driver link
550.78 YES YES Driver link
550.90.07 YES YES Driver link
555.42.02 YES YES Driver link
555.58 YES YES Driver link
555.58.02 YES YES Driver link

Synopsis

# bash ./patch.sh -h

SYNOPSIS
       patch.sh [-s] [-r|-h|-c VERSION|-l|-f]

DESCRIPTION
       The patch for Nvidia drivers to remove NVENC session limit

       -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
       -d VERSION     Use VERSION driver version when looking for libraries
                      instead of using nvidia-smi to detect it.
       -f             Enable support for Flatpak NVIDIA drivers.

# bash ./patch-fbc.sh -h

SYNOPSIS
       patch-fbc.sh [-s] [-r|-h|-c VERSION|-l|-f]

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
       -d VERSION     Use VERSION driver version when looking for libraries
                      instead of using nvidia-smi to detect it.
       -f             Enable support for Flatpak NVIDIA drivers.

Step-by-Step guide

Examples are provided for driver version 430.50. All commands are executed as root.

Download and install driver

Skip this step if you already have installed driver with version supported by this patch.

Make sure you have kernel headers and compiler installed before running Nvidia driver installer. Kernel headers and compiler are required to build nvidia kernel module. Recommended way to do this is to install dkms package, if it is available in your distro. This way dkms package will pull all required dependencies to allow building kernel modules and kernel module builds will be automated in a reliable fashion.

mkdir /opt/nvidia && cd /opt/nvidia
wget https://international.download.nvidia.com/XFree86/Linux-x86_64/430.50/NVIDIA-Linux-x86_64-430.50.run
chmod +x ./NVIDIA-Linux-x86_64-430.50.run
./NVIDIA-Linux-x86_64-430.50.run

Check driver

nvidia-smi

Output should show no errors and details about your driver and GPU. You can also check if ffmpeg can encode without limit, and check NVFBC via OBS.

Patch driver

This patch performs backup of original file prior to making changes.

bash ./patch.sh

You're all set!

Note: Sometimes distribution installed drivers are not found by the patch script. In that case, please uninstall the nvidia driver using your distribution package manager, and install it using the steps above.

Rollback

If something got broken you may restore patched driver from backup:

bash ./patch.sh -r

Docker support

It is possible to use this patch with nvidia-docker containers, even if host machine hasn't patched drivers. See Dockerfile for example.

Essentially all you need to do during build is:

  • COPY the patch.sh and docker-entrypoint.sh files into your container.
  • Make sure docker-entrypoint.sh is invoked on container start.

docker-entrypoint.sh script does on-the-fly patching by means of manipulating dynamic linker to workaround read-only mount of Nvidia runtime. Finally it passes original docker command to shell, like if entrypoint was not restricted by ENTRYPOINT directive. So docker run --runtime=nvidia -it mycontainer echo 123 will print 123. Also it can be just invoked from your entrypoint script, if you have any.

Flatpak support

If you use a Flatpak app that uses NVENC/NvFBC (e.g. OBS Studio, Kdenlive), it's recommended that you patch the NVIDIA drivers for Flatpak as well. To do so, just pass the -f parameter to either patch.sh or patch-fbc.sh, like so:

bash ./patch.sh -f
bash ./patch-fbc.sh -f

In case something goes wrong, you can restore the original Flatpak drivers by adding the -r paramater:

bash ./patch.sh -f -r
bash ./patch-fbc.sh -f -r

Benchmarks

See also

If you experience CreateBitstreamBuffer failed: out of memory (10), then you have to lower buffers number used for every encoding session. If you are using ffmpeg, see option -surfaces ("Number of concurrent surfaces") and try value near -surfaces 8.

nvidia-patch's People

Contributors

3po avatar actions-user avatar averred avatar cathyjf avatar daedalusspacegames avatar emileet avatar fancybody avatar gelmo avatar guihkx avatar havlasme avatar helldweller avatar jailuthra avatar justcryen avatar kderazorback avatar keylase avatar leillo1975 avatar lionheartp avatar mirolm avatar mklooss avatar moetayuko avatar nixta1 avatar omegarazer avatar ramhaidar avatar reloxx13 avatar shvarpa avatar sid127 avatar snawoot avatar stronk-dev avatar umgak avatar vblftepebwni6c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvidia-patch's Issues

New driver support (version 419.17)

This issue is created to track progress on support of upcoming new driver.

  • Nvidia driver version: 419.17
  • GPU Model: unrelated
  • OS: Win
  • I'm willing to participate in testing of new patch version

New driver support (version 410.93)

Please provide details about your environment (please complete the following information)

  • Nvidia driver version: 410.93
  • GPU Model: RTX 2070
  • OS: Xubuntu 18.04 LTS
  • I'm willing to participate in testing of new patch version

Greetings everyone! I have made a patch (see attachment) to support the driver version 410.93 (current long lived branch version, see: Nvidia Unix page). Tested on a Nvidia RTX 2070 with Xubuntu 18.04 and FFmpeg compiled from the sources (with cuda support). Right now, I am running 6 NVenc at the same time without a problem.
410.93.txt

Unraid / Docker

Hello!
Is this something we can use with UnRaid / Docker ?

New driver support (version 418.43)

This issue is created to track progress on support of upcoming new driver.

  • Nvidia driver version: 418.43
  • GPU Model: unrelated
  • OS: Linux x86_64
  • I'm willing to participate in testing of new patch version

Windows Server 2012 R2 - Wrong Offsets GTX 1070

Heya!

First off wanted to say - This looks awesome and i cannot wait to try it.

However, with windows server 2012 r2 i am getting an offset [E35F7] Wrong...... Set 0x5 -> I Expected 0x74.

Bare in mind, Server 2012 r2 runs on a windows 8 kernel meaning i have to install the windows 8 GTX 1070 driver for it to work properly.

Using the 431.60 driver also.

Thanks and i am looking forward to your reply and insights!

Is 430 definitely working?

Hi,

I am running Plex in a LXC container on proxmox 5.4 (debian). With driver 418.56 I was able to transcode more than 2 streams but since setting 430 up and repatching it stops at 2 streams. the patch says successful. I have installed the Nvidia drivers and patch on both the host and the container and everything is working fine as far as I can tell because 2 streams are happily transcoded by the GPU. Do you think I should revert to 418?

Question: How to unlock multiple NVENC video encoding sessions in nvidia-docker?

Hello! Thanks for the patch!

I'm trying to use my program that runs multiple ffmpeg encoding processes in parallel inside nvidia-docker, but when I run more than 2 processes if crashes with following errors:

[h264_nvenc @ 0x42f2780] OpenEncodeSessionEx failed: out of memory (10)
[h264_nvenc @ 0x462f780] No NVENC capable devices found 

Host machine was patched and it can run more than 2 sessions at once. Inside docker image i can run 2 and less sessions as well.

I'd be glad for any suggestions to move towards solving this problem.

Does this actually override CUDA or NVENC sessions?

I tried this for 418.81 on Windows 10 64 bits and is not working.
Our software uses NVENC and after testing I was not able to run more than 2 NVENC instances. My concers are in why is nvcuvid.dll being patched, as far as I know this dll was the old one with CUDA enc/dec implementations. New NVENC encoder implementation seems to not rely on nvcuvid.dll, it is not even loaded into our server process, in contrast when using NVENC the one loaded is:

NVIDIA Video Encoder API, Version 8.0
C:\Windows\System32\nvEncodeAPI64.dll

Could this patch be made for this DLL?

Question: nvidia-smi dmon/pmon?

Hello,

My question is:
Is feature dmon and pmon is disabled from driver on non quadro GPU-s
there is no clear explanation

# nvidia-smi dmon
Not supported on the device(s)
Failed to process command line

# nvidia-smi pmon
Not supported on the device(s)
Failed to process command line

# nvidia-smi
Fri Apr  5 11:58:55 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 415.27       Driver Version: 415.27       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 640      Off  | 00000000:01:00.0 N/A |                  N/A |
| 30%   30C    P0    N/A /  N/A |      0MiB /  1999MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

Offset [E29C7] Wrong

Hello, first, me and my "plex life" thank you for all your hard work on this patch!

I followed the instruction on a Windows 10 install (not VM) and got:

Offset [E29C7] Wrong
Set 0x79 -> I expected 0x74

My card is the:
ASUS TUF Gaming GeForce GTX 1660 Overclocked 6GB
During the install, it said it was NVIDIA Graphic Driver Version 430.86

The ASUS driver is "430.86-desktop-win10-64bit-international-whql.exe" from their website.

Is there more information I can provide to help with this?

Thank You

Screen Shot 2019-09-12 at 7 05 14 PM

New driver support (version 410.48)

Please provide details about your environment (please complete the following information)

  • Nvidia driver version: [e.g. 410.48]
  • GPU Model: [e.g. GTX 1070]
  • OS: [e.g. Ubuntu 18.04]
  • I'm willing to participate in testing of new patch version

DCH Driver Support

I needed to install DCH drivers instead of standard drivers for my Quadro P400. I downloaded the latest (430.39) directly from NVidia but now im getting an error when patching with 1337. it says:

Offset [E2877] wrong
Set 0x48 -> I expected 0x74

is this specifically because Im using the DCH driver?

line 7: syntax error near unexpected token `newline'

Trying to install the patch on a clean install of ubuntu 18 LTS.
I am met with
line 7: syntax error near unexpected token newline' line 7:

then booted back to a prompt

I have tried this both with the driver in the readme and the latest driver supported by the patch.
Running GTX 1080

HEVC B Frame Support

Hello,

Now that GTX 1650 (TU117) released it says doesn't support HEVC B Frame. I'm wondering if it's hardware or software level limitation.
If it's software restriction can we override on driver level?

Silent code for windows ffmpeg 10 streams

Hello,
Wanted to have the bat file for windows with doing the ffmpeg trick for 10 streams with null silent and without popup.

Here's a simple autoit code for if anybody wants.

compile it and make sure you add ffmpeg to the dir of ffmpegNull10StreamsSilent.exe

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_x64=ffmpegNull10StreamsSilent.exe
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <WinAPIFiles.au3>
$ffmpegCMD = ("-y -f lavfi -i nullsrc=s=256x256:d=5 -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null - -c:v h264_nvenc -f null -")
run(@scriptdir & "\" & "ffmpeg.exe" & " " & $ffmpegCMD,@ScriptDir, @SW_HIDE, $STDERR_CHILD+$STDOUT_CHILD)

Does it support the CRD 419.67

Hi. I know it supports the regular 419.67 but will this work with the new Creator Ready Drivers (CRD) on Windows.

Thanks

performance degradation

Describe the bug
Increasing the number of sessions leads to corresponding decrease of performance of each session.
For example, we have a video file to convert, and 1 session converts it in 10 seconds
2 sessions will convert 2 files in 10 seconds each - so in 10 seconds we have 2 result files
But if we use 4 sessions - we will have 4 result files in 20 seconds, not 10.

Environment (please complete the following information):

  • OS: Ubuntu 18.04.1
  • GPU model: GTX 1050ti
  • Patch commit used: ffd8f15
  • Nvidia driver version: 410.78

Additional

| NVIDIA-SMI 410.78 Driver Version: 410.78 CUDA Version: 10.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 105... Off | 00000000:01:00.0 Off | N/A |
| 0% 50C P0 N/A / 95W | 551MiB / 4039MiB | 19% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 14840 C ffmpeg 152MiB |
| 0 14851 C ffmpeg 152MiB |
| 0 14864 C ffmpeg 127MiB |
| 0 14874 C ffmpeg 108MiB |

New driver support (version 418.30)

Please provide details about your environment (please complete the following information)

  • Nvidia driver version: [ 418.30 ]
  • GPU Model: [e.g. GTX 1050 Ti]
  • OS: [Ubuntu 18.04]
  • I'm willing to participate in testing of new patch version <YES

CentOS problem

I try to use CentOS with QSV and NVEnc on same
but after installing Driver Version: 396.24 and bash ./patch.sh
I get some strange messages

[root@AsRock nvidia-patch]# bash ./patch.sh
Detected nvidia driver version: 396.24
Attention! Backup not found. Copy current libnvidia-encode to backup.
cp: не могат да се получат атрибутите на „/usr/lib/x86_64-linux-gnu/libnvidia-encode.so.396.24“: Няма такъв файл или директория
sha1sum: /opt/nvidia/libnvidia-encode-backup/libnvidia-encode.so.396.24: Няма такъв файл или директория
./patch.sh: line 76: /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.396.24: Няма такъв файл или директория
sha1sum: /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.396.24: Няма такъв файл или директория
ldconfig: /lib64/libva.so.1 не е символна връзка

Patched!

under CentOS installer use this dirs
cat /var/lib/nvidia/dirs

/usr/src/nvidia-396.24/nvidia
/usr/src/nvidia-396.24
/usr/src/nvidia-396.24/common/inc
/usr/src/nvidia-396.24/common
/usr/lib64/xorg/modules/extensions
/usr/lib64/xorg/modules
/usr/lib64/xorg
/usr/share/nvidia
/usr/share/glvnd/egl_vendor.d
/usr/share/glvnd
/usr/lib64/xorg/modules/drivers
/usr/share/doc/NVIDIA_GLX-1.0
/usr/share/doc/NVIDIA_GLX-1.0/sample
/usr/src/nvidia-396.24/nvidia-uvm
/usr/src/nvidia-396.24/nvidia-uvm/hwref/volta/gv100
/usr/src/nvidia-396.24/nvidia-uvm/hwref/volta
/usr/src/nvidia-396.24/nvidia-uvm/hwref
/usr/src/nvidia-396.24/nvidia-uvm/hwref/pascal/gp100
/usr/src/nvidia-396.24/nvidia-uvm/hwref/pascal
/usr/src/nvidia-396.24/nvidia-uvm/hwref/kepler/gk104
/usr/src/nvidia-396.24/nvidia-uvm/hwref/kepler
/usr/share/egl/egl_external_platform.d
/usr/share/egl
/usr/src/nvidia-396.24/nvidia-modeset
/usr/src/nvidia-396.24/nvidia-drm
/usr/share/doc/NVIDIA_GLX-1.0/html
/usr/lib/tls
/usr/lib/vdpau
/etc/vulkan/icd.d
/etc/vulkan

patch.sh not working in linuxserver.io unRAID nvidia release?

Hopefully someone here can assist me. I installed linuxserver.io unRAID nvidia distro RC6.7.0 rc4. I can see, by running nvidia-smi, that HW encoding is happening. After I did that, I was informed of this patch to remove the 2 stream limit.

When running the patch, which is located in /mnt/user, I get the following output:

Linux 4.19.23-Unraid.
Last login: Sat Mar 9 12:11:43 -0600 2019 on /dev/pts/0.
root@XXXXXXX:~# cd /mnt/user
root@XXXXXXX:/mnt/user# bash ./patch.sh
./patch.sh: line 2: $'\r': command not found
: invalid option nameet: pipefail
root@XXXXXXX:/mnt/user#

Is there something I need to modify in the script to get this to work with the linuxserver.io build? Perhaps the path to the driver or driver backup?

Any help would be appreciated. I've attached the patch.sh file that I'm using, but renamed to txt.
patch.txt

FreeBSD support

Could you possibly patch at least one version for the NVIDIA FreeBSD drivers to support?

eg vers 430.50 on FreeBSD x64 on Turing cards?

This would support FreeBSD/FreeNAS jails with media center clients.

Unable to install on 430.26

Describe the bug

$ sudo ./patch.sh
Something went wrong. Check nvidia driver

To Reproduce
Steps to reproduce the behavior:

  1. install nvidia driver .run-file
  2. check nvidia-smi, everythign works
  3. try to install patch
  4. nvidia-smi reports gpu not detected

Expected behavior
patch should install without issues

Output listings

$ sudo ./patch.sh
Something went wrong. Check nvidia driver

Environment (please complete the following information):

  • OS: Ubuntu 18.04.2 LTS
  • GPU model: Quadro P400 (x8 slot)
  • Patch commit used: 9fbe04e
  • Nvidia driver version: 430.26

Additional context
I'm also running an hauppauge PCIe TV card that requires a kernel patch, see here

Currently running kernel: 4.15.0-50201905291620-generic #0+mediatree+hauppauge-Ubuntu
edit: this is running on a VM on proxmox with PCIe passthrough, on a dell r710

[Question] Support for Windows

Any chance this patch can make its way to Windows? If so that would be greatly appreciated and well received. Primarily, plex doesn't allow decode on HW in LInux only encodes, but on windows you can encode/decode on HW with plex. So unlocked transcodes there would be awesome!

Does the ffmpeg 10 sessions trick support h265 as well?

Hello,

     I am curious if the ffmpeg 10 sessions trick also supports H265 as well. When I see it load I only see references to H264 sessions being loaded. If it already does support H265 and I do have the right idea to use it this way I hope to open sessions for H265 encodes/decodes as well. I hope I this possible as I have many H264 & H265 movies that always need real-time transcoding to H264/H265 vice versa etc. Do I even need to worry about this? I am sorry my knowledge of the ffmpeg script process for what is fully supported is limited and any help would be apprecieated. Also, sorry if I am asking about this in the wrong place, I did not know where else to ask :P

Working on Debian 9 Stretch?

So I got this working on Debian the only problem I had was figuring out how to get the source for the kernel to get the nvidia driver to compile.

Your patch and instructions were flawless except for how to install kernel source on debian. Could you maybe add this bit of instruction for debian users.

To install kernel source use
apt install linux-headers-$(uname -r)

So I can say for certain tested on Debian 9 Stretch as well. Below is a screen shot of nvidia-smi, on my server with a Quadro P1000

2019-07-20 (2)

Patch fails when attempting to use with vMix

Attempting to to use this patch for use with vMix software (on Windows 10 64-bit) but when trying to activate more than 2 NVENC sessions it fails. Is there any possibility of getting the patch to work with vMix?

vMix is a Live Streaming and Recording software and vMix includes some open source libraries.
FFMPEG
This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here FFmpeg was compiled using the following command line: ./configure --toolchain=msvc --enable-shared --disable-static --arch=amd64 --enable-zlib ./make

FFmpeg Command Line
This software utilises the FFmpeg command line software licensed under the GPLv3. Its source can be downloaded here The command line software incorporates x264 and libfaac, the source code and licenses for both can be found in the download above.

Invalid 1337-file

I have a ZOTAC 1050 TI GPU.
Windows 10 x64
Downloaded and installed the nvidia driver version 418.81
Rebooted.
Downloaded the patch tool version 1.9
Downloaded the 1337 file for 418.81

When trying to add the file to the tool, it sais the the 1337 file is invalid.
Am I doing something wrong?

Bash script says version is not supported, even though it is

I observe the following issue:

$ ./patch.sh
Detected nvidia driver version: 396.54
Patch for this (396.54) nvidia driver not found.
Available patches for:
390.87
396.26
396.24
410.48
415.25
415.18
375.39
410.57
410.73
396.54
410.78
410.79
396.37

Notice that the 396.54 is supported. However the script aborts with error.

$ lsb_release --all
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.3 LTS
Release:	12.04
Codename:	precise

$ bash --version
GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)

I'm not a bash expert, but I was able to fix this with the following patch:

$ git diff
diff --git a/patch.sh b/patch.sh
index 907225b..2a7550a 100755
--- a/patch.sh
+++ b/patch.sh
@@ -79,7 +79,7 @@ fi

 echo "Detected nvidia driver version: $driver_version"

-if [[ ! -v "patch_list[$driver_version]" || ! -v "object_list[$driver_version]" ]]; then
+if [[ ! "${patch_list[$driver_version]+isset}" || ! "${object_list[$driver_version]+isset}" ]]; then
     echo "Patch for this ($driver_version) nvidia driver not found." 1>&2
     echo "Available patches for: " 1>&2
     for drv in "${!patch_list[@]}"; do

Now it works flawlessly.

New driver support (version 435.27)

Please provide details about your environment (please complete the following information)

  • Nvidia driver version: [e.g. 410.48] 435.27
  • GPU Model: [e.g. GTX 1070] GTX 1080
  • OS: [e.g. Ubuntu 18.04] Win10 1903 x64
  • I'm willing to participate in testing of new patch version: Sure I am.

Stupid windows update overwrote the previus installed 430.xx-Version. Latest Patch seems to be incompatible, wrong offset.

Otherwise: Awesome work!

How do you determine these patches?

In your script, you're doing a sed on these encoded strings of some sort:

's/\x85\xC0\x89\xC5\x75\x18/\x29\xC0\x89\xC5\x90\x90/g'

Where's your entry point in searching for these things? Where can I start, what topics do I need to read on? The reason I ask, is because I'd like to do a patch to remove nvidia's sensitivity to virtualized environments. What is this string, and how did you start to find it?

Stuck in P-State P0 after transcode finished on NVIDIA ?

Hi,

I noticed that after running transcodes on plex, with hardware acceleration enabled (gpu), the p-state of my nvidia gtx 1070 gets stuck in P0 mode.
Because of this it is drawing a lot of power (more than while transcoding in P2…), and the fan is spinning up unnecessarily as well…

If I stop the plex media server, the p-state immediately gets back to P8 as it should be when idle.
Can you please do something with the transcoder to let the gpu return to P8 after having finished the transcoding?

Processes using the GPU while transcoding:

$ sudo fuser -v /dev/nvidia*
                     FELHASZNÁLÓ  PID HOZZÁFÉRÉS PARANCS
/dev/nvidia0:        root      12516 F.... nvidia-persiste
                     plex      16779 F.... Plex Media Serv
                     plex      18191 F...m Plex Transcoder
/dev/nvidiactl:      root      12516 F.... nvidia-persiste
                     plex      16779 F.... Plex Media Serv
                     plex      18191 F...m Plex Transcoder
/dev/nvidia-modeset: root      12516 F.... nvidia-persiste
/dev/nvidia-uvm:     plex      16779 F.... Plex Media Serv
                     plex      18191 F.... Plex Transcoder

Processes after transcoding has finished:

$ sudo fuser -v /dev/nvidia*
                     FELHASZNÁLÓ  PID HOZZÁFÉRÉS PARANCS
/dev/nvidia0:        root      12516 F.... nvidia-persiste
                     plex      16779 F.... Plex Media Serv
/dev/nvidiactl:      root      12516 F.... nvidia-persiste
                     plex      16779 F.... Plex Media Serv
/dev/nvidia-modeset: root      12516 F.... nvidia-persiste
/dev/nvidia-uvm:     plex      16779 F.... Plex Media Serv

Somehow Plex Media Server doesn’t let the GPU go…


+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26      Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    On   | 00000000:01:00.0 Off |                  N/A |
|  0%   47C    P8    14W / 151W |      1MiB /  8118MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

/*** Transcode begin ***/

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    On   | 00000000:01:00.0 Off |                  N/A |
|  0%   48C    P2    37W / 151W |    113MiB /  8118MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      8099      C   /usr/lib/plexmediaserver/Plex Transcoder     101MiB |
+-----------------------------------------------------------------------------+

/*** Transcode end ***/


+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    On   | 00000000:01:00.0 Off |                  N/A |
|  0%   53C    P0    38W / 151W |     11MiB /  8118MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Plex Teams says it's a Nvidia (430.26) / Kernel (stock 4.19) / OS interaction (Debian Buster) ...

Do you think it's a global bug ? Can you reproduce in your environnement ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.