Installing Cuda on Ubuntu 11.10
To install Cuda, I followed some hints on bottom of this thread, but also had to fix a few more issues.
Download the current Cuda Toolkit for Ubuntu and the GPU Computing SDK, and save the .run files somewhere.
Install and select gcc/g++ 4.4
sudo apt-get install \ gcc-4.4 g++-4.4 build-essential sudo update-alternatives \ --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40 \ --slave /usr/bin/g++ g++ /usr/bin/g++-4.6 sudo update-alternatives \ --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 \ --slave /usr/bin/g++ g++ /usr/bin/g++-4.4Check with
sudo update-alternatives —config gcc gcc —versionthat you have now version 4.4.x of the compilers.
Install the nvidia drivers
sudo apt-get install \ nvidia-current\ nvidia-current-dev\ nvidia-current-updates\ nvidia-current-updates-devAs root, run the two .run files from nvidia (see 1.).
For compiling the SDK examples, you also need to install
sudo apt-get install freeglut3-dev libxi-devand create the following links
sudo ln -s /usr/lib/libXmu.so.6 /usr/lib/libXmu.so sudo ln -s /usr/lib/nvidia-173/libGL.so /usr/lib/libGL.soThen go to the
NVIDIA_GPU_COMPUTING_SDK_...folder. In the fileC/common/common.mkchange the lineLINKFLAGS +=to
LINKFLAGS += -L/usr/lib/nvidia-currentThen run make. This should compile everything, indicating that the CUDA stuff works.
Fixing grub errors after Ubuntu distribution upgrade
After running an Ubuntu distribution upgrade on a machine where the primary
boot disk is not /dev/sda, but let's say /dev/sdb, you may
experience the following grub error:
error: symbol not found: 'grub_env_export'
This happens because the grub-update is apparently run on the first disk by
default. You'll need to reinstall grub using the correct partition by booting from a live disk, as explained in this post. In the live system, fire up a terminal and (assuming your desired boot partition is on /dev/sdb1) do
sudo mount /dev/sdb1 /mnt/sdb1
sudo mount -o bind /dev /mnt/sdb1/dev
sudo mount -o bind /sys /mnt/sdb1/sys
sudo mount -o bind /proc /mnt/sdb1/proc
sudo chroot /mnt/sdb1
This will make the boot partition your current root directory tree. Then reinstall grub there:
grub-install /dev/sdb
update-grub
Reboot the machine, and hope for the best - it worked for me when upgrading from Maverick to Natty.