Solved Davinci Resolve running on Freebsd using the linuxulator the GPU is working but full

i can only write instructions for the programs i know and use
and i only add instructions i have tested myself

i dont want to get sidetracked writing instructions for basic shell use

if you dont do the donkey work you get get a carrot
 
unlike Donald Trump im thick skinned

all the how to guide and tutorials i have posted on the forum work
there is a reason for that because i put in the donkey work

i wouldnt have got davinci resolve almost working if i didnt know what i was doing
 
on freebsd the pulseaudio configs are in

Code:
/usr/local/etc/pulse

which contains a default.pa config for pulseaudio

the user location of the pulseaudio config file is

Code:
~/.config/pulse/

which on my system doesnt have a default.pa config file

looking at this article


it suggests adding the following code to ~/.config/pulse/default.pa

Code:
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

to enable tcp acess on localhost

ill have to check whats in the /usr/local/etc/pulse/default.pa

and copy it to ~/.config/pulse

and try and enable access to the pulseaudio server on the host from the chroot
 
taking a look at the default pulseaudio configs on the freebsd host

my hunch is there is a something that needs to be set in the pulseuaudio
either in the client.conf or default.pa to enable access from the chroot

and its just a matter of flipping that setting and copying the config to ~/.config/pulse on the freebsd host

time to rtfm and look through the options, yay

pulseaudio client.conf

Code:
/usr/local/etc/pulse/client.conf

client.conf

Code:
; default-sink =
; default-source =
; default-server =
; default-dbus-server =

; autospawn = yes
; daemon-binary = /usr/local/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

pulseaudio default.pa

Code:
/usr/local/etc/pulse/default.pa

default.pa

Code:
#!/usr/local/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/local/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### FreeBSD devd is used in addition to static detection (only handles hotplug)
.ifexists module-devd-detect.so
load-module module-devd-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif


### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /usr/local/etc/pulse/default.pa.d
 
getting close

started pulseaudio on the host

Code:
pulseaudio --start

started pulseaudio in the chroot

Code:
pulseaudio --start

playing a video in the timeline in resolve and you can see the audio meters going up and down
however the sound isnt routed from the chroot to the host

been looking at pulseaudio cookies and sockets
have to keep experimenting

resolve-pulse.png
 
i think it might be the /var/run/user/1001/ directory

$XDG_RUNTIME_DIR is setting the location to /var/run/user/1001/

on the freebsd host this is the location where pulseaudio socket will be

Code:
 /var/run/user/1001/pulse

i pinched some code from the linux browser install script

Code:
#!/bin/sh

get_pa_sock_path()
{
    PA_SOCK_PATH=$(sockstat | awk -v me=$(whoami) -F'[ \t]+' '
        $1 == me && $2 == "pulseaudio" && $6 ~ /native/ {
            print $6;
            exit 0
        }'
    )
}

get_pa_sock_path
if [ ! -S "$PA_SOCK_PATH" ]; then
    while killall pulseaudio; do
        sleep 0.5
    done
    pulseaudio --start
    get_pa_sock_path
fi
[ -S "$PA_SOCK_PATH" ] && export PULSE_SERVER=unix:$PA_SOCK_PATH

when i run this script it creates a file called native which is the socket and a pid file
running pulseaudio --start does the same thing so script not needed

list pulse directory on the host

Code:
ls -l /var/run/user/1001/pulse

Code:
total 1
srwxrwxrwx  1 djwilcox djwilcox 0 20 Feb 18:29 native
-rw-------  1 djwilcox djwilcox 6 20 Feb 18:29 pid

i had to create the /var/run/user/1001/ in the chroot

list the same directory in the chroot and its empty

so because /var isnt mounted in the chroot from the host
it cant see the pulseaudio server socket

/tmp is mounted from the host in the chroot
so can we create the pulseaudio socket there

also pulseaudio needs to be started on both the host and the chroot

think i have narrowed down the source of the problem

so the solution seems to be

1 - create the pulseaudio socket in /tmp which the chroot can access

2 - modify the ubuntu rc.d linuxulator script so it mounts /var in the chroot
not sure you would want to mount the entire /var directory in the chroot

