keylase / nvidia-patch

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Will this solution work for enabling GTX 670 to allow encoding during OBS streaming?

Yorisoft opened this issue · comments

Hello,

First off, great job to the team and thanks to everyone for helping out in advance.

My scenario is: I have an old PC with an NVIDIA GeForce GTX 670. I'm using this PC as the dedicated streaming PC. I use OBS and a capture card that feeds video to the streaming PC from the gaming PC. When I choose NVENC in OBS for video encoding, I get an error:

Failed to open NVENC codec: Function not implemented

Try installing the latest [NVIDIA driver](https://obsproject.com/go/nvidia-drivers).

Tried installing the latest driver for my GPU, driver version 470.

Thu Dec 14 09:58:28 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.223.02   Driver Version: 470.223.02   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 N/A |                  N/A |
| 31%   44C    P5    N/A /  N/A |    992MiB /  1998MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Still No luck.

My question is: Will this enable nvenc ability to for my GPU and allow me to use it in OBS?
If so, which patch ? @Snawoot

The hardware core (NVENC) used for encoding is missing on the GeForce 6xx series. It was introduced in Maxwell.

https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new

This patch is at software level bypassing driver enforced limits. Cannot fix missing hardware ;)

@Yorisoft I checked the Wikipedia page for NVENC and turns out Kepler GPUs (including yours) does have the HW.

Looks like Nvidia stopped supporting it in the latest drivers and dropped it from their support matrix page.

You might have to go back to very old drivers (and old versions of OBS) to check if it works there... let me know if you find a driver version where it works.

@jailuthra Thanks a ton!
I will be messing around with it till Im able to upgrade GPUs. I'll keep you posted.

Some mad-lad on the OBS thread made it work by using 450 driver on Ubuntu 21.10, but his solution did not work for me.
https://obsproject.com/forum/threads/nvidia-corporation-gk104-geforce-gtx-670-card-have-been-working-before-with-nvenc-for-streamout.153362/

I tried

apt purge nvidia*
apt intsall nvidia-driver-450

It still installed 470 as a dependency and when I run nvidia-smi and it still shows 470 as the driver version.

I know this issue is already closed, but as a Linux user and also as the owner of a Kepler GPU (GTX 660), I also suffer from the lack of hardware encoding on recent releases of OBS Studio.

See this response from an OBS dev on the matter:

Anyway, at its core, this issue is not that hard to solve, actually.

OBS Studio relies on FFmpeg libraries to do the NVENC encoding part (at least on Linux), so all we have to do is make a custom build of FFmpeg, built with a version of nv-codec-headers older than 12.0.

Now, if you don't know anything about compiling software, that's far from an easy task, and for that reason I've created my own "soft fork" of OBS Studio, with the sole purpose of automatically building a Flatpak package of OBS Studio that can still be used to do hardware encoded recording/streaming on Kepler GPUs.

I chose the Flatpak package because it's a packaging format officially supported by OBS devs, plus it should work flawlessly on virtually every Linux distribution.

You can grab the latest release from here (with instructions to install it too):

I recommend using the latest 470xx drivers.

I've been using it for almost two months now, with no issues so far.

So, feel free to give it a try, and report any issue you might find.