Nearly a year ago NVIDIA released a native GPU driver for FreeBSD/amd64. At one point while testing an earlier BETA version of the driver (195.22) I played around with CUDA. These notes are just a summary of the setup I used during my testing. I built apps from the CUDA SDK on a Linux/i386 box and then ran them on a FreeBSD/amd64 box. I will only cover setting up the FreeBSD box here. For these tests I used version 2.3 of the CUDA SDK and toolkit for RHEL 4.x / i386.
- Setup Linux compatibility on the FreeBSD machine
- Install a suitable linux_base package
- Mount linprocfs(4) and linsysfs(4)
- Install the NVIDIA graphics driver and add missing libcuda.so symlink
# cd /somepath/NVIDIA-FreeBSD-x86_64-195.22
# make install
# cd /compat/linux/usr/lib
# ln -sf libcuda.so.1 libcuda.soThe driver should attach to any NVIDIA GPUs or CUDA devices:
nvidia0: on vgapci0
vgapci0: child nvidia0 requested pci_enable_busmaster
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia0: [GIANT-LOCKED]
nvidia0: [ITHREAD]
nvidia1: on vgapci1
vgapci1: child nvidia1 requested pci_enable_busmaster
vgapci1: child nvidia1 requested pci_enable_io
vgapci1: child nvidia1 requested pci_enable_io
nvidia1: [GIANT-LOCKED]
nvidia1: [ITHREAD] - Start a root Linux shell:
# /compat/linux/bin/sh
sh-3.00# - Install the CUDA toolkit:
sh-3.00# sh /somepath/cudatoolkit_2.3_linux_32_rhel4.7.run
Verifying archive integrity… All good.
Uncompressing NVIDIA CUDA………………………………………………………………………………………………………………………
Enter install path (default /usr/local/cuda, ‘/cuda’ will be appended):
<… lots of files installed into /usr/local/cuda > - Add
/usr/local/cudato/compat/linux/etc/ld.so.confand run the Linuxldconfigas root:
sh-3.00# echo /usr/local/cuda/lib >> /etc/ld.so.conf
sh-3.00# ldconfig
ldconfig: /usr/local/cuda/lib/libcudart.so.2 is not a symbolic linkldconfig: /usr/local/cuda/lib/libcufft.so.2 is not a symbolic link
ldconfig: /usr/local/cuda/lib/libcufftemu.so.2 is not a symbolic link
ldconfig: /usr/local/cuda/lib/libcublasemu.so.2 is not a symbolic link
ldconfig: /usr/local/cuda/lib/libcublas.so.2 is not a symbolic link
- Install the CUDA SDK:
sh-3.00# sh /somepath/cudasdk_2.3_linux.run
Verifying archive integrity… All good.
Uncompressing NVIDIA GPU Computing SDK…………………………………………………………………………………………………………..
Enter install path (default ~/NVIDIA_GPU_Computing_SDK):
….
In this case I installed the CUDA SDK to my home directory which was shared with the Linux/i386 build box that I used via NFS. I compiled the binaries on the Linux/i386 host and then ran them on the FreeBSD/amd64 machine. At this point I no longer have access to the hardware in question so I am not able to provide any output or screenshots from the CUDA SDK applications. While native support for CUDA applications with FreeBSD would be nice, the current capabilities are certainly enough for further investigation and evaluation.
[...] This post was mentioned on Twitter by Tech & Friki Stuff, dikshie. dikshie said: using cuda in FreeBSD's native nvidia 64 bit driver http://bit.ly/cBtEWV [...]
I’m using ‘cuda’ on Freebsd using a similar setup, using the linux_gentoo_state3 port and chrooting into it’s env. This has the advantage of being able to build cuda apps on the freebsd box and not needing to use a linux box to build them.
Can you make an update to it? How’s the new nvidia driver working?
Thanks