Installation with CUDA on Ubuntu server 11.04


This guide is written using:
Ubuntu Server 11.04
Linux ubuntu 2.6.38-8-generic x86_64 GNU/Linux

Pre installation requirements

apt-get update 
apt-get upgrade 

Get the CUDA toolkit

Pick up the correct NVIDIA drivers for your card and system

Go to your download directory
and chmod the 2 *.run files that you just downloaded.


chmod 655 
chmod 655
sudo apt-get -y install libpcre3 libpcre3-dbg libpcre3-dev \ 
build-essential autoconf automake libtool libpcap-dev libnet1-dev \ 
libyaml-0-2 libyaml-dev zlib1g zlib1g-dev libcap-ng-dev libcap-ng0 \ 
make flex bison git

Run the cuda toolkit installation package:

sudo ./

Close all windows and as you are logged in press:


Log in with your credentials

sudo -i

And enter your password

Stop the x server:

/etc/init.d/gdm stop

Uninstall xserver video drivers:

apt-get remove --purge xserver-xorg-video-nouveau

Go to the directory where you downloaded nvidia/cuda drivers.

Run the NVIDIA*******.run: 

Ok and yes your way out.
At some point it will ask you to make a special configuration file to disable a "nouveau"
driver that the system is currently using and prevents the NVIDIA drivers to be installed - say yes!


shutdown -r now

After reboot log in as you would normally through the GUI
Log in as you would normally.

Go to shell:


Type in your credentials and pass

sudo -i

Stop the xserver again:

/etc/init.d/gdm stop

Run the NVIDIA driver again.
This time it would finish and be successful....


shutdown -r now

After start you would notice that the display has much better resolution - it is a good thing.

Log in as you would normally.
Because the 11.04 Ubuntu comes with gcc version 4.5 by default we need to install gcc 4.4 since we must use 4.4 for the cuda compilation:

apt-get install gcc-4.4 gcc-4.4-base g++-4.4

Then we switch and make ubuntu use the gcc 4.4 by default:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.5 
udo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4

We make sure that this is the case:

sudo update-alternatives --config gcc

update-alternatives --config gcc  (as root)

There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
  • 0 /usr/bin/gcc-4.4 60 auto mode
    1 /usr/bin/gcc-4.4 60 manual mode
    2 /usr/bin/gcc-4.5 40 manual mode
Selection    Path              Priority   Status 

Press enter to keep the current choice[*], or type selection number:



Enter the following in your download directory:

git clone git:// 
cd oisf/ 
git clone -b 0.5.x
./configure --enable-gccprotect --enable-profiling --enable-cuda \ 
--with-cuda-includes=/usr/local/cuda/include --with-cuda-libraries=/usr/local/cuda/lib64/

After that you should get the following result:

Suricata Configuration: 
  NFQueue support:          no 
  IPFW support:             no 
  PF_RING support:          no 
  Prelude support:          no 
  Unit tests enabled:       no 
  Debug output enabled:     no 
  Debug validation enabled: no 
  CUDA enabled:             yes 
  DAG enabled:              no 
  Profiling enabled:        yes 
  GCC Protect enabled:      yes 
  GCC march native enabled: yes 
  GCC Profile enabled:      no 
  Unified native time:      no 
  Non-bundled htp:          no 
  PCRE sljit:               no 

make && make install 

Proceed with Basic Setup

After you start suricata , you should see cuda

example : 
suricata -c suricata.yaml -i eth0 
[12406] 13/8/2011 -- 10:14:39 - (suricata.c:622) <Info> (main) -- This is Suricata version 1.1beta2 (rev b3f7e6a) 
[12406] 13/8/2011 -- 10:14:39 - (util-cpu.c:171) <Info> (UtilCpuPrintSummary) -- CPUs/cores online: 8 
[12406] 13/8/2011 -- 10:14:39 - (util-cuda.c:4504) <Info> (SCCudaPrintBasicDeviceInfo) -- GPU Device 1: GeForce 310M, 2 Multiprocessors, 1468MHz, CUDA Compute Capability 1.2...................