another option might be to mount the var run pulse directory from the host to the chroot

Code:
/var/run/user/1001/pulse /compat/ubuntu/var/run/user/1001/pulse

ill try option 1 first
 
found an interesting post


If you want to use a non-standard socket location, pass the "socket" option to module-native-protocol-unix
and set "default-server = /path/to/socket" in client.conf so that clients find the socket.

like this

Code:
.ifexists module-native-protocol-unix.so
module-native-protocol-unix socket=/tmp/pulseaudio.socket
.endif

or this

Code:
module-native-protocol-unix socket=/tmp/pulseaudio.socket

looking at default.pa it contains this

Code:
### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /usr/local/etc/pulse/default.pa.d

the /usr/local/etc/pulse/default.pa.d doesnt exist by default

so you have to create it

Code:
sudo mkdir -p /usr/local/etc/pulse/default.pa.d

then add the .pa files to that directory
default.pa doesnt seem to be picked up in ~/.config/pulse/default.pa when you run pulseaudio --start

im just not sure which file this code

Code:
module-native-protocol-unix socket=/tmp/pulseaudio.socket

has to go in

if you look in the default pulse directory

Code:
ls -l /usr/local/etc/pulse

these are the config files

Code:
-rw-r--r--  1 root wheel 1207  6 Jan 02:47 client.conf
-rw-r--r--  1 root wheel 1207  6 Jan 02:47 client.conf.sample
-rw-r--r--  1 root wheel 2436  6 Jan 02:48 daemon.conf
-rw-r--r--  1 root wheel 2436  6 Jan 02:48 daemon.conf.sample
-rw-r--r--  1 root wheel 4607  6 Jan 02:48 default.pa
-rw-r--r--  1 root wheel 4607  6 Jan 02:48 default.pa.sample
-rw-r--r--  1 root wheel 2329  6 Jan 02:48 system.pa
-rw-r--r--  1 root wheel 2329  6 Jan 02:48 system.pa.sample

question is does the socket code need to be in the default.pa, system.pa or the daemon.conf
so that when you start pulseaudio as a user with pulseaudio --start it creates the socket in the /tmp directory
which can be accessed by the chroot

client.conf

Code:
default-server = /tmp/pulseaudio.socket

and copy the client.conf to the chroot

CSS:
cp client.conf /compat/ubuntu/home/djwilcox/.config/pulse
 
got the socket created in /tmp

on the freebsd host
created a default.pa in

Code:
~/.config/pulse/default.pa

with this code with the socket location

Code:
#!/usr/local/bin/pulseaudio -nF

# include default.pa and override
.include /usr/local/etc/pulse/default.pa

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket

starting pulseaudio

Code:
pulseaudio --start

now to try using the client.conf in the chroot to use the socket
 
after starting pulseaudio on the freebsd host

Code:
pulseaudio --start

it creates the socket in /tmp/pulseaudio.socket

in the client.conf

Code:
/compat/ubuntu/home/djwilcox/.config/pulse/client.conf

i have this

Code:
; default-sink =
; default-source =
default-server = /tmp/pulseaudio.socket
; default-dbus-server =

; autospawn = yes
; daemon-binary = /usr/local/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

with the server set to /tmp/pulseaudio.socket

in the chroot with puseaudio not started when i run

Code:
pactl info

it output this

Code:
Server String: /tmp/pulseaudio.socket
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 0
Tile Size: 65472
User Name: djwilcox
Host Name: pollux
Server Name: pulseaudio
Server Version: 16.1
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: oss_output.dsp1
Default Source: oss_input.dsp0
Cookie: 4736:0356

but like i said pulseaudio isnt running in the chroot
and so no audio resolve and the volume meters arent moving

if i try and start pulseaudio in the chroot with pulseaudio run on the host
i get an error saying

Code:
N: [pulseaudio] main.c: User-configured server at unix:/tmp/pulseaudio.socket, refusing to start/autospawn.

what i need to figure out is how to plumb pulseaudio in the chroot
to pulseaudio on the host using a socket

making slow progress
 
Mission Accomplished

