Will CUDA work with FreeBSD?

Finally I did it!

The recipe is:

FreeBSD 8.0 + NVidia driver 195.22 + CUDA 3.0

Also linprocfs and linsysfs should be mounted

And, VOILA:

uname -a

FreeBSD av429635.oops 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sun Feb 7 17:30:12 MSK 2010 root@av429635.oops:/usr/src/sys/i386/compile/ALECN80 i386

./deviceQuery

CUDA Device Query (Runtime API) version (CUDART static linking)

There is 1 device supporting CUDA

Device 0: “GeForce 9400 GT”

CUDA Driver Version: 3.0

CUDA Runtime Version: 3.0

CUDA Capability Major revision number: 1

CUDA Capability Minor revision number: 1

Total amount of global memory: 536150016 bytes

Number of multiprocessors: 2

Number of cores: 16

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 8192

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.37 GHz

Concurrent copy and execution: Yes

Run time limit on kernels: Yes

Integrated: No

Support host page-locked memory mapping: No

Compute mode: Default (multiple host threads can use this device simultaneously)

Test PASSED

Press ENTER to exit…

./bandwidthTest

Running on…

  device 0:GeForce 9400 GT

Quick Mode

Host to Device Bandwidth for Pageable memory

^C

sudo su

Password:

av429635# mount /compat/linux/proc/

av429635# mount /compat/linux/sys/

av429635# ee /etc/resolv.conf

av429635# exit

./bandwidthTest

Running on…

  device 0:GeForce 9400 GT

Quick Mode

Host to Device Bandwidth for Pageable memory

.

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 2766.1

Quick Mode

Device to Host Bandwidth for Pageable memory

.

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 2212.2

Quick Mode

Device to Device Bandwidth

.

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 7996.2

&&&& Test PASSED

Press ENTER to exit…

./MonteCarlo

Generating input data…

Allocating memory…

Generating normally distributed samples…

Running GPU Monte Carlo…

Options : 256

Simulation paths: 262144

Time (ms.) : 49.021999

GPU options per sec.: 5222.145228

GPU Monte Carlo vs. Black-Scholes statistics

L1 norm : 3.065659E-06

Average reserve: 370.890907

TEST PASSED

CPU Monte Carlo vs. Black-Scholes statistics…

L1 norm: 2.974551E-06

Average reserve: 386.877376

CPU vs. GPU Monte Carlo statistics…

L1 norm: 9.326344E-08

Shutting down…

Press ENTER to exit…

Well, not exactly “CUDA work on FreeBSD” - it’s Linux program that use Linux libs under Linuxlator on FreeBSD that works.

Also I didn’t try to compile Cuda programs yet, I’ve just launched programs pre-compiled on Linux (Debian)

Thanks for your tip, but

Did you do anything special with the makefile for the SDK examples, I get that I am missing features.h. I have freebsd 8 with linux_base-f10 and the mounts you specified.

Could you specify which extra ports you have installed that helped you with the build.

1 Like