datarhei / restreamer

The Restreamer is a complete streaming server solution for self-hosting. It has a visually appealing user interface and no ongoing license costs. Upload your live stream to YouTube, Twitch, Facebook, Vimeo, or other streaming solutions like Wowza. Receive video data from OBS and publish it with the RTMP and SRT server.
https://docs.datarhei.com/restreamer/
Apache License 2.0
3.92k stars 448 forks source link

Allow Nvidia and CUDA versions 555.xx/12.x #794

Open PGNickerson opened 3 months ago

PGNickerson commented 3 months ago

I currently use restreamer to output streams to YT/FB/Twitch simultaneously, and that works flawlessly, however, I've been unable to get NVENC to work for transcodes, and I've been stuck doing CPU transcodes for twitch, which isn't ideal. Looking into it, the docker image for cuda requires nvidia drivers==470.xx and CUDA>=11.7, a combination that is incredibly tricky to get for me as my machine runs arch and, while installing both 470.xx drivers and CUDA 11.7 is possible, nvidia-smi still gives CUDA 11.4 and thus docker doesn't even install the nvidia package to the container, giving me:

$ nvidia-smi
Thu Aug  1 17:20:18 2024
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.256.02   Driver Version: 470.256.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:27:00.0 Off |                  N/A |
|  0%   39C    P8     2W / 250W |     18MiB /  7979MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       887      G   /usr/lib/Xorg                      16MiB |
+-----------------------------------------------------------------------------+
# docker exec core nvidia-smi
OCI runtime exec failed: exec failed: unable to start container process: exec: "nvidia-smi": executable file not found in $PATH: unknown

Is there a technical reason why the requirements for restreamer list nvidia 470.xx explicitly and not allowing newer versions of the driver? If so, I understand. It seems the solution to my specific problem (which mostly has to do with arch, most likely, as I haven't tested on other distros yet) would be to allow for newer versions of the driver/CUDA

ioppermann commented 2 months ago

nvidia-smi tells you what is installed on your host system, not in the docker container. It seems that your installed drivers and libraries are older than the ones from the restreamer image. If the host system has newer drivers installed, it should work, even if the restreamer images has been built with an older version.