Mission_Accomplished_banner_on_the_USS_Abraham_Lincoln_(CVN-72)_(1).jpg


Davinci Resolve on Freebsd running in an ubuntu chroot with nvidia, cuda,
and pulseaudio working displayed in a Xwayland window on the Freebsd host

I have to write up the documentation, create a git repo
do a screen recording with obs and edit the video with Davinci Resolve on Freebsd

It will take a few days to a week
so hang on and save any tech questions until after i post the video on the forum

coming soon to a youtube channel near you from beastie productions

Davinci Resolve on Freebsd with the Linuxulator

 
thanks for the thumbs up guys

you can specify a size for an xwayland window
using the geometry option

this create a 1920x1080 window

Code:
Xwayland -geometry 1920x1080 :01

xwayland also has a fullscreen option

Code:
Xwayland -fullscreen -geometry 1920x1080 :01

resolve can either be displayed on a single monitor

or use a dual monitor setup so you can have the timeline on one display
and a full screen preview on another display for example

we can create a window that spans both your monitor
by specify a width of 3860

Code:
Xwayland -geometry 3860x1080 :01

that should let us have resolve displayed on both displays

the window does cover both displays on dwl
but it difficult to work with and can just snap back to displaying the window on one screen

for wlroots compositor there is a wayland version of xrandr called wlr-randr

Code:
wlr-randr

have to look to see if we can create a xwayland rootfull window that spans 2 displays
and position it with wl-randr

another tool that might be worth a look is xwayland-run

Code:
xwayland-run-0.0.2             Run Xwayland and compositor headless
 
important note
you need to use the -host-grab option with xwayland

Code:
Xwayland -host-grab -geometry 1920x1080 :01

fullscreen 1920x1080

Code:
Xwayland -host-grab -fullscreen -geometry 1920x1080 :01

otherwise you cant click inside resolve to switch between the the tabs at the bottom
eg switch between the edit view, fairlight and fusion

that way it grabs the input properly
and you press ctrl + shift to regain control of the mouse on the host

very similar to using a vm with virt manager
 
just did a quick edit and export of Big Buck Bunny and everything worked

i did notice in the export option there was DNXHD and uncompressed
but i didnt see prores

ffmpeg is installed on ubuntu
just wondering if its a missing codec

no prores is installed

Code:
ffmpeg -codecs

ffmpeg codecs output

Code:
 DEVIL. prores               Apple ProRes (iCodec Pro) (encoders: prores prores_aw prores_ks )

i imported a pro res clip into resolve no issues

i could have sworn there was a pro res export on linux,
maybe i was wrong

will have to do some more research

looks like Davinci Resolve 18 only has pro res export
if you have the DaVinci Resolve Advance Panel dongle

which costs money

so you can import pro res but cant export as pro res without the dongle

not too much of an issue you can export as DNXHD or uncompressed (which will be a huge file)
and then convert the footage to h264 with ffmpeg or handbrake

the free version of resolve doesnt support h264/aac on linux
and the paid version supports importing h264 video but not aac audio on linux

another thing to note is DNXHD only allows you to export at certain resolutions
like 1920x1080

so if you want a export at a custom resolution
you either have to export as uncompressed or try another codec
 
launching resolve chroot experiments

in the the chroot we have the same user as on the host
with the same id so there are no permission issue

you can chroot into ubuntu with sudo

Code:
sudo chroot /compat/ubuntu /bin/bash

and you will be logged in as root
you can then switch to your user like this

Code:
su - djwilcox

thats work perfectly
and picks up the settings from the zshenv and pulseaudio config

which let you launch resolve and route the audio from the chroot to the host

i also copied the pulse cookie from the host to the chroot which only needs to be done once

Code:
cp ~/.config/pulse/cookie /compat/ubuntu/home/djwilcox/.config/pulse/cookie

you can also chroot without sudo
by setting the following in your /etc/sysctl.conf

Code:
security.bsd.unprivileged_chroot=1

you can then enter the chroot without sudo using the -n option

Code:
chroot -n /compat/ubuntu /bin/bash

but the problem is that actually logs in as the user on the host
so it use the config from the host which isnt what we want

