CUDA and OpenCL typically needs the latest and greatest drivers in order to work. Installing these drivers is obviously very operating system specific, and also depends on each video card vendor.
CUDA is, of course, specific to nVidia based hardware. OpenCL is supported by a range of hardware manufacturers.
Ubuntu provides an open source driver for nVidia hardware. However, to use CUDA you need the proprietary nVidia drivers. This can be readily installed using System>Administration>Additional Drivers.
I also found that I had to install the nvidia-modprobe package so that Ubuntu could recognize my nVidia hardware.
After installing the new drivers, you need to reboot the machine.
The proprietary driver installed will not be the latest development driver, but rather an older, tested and stable driver. For example, on Ubuntu 14.04.1 LTS this would be the 331.113 driver. The CUDA runtime requires that the driver version be a minimum version number depending on the CUDA Toolkit. If you have the latest and greatest CUDA Toolkit, you also need the latest and greatest driver. If you do not, the program will fail to run.
DO NOT manually install a device driver unless you must, as doing so will cause you endless trouble and could brick your installation. CUDA 5.5 requires at least the 319 driver, but the 331 additional driver supported by 14.04.1 LTS will work just fine.
Ubuntu 14.04.1 provides an CUDA 5.5 using
apt-get install nvidia-cuda-toolkit
I recommend you just use this version of CUDA for this class. It is by far the least headaches.