Skip to content
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

feat: Add vaapi packages to enable hardware-accelerated playback #44

Merged
merged 3 commits into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,38 @@ RUN KERNEL_VERSION="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}
rpm-ostree install \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm \
&& \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/rpmfusion-free{,-updates}.repo \
&& \
rpm-ostree install \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \
kernel-devel-${KERNEL_VERSION} nvidia-container-toolkit \
"/tmp/akmods/${NVIDIA_PACKAGE_NAME}/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_FULL_VERSION#*:}.rpm" \
/tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons-*.rpm \
&& \
rpm-ostree override remove $(rpm -qa --queryformat='%{NAME} ' \
mesa-va-drivers \
libavutil-free \
libswscale-free \
libswresample-free \
libavformat-free \
libavcodec-free \
libavfilter-free \
libavdevice-free \
libpostproc-free) \
--install=mesa-va-drivers-freeworld \
--install=mesa-vdpau-drivers-freeworld \
--install=libva-intel-driver \
--install=nvidia-vaapi-driver \
--install=ffmpeg-libs \
--install=ffmpeg \
--install=libavcodec-freeworld \
joshua-stone marked this conversation as resolved.
Show resolved Hide resolved
--install=libva-utils \
&& \
mv /etc/nvidia-container-runtime/config.toml{,.orig} && \
cp /etc/nvidia-container-runtime/config{-rootless,}.toml \
&& \
semodule --verbose --install /usr/share/selinux/packages/nvidia-container.pp \
&& \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/rpmfusion-nonfree{,-updates}.repo \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/rpmfusion-{,non}free{,-updates}.repo \
&& \
ln -s /usr/bin/ld.bfd /etc/alternatives/ld && \
ln -s /etc/alternatives/ld /usr/bin/ld \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ $ podman run \
docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1
```

## Video playback

Additional runtime packages are added for enabling hardware-accelerated video playback. [Some additional configuration may be needed to enable support in flatpak](https://github.com/elFarto/nvidia-vaapi-driver/issues/23).

## Acknowledgements

Thanks to Alex Diaz for advice, and who got this working first, check out this repo:
Expand Down