because the chroot needs a different setting for the display
and also has a different pulseaudio config

the chroot command also has a -g and -n option
but they are related to the user and group on the host and not in the chroot
so cant be used to switch to the user in the chroot

Code:
-g group              Run the command with the permissions of the
                      specified group.

-u user               Run the command as the user.

the reason this is important is because its to do with how you launch resolve

at present these are the steps i use to lauch resolve

start pulseaudio on the freebsd host

Code:
pulseaudio --start

create the xwayland window for resolve
host grab to grab mouse input from the host 1920x1080 fullscreen

Code:
Xwayland -host-grab -fullscreen -geometry 1920x1080 :01

chroot into the with sudo
we could use doas on freebsd and create a rule that will let us run doas chroot and not be prompted for a password

/usr/local/etc/doas.conf

Code:
permit nopass :djwilcox cmd chroot

so we can enter the chroot without being prompted for our password

Code:
doas chroot /compat/ubuntu /bin/bash

enter the chroot

Code:
sudo chroot /compat/ubuntu /bin/bash

then switch to my user

Code:
su - djwilcox

start pulseaudio

Code:
pulseaudio --start

and finally launch resolve

Code:
/opt/resolve/bin/resolve

you can also use doas on ubuntu

just thought id mention the current way im launching resolve
 
Xephyr can be used on X11 to create a nested window

Code:
Xephyr -br -ac -noreset -screen 1920x1080 :1


so you can forward the display from the chroot to an X11 host and display it in Xephyr window
just like you would with Xwayland

that means Davinci Resolve can run on both Wayland and X11 on Freebsd
using either Xwayland on Wayland or Xephyr on X11

Pressing Ctrl+Shift should lock/unlock your mouse pointer and your keystrokes inside Xephyr window exclusively if possible.

which is needed so the mouse works in resolve
 
next challenge create a virtual monitor in the chroot
so we can have 2 displays for resolve

we create the main window on freebsd using Xwayland or Xephyr at 1920x1080

we could use then Xephyr or xnest in the chroot to create a virtual monitor
and use xrandr to poistion the new virtual monitor to the left or right of the first window

you can actually use xrandr in the chroot to change the size of the Xwayland or Xephyr window on the Freebsd host

so in theory it should work

right the issue is display :1 is already created
and we cant create display :2 because the DISPLAY variable only supports 1 display and already points to display :1 on the host

so can we create a virtual display to mimic plugging in another monitor
but use the current screen id of :1
 
creating a launcher for resolve

use doas without a password to chroot into ubuntu and then run a script inside the chroot
instead of /bin/bash

Code:
doas chroot /compat/ubuntu /usr/local/bin/wrapper

wrapper script

Code:
#!/bin/bash

su - djwilcox

when we chroot in ubuntu it runs the script and switches to our user in the chroot
so in the script we can set it to launch resolve

then on the freebsd host we have a desktop entry
which then contains the the doas code above which enters the chroot and launches resolve

so the final wrapper script would look something like this

Code:
#!/bin/bash

# switch to our user
su - djwilcox

# start pulseaudio
pulseaudio --start

# start resolve
/opt/resolve/bin/resolve

and the desktop launcher for resolve on freebsd would look like this

Code:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=DaVinci Resolve
Exec=sh -c 'doas chroot /compat/ubuntu /usr/local/bin/wrapper'
Icon=/opt/resolve/graphics/DV_Resolve.png
Terminal=false
MimeType=application/x-resolveproj;
StartupNotify=true
Categories=AudioVideo

actually what we do is point the desktop launcher to a script on freebsd
that creates the xwayland window, starts pulseaudio

then chroots into ubuntu runs the wrapper script which launches resolve

that will create the xwayland window on the host launch resolve in the chroot and display it on the host
so we can automate the whole process
 
figure out how to start pulseaudio on the freebsd host
and have it automatically work in the chroot

freebsd host

Code:
pulseaudio --start --daemonize

using a default.pa on the freebsd we create a pulseaudio.socket in /tmp

Code:
~/.config/pulse/default.pa

with the code that creates the socket

Code:
#!/usr/local/bin/pulseaudio -nF

