Python on Freebsd is in a bit of a sorry state
For work i have been trying various methods to install ComfyUI
github.com
Vermaden wrote a guide a couple years ago for installing Stable Diffusion on Freebsd
github.com
However the issue is the linux-miniconda-installer package
hasnt been updated since 2023-10-23 11:27:43
and uses python 3.9
www.freshports.org
which is too old to run a lot of the most recent python applications like ComfyUI
The linux-miniconda-installer package uses the linuxulator bash shell with conda
so i tried using the linuxulator bash shell on centos to install miniconda
the previous command doesnt put you inside the linuxulator chroot
so you can see the Freebsd filesystem
create the miniconda directory on Freebsd
in the linuxulator bash shell install miniconda
remove the miniconda script
activate miniconda
create the python env
install torch
git clone ComfyUI
pip install requirements
run comfyui
fails due to an old library on centos
cant remember off hand which library
there is a rocky linux 9 package for the linuxulator
however the linux-nvidia-libs package is still built with centos userland
linux-c7 and not the rocky linux linux-rl9 package
so i cant uninstall linux-c7 and install linux-rl9
because that would remove the linux-nvidia-libs
so i set linux_enable to NO in my rc.conf
and created a rocky linux chroot in /compat
with these steps
github.com
however trying to run the rocky bash shell to install miniconda
the same way i did with centos failed
couldnt find some .so file
so there seems to be a difference between the linuxulator chroots bash shell
depending on if it was installed with the freebsd package or created manually
and you cant enter the linuxulator chroot
because then you cant "see" the Nvidia driver
and you have to install the exact same version of the linux driver in the chroot as on the freebsd host
which is possible, but the issue is you cant install the matching version of cuda in the chroot
you get the same issue with jails
you can use devfs rules to make the nvidia gpu visible in the jail
and then you have to install the exact same version of the nvidia driver in the jail
there is a nviida-cuda-toolkit package on ubuntu
but that doesnt work with python virtual env's created with either pip or miniconda
so you then have to manually install cuda in the jail
which has to match the cuda version on Freebsd
so you install cuda 12.4 and it doesnt work with the virtual env "no cuda found"
if you install the latest version of cuda 12.8 that stops the gpr from working
eg runnning
fails because it cant connect to the nvidia gpu due to mismtach of cuda 12.8 in the jail
and cuda 12.4 on freebsd
i tried with both Ubuntu 24.04 and Ubuntu 24.10
same issue
so jails dont work becuase of the cuda mismatch
the linuxulator with centos fails due to an old library
manual install of rocky in the linuxulator fails because the bash shell cant find the libraries
using a pip virtaul env on freebsd fails because there is no torch binary
trying to using the freebsd torch packages with the virtual env fails
also comfyui requires some additional packages in addition to torch
which arent available on freebsd, so trying to use the freebsd torch packages wont work
i cant use a bhyve vm because i only have 1 gpu so cant pass it thru to the vm
it may be possible to use the linux-rl9 package
and then use the bash shell to set up miniconda
but i cant unistall linux-c7 because then it would remove the linux-nvidia-libs package
there is supposed to be a way to use poudriere to build a package and specify using linux-rl9
instead of linux-c7 but i couldnt get that to work either
so at present i cant see a way to install applications like ComfyUI
or WhisperX on Freebsd
i have been through dozens of different pemutations on trying to create a python env
that uses the gpu and cuda
chroots, jails and natively on freebsd
also looked at install linux on an external drive
but that wont work because ubuntu adds an entry to the uefi bootloader
which means you always have to have that drive plugged in or freebsd will fail to boot
because it cant find the external drive which is listed in the uefi bootloader
itsfoss.com
so in short drawn a blank
For work i have been trying various methods to install ComfyUI
ComfyUI lets you design and execute advanced stable diffusion pipelines using a graph/nodes/flowchart based interface.
GitHub - comfyanonymous/ComfyUI: The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. - comfyanonymous/ComfyUI
Vermaden wrote a guide a couple years ago for installing Stable Diffusion on Freebsd
GitHub - verm/freebsd-stable-diffusion: Stable Diffusion on FreeBSD with CUDA support
Stable Diffusion on FreeBSD with CUDA support. Contribute to verm/freebsd-stable-diffusion development by creating an account on GitHub.
However the issue is the linux-miniconda-installer package
hasnt been updated since 2023-10-23 11:27:43
and uses python 3.9
FreshPorts -- sysutils/linux-miniconda-installer: Aid for installing and using miniconda
Conda, like pip and CRAN, is a popular system that allows non-root users to install many binary software packages in their own directories. The system includes a base "channel" (repository) as well as 3rd party community channels, such as "bioconda". QC for community channels is generally...

