general/other Freebsd Firefox Widevine for DRM playback in Rocky Linux Podman container


Freebsd Firefox Widevine for drm playback now working in a Rocky Linux Podman container

No Nvidia driver installed in the Podman container
works by mounting the Linuxulator directories for the Nvidia drivers from Freebsd to the Podman container

Hardware accelerated video playback

persistent Firefox settings stored on the Freebsd host so all your extensions,
bookmarks and settings are retained when you stop and restart the container

Wayland and Pulseaudio sockets for zero latency

The Podman container runs as the same user and id as on the Freebsd host
Downloads directory mounted from the Freebsd host to the podman container so you can upload and download files

Uses the DBUS_SESSION_BUS_ADDRESS from Freebsd so dekstop notifications also work
Picture in Picture so you can pop the video out and move it to your second monitor

I have Cuda working in Rocky Linux containers and nvenc encoding with ffmpeg as well
So i should be able to get anything that depends on Cuda working as well

Python applications like Whisperx, Stable Diffusion, Comfy UI
AI application like Ollama etc

Davinci Resolve, Handbrake

Working on a git repo so you can easily pull down all the files and build the containers
for different applications

Any suggestions for applications you would like to see

Only been back on Freebsd for about 2 weeks

To quote Russel Crow in Gladiator

Are you not entertained? Are you not entertained? Is this not why you are here?
 
NapoleonWils0n, good to see you back here, haven't seen you for awhile. I think I've mentioned to you that I have links to some of your dwl and Nvidia videos on a lot of my pages.
Cheers mate, im still running dwl

I did run the Cosmic desktop on nixos for a while, but you cant disable the animations when switching workspaces
so its not as fast as dwl
 
Easy mate

The advantage of the new method is that it you just click the button in the browser and it installs the plugin
so it wont break like other methods and you also have proper adblocking using ublock origin

Unlike using Chromium which has ublock origin lite that doesnt block all the video ads

The secret sauce is setting this in your shell config

export MOZ_DISABLE_GMP_SANDBOX=1

And then to get hardware acceleration working
in the browser url bar type

about:config

media.hardware-video-decoding.force-enabled

Change this from false to true.
This forces Firefox to use the preloaded NVIDIA paths for processing video frames rather than falling back to the CPU.

gfx.webrender.all

Change this from false to true. This forces Firefox's compositor layer to run fully accelerated via WebGL/NVIDIA.

restart firefox

Im using a podman container which means you can just pull down the files and build the container
Rather than having to build a jail and manually install all the packages

The Podman container is running Rocky Linux 9.3 the same as the Linuxulator
and mounts the Nvidia libraries from the Linuxulator inside the Podman container

So you dont have to install the Nvidia driver in the container like we did with jails
which was a pain because you had to manually install the exact same driver as on the Freebsd host

I just need to create a desktop entry for Freebsd that start the podman container and runs Firefox
rather than entering the container and launching Firefox from inside the container

Podman containers are actually oci jails,
so the same technique should work in a linux jail as well

drm.jpg


I also have Cuda working in Podman containers without using nv-sglrun

nvidia-smi

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.58.03 Driver Version: 595.58.03 CUDA Version: 13.2 |
+-----------------------------------------+------------------------+----------------------+

My new ffmpeg rust scripts which have a Freebsd binaries you can download
that use software encoding on Freebsd


But i have a ffmpeg Podman container that enables hardware encoding using nvenc
and mounts the bin directory into the container

So i can run the Linux version of my script which have nvenc support on Freebsd using Podman


Going to take a look at installing python applications that use Cuda

Will start with whisperx



If i can get whisperx working that should mean any python application will work
 
cheers mate,
lets get the old Anglo Italian partnership working again

I dont speak any Italian

but i have mastered an advanced British linguistic technique
that lets me communicate with anyone in the world without knowing their language

its called Point and Shout

im making progress with podman

for example i create a virtual environment to install whisperx in ~/.venv in the container
and ~/.cache is used to download the whisper models from huggingface

what im doing is creating persistent storage for directories in the podman container on the freebsd host

so i use a Makefile which you run on Freebsd with make

that creates a dotfiles directory in the same directory as the Dockerfile and the compose.yaml
with cache and venv subdirectories which are mapped to ~/.cache and ~/.venv in the container

in the compose.yaml these are then mounted as volumes from the freebsd host to inside the container
the podman container runs as your user and id so the files have the correct permissions on the host

Code:
      - ./dotfiles/cache:/home/${HOST_USER}/.cache:rw
      - ./dotfiles/venv:/home/${HOST_USER}/.venv:rw

The reason why you do this is because you have to run podman as root on freebsd
and if you dont create the directories on the freebsd host and let podman create them they will be owned by root:username

where username is you username

which then causes permission errors
so by creating the directories and file using the makefile on freebsd they are owned by your user

and so no permission issues

im just downloading python torch for whisperx
and then i can run a check to see if it can see Cuda

If the check works and python and see Cuda then we are in business

Makefile

Code:
#===============================================================================
# FILE: Makefile
# Project: Directory Initialization
#===============================================================================

.PHONY: all clean

# Direct paths matching your requirements
DOTFILES_DIR    := dotfiles
CACHE_DIR       := $(DOTFILES_DIR)/cache
HF_DIR          := $(CACHE_DIR)/huggingface
HF_TOKEN_FILE   := $(HF_DIR)/token
VENV_DIR        := $(DOTFILES_DIR)/venv

# Default target
all:
@mkdir -p $(CACHE_DIR)
@mkdir -p $(HF_DIR)
@mkdir -p $(VENV_DIR)
@touch $(HF_TOKEN_FILE)

# Clean target to wipe the structure out if you need to reset
clean:
rm -rf $(DOTFILES_DIR)
 
Back
Top