Using Nvidia GPU in official nextcloud docker container
Hello.
Is anyone managed to use Nvidia GPU in the official nextcloud:latest docker container? Can't find any manuals for it. I have T600 card and want to use it for memories and face recognition. I've already managed to use it in Plex, Unmanic, etc, but not sure how to use it inside nextcloud container.
I spent over a week trying to figure this out. You cant. The Nextcloud docker image is based on Debian which does not include a build of ffmpeg that works with nvenc.
Yep, you likely need to build ffmpeg from source. Unfortunately Nextcloud isn't really media-focused so can't expect the best support in the official docker images :(
@SuberSeb @relink2013
Hello.
Is anyone managed to use Nvidia GPU in the official nextcloud:latest docker container? Can't find any manuals for it. I have T600 card and want to use it for memories and face recognition. I've already managed to use it in Plex, Unmanic, etc, but not sure how to use it inside nextcloud container.
I spent over a week trying to figure this out. You cant. The Nextcloud docker image is based on Debian which does not include a build of ffmpeg that works with nvenc.
Try that Dockerfile (remove .txt extension). The base was created by Julien Rottenberd @JRottenberg.
This Dockerfile uses apache-nextcloud:25.0.3 image. You can change the number of version to "latest". Be careful while upgrade NC and do not jump over the next major version like 24 to 25 to avoid crashing your NC instance with no way to restore.
Just take in account different pathways to ff*. Use that when you tune ./config/config.php file:
'memories.ffmpeg_path' => '/usr/local/bin/ffmpeg',
'memories.ffprobe_path' => '/usr/local/bin/ffprobe',
I spent more than two weeks messing around with ffmpeg to get this to work and I do not know if there is any better way of doing this. But I am running nextcloud with the official docker image and wanted to use my nvidia gpu (gtx 1080) So I used a multistage docker build approach. With the idea provided by @pulsejet previously, in one stage I built ffmpeg from source with the proper nvidia flags -- can follow guide here: nvidia docs. I also copied the needed drivers from the nvidia cuda docker image (this step might not be needed) into the nextcloud image. Bringing all of this into the nextcloud docker image and updating the memories config to use my provided vod and ffmpeg build worked. I personally ran into an issue with transcoding HDR media, specifically from ios devices. So to solve this, I manually edited the go-vod project and included additional transcoding parameters for mapping HDR content. (I do not think this is an issue any longer, just make sure to clone the most recent version of go-vod manually to ensure the newest version is available).
@JSchpp12 HDR was never fixed (#406), so either ffmpeg fixed this itself, or those parameters might be valuable.
I spent over a week trying to figure this out. You cant. The Nextcloud docker image is based on Debian which does not include a build of ffmpeg that works with nvenc.
I build images for docker bankaitech/nextcloud:latest My images are based from nextcloud:production