freebsd-nvidia-cuda ... problems.
archlinux-nvidia-cuda ... problems.
Currently trying debian-linux ...
archlinux-nvidia-cuda ... problems.
Currently trying debian-linux ...
Can FreeBSD not use CUDA for compute at all with NVIDIA GPUs today?freebsd-nvidia-cuda ... problems.
I can as well say that I left all other car brands for BMWWhy are we over 50 posts in this thread? OP decides FreeBSD doesn't work for them, ok fine. Don't use it. Why be dramatic about "leaving FreeBSD".
I've never understood threads like this. If one decides that a Ford automobile does not meet their needs, does one announce "I'm leaving Ford for Chevy?" No, you just go buy a new car.
Can FreeBSD not use CUDA for compute at all with NVIDIA GPUs today?
This is why (even though I myself don't use it, just installed for confirmation) I'm keeping x11/linux-nvidia-libs* in sync with corresponding x11/nvidia-driver* when filing PR / opening review for upgrading x11/nvidia-driver*, in conjunction with graphics/nvidia-drm*-kmod*, x11/nvidia-settings and x11/nvidia-xconfig.As mentioned in this thread, the right combination of FreeBSD drivers and Linux libs makes you able to run Linux CUDA binaries in the Linuxulator.
Building CUDA programs in the Linuxulator is probably no problem.
I currently have to use Windows. (We are moving, and initially will have just our laptops, and I am having problems with hardware support on the laptop.) But since I have moved almost completely to open-source apps, moving back and forth between FreeBSD and Windows is not so bad.Good morning FreeBSD community!
I am traditionally a Linux user and moved to FreeBSD a little more than a year, and man.... I loved it! It is some of those moments we say "how have a lived until now without it?".
But it is with broken heart that I am planning to move back to Linux as I currently have a urge to expedite my competences in ML/AI and the lack of CUDA integration by NVIDIA
has been a obstacle difficult to get around. I thought hard about dual boots and VMs, but I have a HW with limited capacity to start with.
Anyhow! I may be leaving but I joined this forum to remain tightened to FreeBSD looking forward to make a comeback!
Cheers!
If I understand correctly, NVIDIA needs at least Linux-compatible (at least source code level) UVM (Unified Virtual Memory) support to port CUDA on FreeBSD. Possibly more, though.I don't think nvidia has interest in developing a cuda driver for freebsd...
Many things are moving towards Vulkan as a compute backend. Unlike OpenGL, it is flexible enough.I don't think nvidia has interest in developing a cuda driver for freebsd...
PyTorch looks a little unmaintained though for Vulkan. It could also be that the FreeBSD port for compute related work is simply incomplete too.i tried python pytorch , gpu was not detected .
You may want to look into Gentoo's Portage, they do exactly that.On the linuxulator side of the house, I want to make a BSD-style ports tree to build Linux software, so that it can be maintained in version lockstep with BSD.
Good luck! I did try having CUDA work the last few week-ends and ended giving up, but I did not give it the best effort I could. In the thread I wrote about it, AlfredoLlaquet posted an instructions Gist authored by someone who reports recent success, you may find it helpful.If there's a way to get CUDA on FreeBSD native, in the limited time I have to wrangle all this, hopefully I can squeeze it in. But I'm here, and I'm feeling it too!
% nv-sglrun nvidia-smi
/usr/local/lib/libc6-shim/libc6.so: shim init
Fri Mar 13 21:48:34 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.142 Driver Version: 580.142 CUDA Version: 13.0 |
+-----------------------------------------+------------------------+----------------------+
| 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 RTX A400 Off | 00000000:01:00.0 On | N/A |
| 30% 56C P5 N/A / 50W | 1052MiB / 4094MiB | 21% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
% nv-sglrun clpeak
/usr/local/lib/libc6-shim/libc6.so: shim init
Platform: NVIDIA CUDA
Device: NVIDIA RTX A400
Driver version : 580.142 (FreeBSD)
Compute units : 6
Clock frequency : 1762 MHz
Global memory bandwidth (GBPS)
float : 80.31
float2 : 82.53
float4 : 83.70
float8 : 84.28
float16 : 85.46
Single-precision compute (GFLOPS)
float : 2477.12
float2 : 2632.15
float4 : 2486.82
float8 : 2483.61
float16 : 2519.08
No half precision support! Skipped
Double-precision compute (GFLOPS)
double : 42.73
double2 : 41.98
double4 : 42.12
double8 : 40.04
double16 : 36.32
Integer compute (GIOPS)
int : 1310.25
int2 : 1327.29
int4 : 940.59
int8 : 916.97
int16 : 1111.14
Integer compute Fast 24bit (GIOPS)
int : 1278.67
int2 : 1222.75
int4 : 902.45
int8 : 904.22
int16 : 1236.72
Integer char (8bit) compute (GIOPS)
char : 1169.36
char2 : 1267.38
char4 : 1133.21
char8 : 1008.05
char16 : 934.48
Integer short (16bit) compute (GIOPS)
short : 1180.83
short2 : 1254.91
short4 : 1148.93
short8 : 1051.33
short16 : 905.25
Transfer bandwidth (GBPS)
enqueueWriteBuffer : 7.79
enqueueReadBuffer : 8.59
enqueueWriteBuffer non-blocking : 7.01
enqueueReadBuffer non-blocking : 5.00
enqueueMapBuffer(for read) : 10.78
memcpy from mapped ptr : 6.40
enqueueUnmap(after write) : 12.79
memcpy to mapped ptr : 6.23
Kernel launch latency : 12.79 us
Are you runningYou'll need x11/linux-nvidia-libs, devel/libepoll-shim, emulators/libc6-shim and maybe science/linux-ai-ml-env to use CUDA on Linuxulator.
With all the above installed (-devel variants of NVIDIA things, though),
Code:% nv-sglrun nvidia-smi /usr/local/lib/libc6-shim/libc6.so: shim init Fri Mar 13 21:48:34 2026 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 580.142 Driver Version: 580.142 CUDA Version: 13.0 | +-----------------------------------------+------------------------+----------------------+ | 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 RTX A400 Off | 00000000:01:00.0 On | N/A | | 30% 56C P5 N/A / 50W | 1052MiB / 4094MiB | 21% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+
And with benchmarks/clpeak installed additionally,
Code:% nv-sglrun clpeak /usr/local/lib/libc6-shim/libc6.so: shim init Platform: NVIDIA CUDA Device: NVIDIA RTX A400 Driver version : 580.142 (FreeBSD) Compute units : 6 Clock frequency : 1762 MHz Global memory bandwidth (GBPS) float : 80.31 float2 : 82.53 float4 : 83.70 float8 : 84.28 float16 : 85.46 Single-precision compute (GFLOPS) float : 2477.12 float2 : 2632.15 float4 : 2486.82 float8 : 2483.61 float16 : 2519.08 No half precision support! Skipped Double-precision compute (GFLOPS) double : 42.73 double2 : 41.98 double4 : 42.12 double8 : 40.04 double16 : 36.32 Integer compute (GIOPS) int : 1310.25 int2 : 1327.29 int4 : 940.59 int8 : 916.97 int16 : 1111.14 Integer compute Fast 24bit (GIOPS) int : 1278.67 int2 : 1222.75 int4 : 902.45 int8 : 904.22 int16 : 1236.72 Integer char (8bit) compute (GIOPS) char : 1169.36 char2 : 1267.38 char4 : 1133.21 char8 : 1008.05 char16 : 934.48 Integer short (16bit) compute (GIOPS) short : 1180.83 short2 : 1254.91 short4 : 1148.93 short8 : 1051.33 short16 : 905.25 Transfer bandwidth (GBPS) enqueueWriteBuffer : 7.79 enqueueReadBuffer : 8.59 enqueueWriteBuffer non-blocking : 7.01 enqueueReadBuffer non-blocking : 5.00 enqueueMapBuffer(for read) : 10.78 memcpy from mapped ptr : 6.40 enqueueUnmap(after write) : 12.79 memcpy to mapped ptr : 6.23 Kernel launch latency : 12.79 us
nv-sglrun nvidia-smi and nv-sglrun clpeak from the host FreeBSD system, or chrooted in the Linux compat directory?From host environment directly.Are you runningnv-sglrun nvidia-smiandnv-sglrun clpeakfrom the host FreeBSD system, or chrooted in the Linux compat directory?
nv-sglrun is the wrapper script installed by emulators/libc6-shim.Note that current default Linuxulator environment in ports/pkgs is Rocky Linux 9 (rl9).Thanks!
Kohrokho, I leave here a note in case it may prove useful: if you end up following handbook's doc on linuxator and using libc6-shim, beware of where you install the Linux environment. The handbook, for Debian/Ubuntu installs, recommends installing them in something like /compat/ubuntu/, but I found libc6-shim hardcodes a lot of paths to /compat/linux/ .