-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Videos: Official Nvidia transcoding suppport #2125
Comments
Here is the respective version information of ffmpeg. 2022-01-21
2022-03-02
|
For anyone who wants a temporary fix, the Here is how to add it to a custom Dockerfile:
Here is the final result:
|
Our default image now ships with the version in that comes with Debian 11: https://packages.debian.org/ However, We still provide an Ubuntu based image, check Docker Hub: https://hub.docker.com/r/photoprism/photoprism/tags?page=1&name=impish Did you follow the instructions in our Docker Compose example? https://dl.photoprism.app/docker/docker-compose.yml In particular, you need to uncomment this and restart:
Also make sure to share all necessary devices, for example:
You can also manually install packages in the container as needed. |
Note we never had official Nvidia support, so I don't consider this a bug. |
h264_nvenc
encoder
The https://github.com/photoprism/photoprism/blob/develop/scripts/dist/install-gpu.sh#L36 |
Thank you @lastzero. Sorry for misidentifying this as a bug. I'll give As always, much appreciated for the quick response. |
Thanks for this. Installing from the testing repo includes the required code for ffmpeg to work. I tried using gpu for PHOTOPRISM_INIT, but while that did install the nvidia libraries it did not have the version of ffmpeg with nvenc compiled. |
- successfully tested with NVIDIA Quadro P620 and driver v470.103.01 - the host Linux kernel should run the same driver version Make sure to - driver names in PHOTOPRISM_FFMPEG_ENCODER have been simplified - share /dev/nvidia* as shown in our new docker-compose.yml example
Development Preview has been updated for testing:
|
Adds the following video-related libs to the ARMv7 base image: libwebm1, libmatroska7, libdvdread8, libebml5, libgav1-0, libatomic1, libx264-163, libx265-199
Also installs the following, additional packages: - libcuda1 - libnvcuvid1 - mesa-va-drivers
For the simplified part, I wonder how to indicate the encoder? I successfully install the |
The ffmpeg commands I tried:
All triggered GPU to accelerate the process ffmpeg info
|
With the preview version of image
Tho ENV looks right
but config looks weird. It uses
When I tried
it can utilize GPU without any issue. Not sure why |
Are you a sponsor, the ffmpeg-encoder is a sponsor only config option ? |
oh wow. Did not notice the sponsor part. Let me check that up 😅 |
You find more information on sponsorship options here: https://photoprism.app/membership :) |
Is there a way to specify the NVIDIA driver version? When I start the container I get:
And when I start to watch a video via the web-ui:
It fails back to cpu transcode. Thanks for the great work so far! |
We'd probably have to build a special Unraid image for this as the version depends on the base image. |
Is there currently a way to get this to work? Starting up I receive the same error
|
As far as I know, NVIDIA ships a binary (proprietary) kernel module, so the versions must match exactly. However, it is impossible to know at build time which version(s) our users have (it won't be just one anyway). The only solution I see at the moment is to open a terminal (as root via docker exec or docker-compose exec...) and install the correct module manually - from the NVIDIA server if Ubuntu/Debian don't provide it directly. If you would like to contribute, it would be great if you improve our scripts so that the user can select the correct version via photoprism/scripts/dist/install-gpu.sh Lines 62 to 64 in fd27f88
|
I can take a look. I am curious though could you just use Nvidia's native docker integration? I believe it can handle mounting the GPU and whatever drivers the host has inside the container for you: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html#driver-capabilities For instance with Plex I simply put a |
Feel free to do some research on this! Does Plex use FFmpeg or does it have "native" encoders? This "Docker integration" looks like a separate Docker image to me, so we would have to change our entire build process to run PhotoPrism in it. Note that PhotoPrism can (theoretically) use the GPU for video transcoding, Darktable, and TensorFlow. What happens if they all access the device at the same time? I have no idea, so I'd appreciate help from those who actively use this :) |
From the NVIDIA documentation:
So it seems that they have added a Docker "plugin" that automatically configures container images as needed. This is a (much) more advanced approach than the existing init script, e.g. they automatically detect the version, while our init script installs the default drivers. However, the toolkit must be installed and configured on the host (which maybe not everyone has?): |
If the CPU load is still very high, maybe something is missing....
There's a reason we only offer hardware transcoding to our sponsors, because it eats up time like nothing else. That being said, make sure you enable sponsor features for it to work! 👍 |
I have added a follow up issue and hope someone can take care of it as our time will still be very limited over the next few months: |
What does not work as described in the documentation?
Up to the last 2022-01-21 release, it was possible to specify the
h264_nvenc
encoder to ffmpeg for GPU-based transcoding with Nvidia cards.The latest 2022-03-02 release no longer offers a version of ffmpeg with that capability.
How can we reproduce it?
Here are the verification steps in 2022-03-02:
Notice how
h264_nvenc
is not part of that list.What behavior do you expect?
Here are the exact same steps in 2022-01-21:
What could be the cause of your problem?
The ffmpeg version packaged in the 2022-03-02 was not compiled with support for
h264_nvenc
encoder.Can you provide us with example files for testing, error logs, or screenshots?
Available to provide more information if needed
Which software versions do you use?
Available to provide more information if needed
On what kind of device is PhotoPrism installed?
Available to provide more information if needed
Do you use a Reverse Proxy, Firewall, VPN, or CDN?
None
The text was updated successfully, but these errors were encountered: