@trashheap yep, I do, from time to time.
https://www.tumfatig.net/2026/generative-ai-using-linuxulator-and-egpu-on-freebsd/

Not so long ago, I experimented on so-called Generative AI using an external eGPU and Slackware Linux . Because I’m a BSD fanboy, I started looking at doing the same on FreeBSD. But I faced a lot of missing dependencies issues and Python compilation errors. As a non fluent Python person, I couldn’t solve all the errors I encountered and decided to see if the FreeBSD Linux Binary Compatibility feature would be able to achieve the goal; after all, there are people using it to watch DRM stuff from the Clouds. Spoiler alert: it does work given an organized small amount of command line spells.
@joel @trashheap
You've not mentioned about hw.nvidiadrm.modeset tunable in your page.
But if you want /boot/nvidia-drm.ko to actually work,
hw.nvidiadrm.modeset=1
would be needed in your /boot/loader.conf. Otherwise drivers should work with old-school way (aka UMS in contrast with KMS). nvidia-drm.ko would be loaded but ignored but nvidia-modeset.ko and nvidia.ko works.
As yours are RTX 4060 Ti, you're safe but RTX 5xxx series are known to require GSP firmware to be loaded to work. For this, if you upgrade to RTX 5xxx or later series, you'll additionally need tunable
hw.nvidia.registry.EnableGpuFirmware=1
in your /boot/loader.conf for it. (It could disallow suspend/resume, though.)
If you want fallback to old GPUs that doesn't have GSP in it (pre-Turing gen.), you can specify
hw.nvidia.registry.EnableGpuFirmware=17
instead.
Why /boot/loader.conf but NOT /etc/sysctl.conf is to avoid race conditions.
If loading nvidia.ko and nvidia-drm.ko happenes earlier than setting the tunable, these kmods cannot pick the tunable on load, thus, tunables but not sysctls.
And more, you'll want emulators/libc6-shim, devel/libepoll-shim and science/linux-ai-ml-env for CUDA on FreeBSD to run easier.
@TomAoki Ok, thanks. I must admit I stopped when I had everything working for my use case :)