which is too old to run a lot of the most recent python applications like ComfyUI
The linux-miniconda-installer package uses the linuxulator bash shell with conda
so i tried using the linuxulator bash shell on centos to install miniconda
Code:
/compat/linux/bin/bash
the previous command doesnt put you inside the linuxulator chroot
so you can see the Freebsd filesystem
create the miniconda directory on Freebsd
Code:
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
chmod +x ~/miniconda3/miniconda.sh
in the linuxulator bash shell install miniconda
Code:
~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
remove the miniconda script
Code:
rm ~/miniconda3/miniconda.sh
activate miniconda
Code:
source ~/miniconda3/bin/activate
create the python env
Code:
conda create -n comfyenv
conda activate comfyenv
install torch
Code:
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia
git clone ComfyUI
Code:
git clone https://github.com/comfyanonymous/ComfyUI.git
Code:
cd CofmyUI
pip install requirements
Code:
pip install -r requirements.txt
run comfyui
Code:
python main.py
fails due to an old library on centos
cant remember off hand which library
there is a rocky linux 9 package for the linuxulator
however the linux-nvidia-libs package is still built with centos userland
linux-c7 and not the rocky linux linux-rl9 package
Code:
pkg info -dx linux-nvidia-libs-550.127.05
Code:
linux-nvidia-libs-550.127.05:
linux-c7-xorg-libs-7.7_11
so i cant uninstall linux-c7 and install linux-rl9
because that would remove the linux-nvidia-libs
so i set linux_enable to NO in my rc.conf
and created a rocky linux chroot in /compat
with these steps
cerberus/freebsd/rocky-linux-linuxulator.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
however trying to run the rocky bash shell to install miniconda
the same way i did with centos failed
couldnt find some .so file
so there seems to be a difference between the linuxulator chroots bash shell
depending on if it was installed with the freebsd package or created manually
and you cant enter the linuxulator chroot
because then you cant "see" the Nvidia driver
and you have to install the exact same version of the linux driver in the chroot as on the freebsd host
which is possible, but the issue is you cant install the matching version of cuda in the chroot
you get the same issue with jails
you can use devfs rules to make the nvidia gpu visible in the jail
and then you have to install the exact same version of the nvidia driver in the jail
there is a nviida-cuda-toolkit package on ubuntu
but that doesnt work with python virtual env's created with either pip or miniconda
so you then have to manually install cuda in the jail
which has to match the cuda version on Freebsd
so you install cuda 12.4 and it doesnt work with the virtual env "no cuda found"
if you install the latest version of cuda 12.8 that stops the gpr from working
eg runnning
Code:
nvidia-smi
fails because it cant connect to the nvidia gpu due to mismtach of cuda 12.8 in the jail
and cuda 12.4 on freebsd
i tried with both Ubuntu 24.04 and Ubuntu 24.10
same issue
so jails dont work becuase of the cuda mismatch
the linuxulator with centos fails due to an old library
manual install of rocky in the linuxulator fails because the bash shell cant find the libraries
using a pip virtaul env on freebsd fails because there is no torch binary
trying to using the freebsd torch packages with the virtual env fails
also comfyui requires some additional packages in addition to torch
which arent available on freebsd, so trying to use the freebsd torch packages wont work
i cant use a bhyve vm because i only have 1 gpu so cant pass it thru to the vm
it may be possible to use the linux-rl9 package
and then use the bash shell to set up miniconda
but i cant unistall linux-c7 because then it would remove the linux-nvidia-libs package
there is supposed to be a way to use poudriere to build a package and specify using linux-rl9
instead of linux-c7 but i couldnt get that to work either
so at present i cant see a way to install applications like ComfyUI
or WhisperX on Freebsd
i have been through dozens of different pemutations on trying to create a python env
that uses the gpu and cuda
chroots, jails and natively on freebsd
also looked at install linux on an external drive
but that wont work because ubuntu adds an entry to the uefi bootloader
which means you always have to have that drive plugged in or freebsd will fail to boot
because it cant find the external drive which is listed in the uefi bootloader

Install Ubuntu Linux on an External USB Drive
This tutorial shows the steps for actually installing Ubuntu Linux on an external US drive with the bootloader installed on the USB. It is NOT live USB set up. This USB will work as portable operating system and can be used on any computer system.

so in short drawn a blank