# include default.pa and override
.include /usr/local/etc/pulse/default.pa

# chroot
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket

then in the chroot we have a client.conf

Code:
~/.config/pulse/client.conf

that points to the default-server = /tmp/pulseaudio.socket

Code:
; default-sink = oss_output.dsp1
; default-source =
default-server = /tmp/pulseaudio.socket
; default-dbus-server =

; autospawn = yes
; daemon-binary = /usr/local/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

so after you start pulseaudio on the freebsd
the audio in the chroot is piped into the host over the socket

yay
 
resolve script for freebsd that starts pulseaudio and creates the xwayland window

Code:
#!/bin/sh

# start pulseaudio
pulseaudio --start --daemonize

sleep 1

# create the xwayland window
Xwayland -host-grab -fullscreen -geometry 1920x1080 :01

that works

if i then chroot with doas

Code:
doas chroot /compat/ubuntu /bin/bash

then switch to my user

Code:
su - djwilcox

in the ~/.zshenv in the chroot i set the path to include the resolve bin driectory

Code:
# Path
typeset -U PATH path
path=("/opt/resolve/bin" "$path[@]")
export PATH

that way i can just type resolve to launch davinci

Code:
resolve

instead of the full path which is

Code:
/opt/resolve/bin/resolve

so to launch resolve in the chroot
we need to switch to our user and run resolve

Code:
su - djwilcox
resolve

so how do we automate those 2 steps

i can chroot and run the script at the same time

Code:
doas chroot /compat/ubuntu /usr/local/bin/wrapper

wrapper code
to switch to our user and launch resolve

Code:
#!/bin/bash

# switch to our user
su - djwilcox

sleep 1

# start resolve
/opt/resolve/bin/resolve

that switchs to my user but starts resolve as root
because the script was originally run as root

so instead of switching to the user in the script

i need to find a way to run resolve as my user in the chroot and not root

once i figure that out we can put the 2 scripts together
and we have a way launch resolve from freebsd by chrooting in and opening resolve

you must all think im some nutter talking to myself
however it does help me figure out the steps

Code:
su djwilcox 'echo "hello from $USER"'

hello from djwilcox

so that might be a solution

the issue is the username is hardcoded

so either you would have to get people to alter the script to add their username
or find a way to grab the username

idea for script in the chroot

Code:
su djwilcox -c '/opt/resolve/bin/resolve'
 
Eureka

freebsd launcher script that opens resolve from the chroot

resolve script which is run on freebsd does the following

1 - starts pulseaudio as a daemon
2 - creates the xwayland window
3 - chroots into ubuntu without a password using doas
4 - runs resolve as our user and not as root

resolve then opens in the xwayland window on freebsd
and the audio is piped over the pulseaudio socket from the chroot into the host

so all i need to do is create a desktop entry that calls the resolve script on freebsd
and it will open like a native app

resolve script on freebsd

Code:
#!/bin/sh

# start pulseaudio
pulseaudio --start --daemonize

# sleep
sleep 1

# create the xwayland window
Xwayland -host-grab -fullscreen -geometry 1920x1080 :01 &

# chroot with doas
doas chroot /compat/ubuntu /usr/local/bin/wrapper-resolve

wrapper-resolve script in the chroot

Code:
#!/bin/bash

# switch to our user
su djwilcox -c '/opt/resolve/bin/resolve' 2>/dev/null

theres no problem that cant be solved with more tea and biscuits
 
Freebsd Davinci Resolve desktop entry complete

now i can open Davinci Resolve with my application launcher on freebsd

Code:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=DaVinci Resolve
Exec=/usr/local/bin/resolve
Icon=/compat/ubuntu/opt/resolve/graphics/DV_Resolve.png
Terminal=false
MimeType=application/x-resolveproj;
StartupNotify=true
Categories=AudioVideo

everything is done

i couldnt work out how to create a second display for resolve
so at the moment resolve opens in a single window

but resolve in a single window is better than no window at all
 
How to get ready for Davinci Resolve on Freebsd

You need to make sure nvidia and cuda are working on Freebsd
you can watch the video on this page for all the steps


note the fix for with-glibc-shim mentioned in the post is no longer needed as the typo has been fixed

required packages on freebsd

Code:
sudo pkg install nvidia-driver linux-nvidia-libs libc6-shim libvdpau-va-gl libva-nvidia-driver

/etc/rc.conf

kld list for my dell xps 15 2019

Code:
# kld list
kld_list="nvidia-modeset nvidia-drm linux linux64 i915kms"

make sure you have created the xdg runtime directory on freebsd

Code:
sudo mkdir -p /var/run/user/1001
sudo chown -R username:1001 /var/run/user/1001
sudo chmod 700 /var/run/user/1001

replace user with your username in the above
and the id with your user id which you can find by running id

Code:
id

my output

Code:
uid=1001(djwilcox) gid=1001(djwilcox) groups=1001(djwilcox),0(wheel),5(operator),44(video),47(realtime)

export the xdg runtime directory in your shell config
for zsh use the follow code, if you use another shell adjust the command

Code:
export XDG_RUNTIME_DIR="/var/run/user/`id -u`"

Code:
nv-sglrun nvidia-smi

should output

Code:
shim init
Thu Feb 22 23:09:55 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.146.02             Driver Version: 535.146.02   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 GTX 1650        Off | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P8               1W /  50W |      2MiB /  4096MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
+---------------------------------------------------------------------------------------+

those are the general steps but watch the video and it should make sense

you can look at my config files for reference

freebsd root dotfiles


freebsd dotfiles

 
Not sure if this will work for the automation of wayfire instead of dwl using the csh shell :

Code:
mkdir ~/.cache/run
chmod 700 ~/.cache/run

nano /home/marietto/.cshrc :

setenv XDG_RUNTIME_DIR=~/.cache/run
#setenv XDG_RUNTIME_DIR=/var/run/user/`id -u`
setenv GTK_THEME Nordic-v40
setenv GDK_BACKEND wayland
setenv QT_QPA_PLATFORM wayland
setenv QT_QPA_PLATFORMTHEME qt5ct
setenv LC_ALL it_IT.UTF-8
setenv LANG it_IT.UTF-8

nano /home/marietto/.xinitrc

setxkbmap it
exec ck-launch-session dbus-launch --exit-with-session wayfire -c ~/.config/wayfire/wayfire.ini
 
II 23-02-24 14:17:54.853 - [src/main.cpp:334] Starting wayfire version v0.8.0
II 23-02-24 14:17:54.853 - [libseat] [libseat/libseat.c:77] Seat opened with backend 'seatd'
II 23-02-24 14:17:54.853 - [libseat] [libseat/backend/seatd.c:212] Enabling seat
II 23-02-24 14:17:54.853 - [backend/session/session.c:109] Successfully loaded libseat session
II 23-02-24 14:17:54.855 - [backend/session/session.c:473] Waiting for a DRM card device
EE 23-02-24 14:18:04.947 - [backend/backend.c:217] Found 0 GPUs, cannot create backend
EE 23-02-24 14:18:04.947 - [backend/backend.c:390] Failed to open any DRM device
EE 23-02-24 14:18:04.947 - [src/main.cpp:134] Fatal error: Segmentation fault
EE 23-02-24 14:18:04.948 - #1 0x363b40 <main+0x1580> at /usr/local/bin/wayfire
EE 23-02-24 14:18:04.948 - #2 0x82ae0053f <pthread_sigmask+0x53f> at /lib/libthr.so.3
EE 23-02-24 14:18:04.948 - #3 0x82adffafb <pthread_setschedparam+0x83b> at /lib/libthr.so.3
EE 23-02-24 14:18:04.948 - #4 0x820de82d3 <???> at ???
EE 23-02-24 14:18:04.948 - #5 0x82356b5d4 <wlr_backend_get_drm_fd+0x4> at /usr/local/wlroots016/lib/libwlroots.so.11
EE 23-02-24 14:18:04.948 - #6 0x362a3a <main+0x47a> at /usr/local/bin/wayfire
EE 23-02-24 14:18:04.948 - #7 0x82954bafa <__libc_start1+0x12a> at /lib/libc.so.7
 
Back
Top