{"id":651,"date":"2012-11-29T17:37:35","date_gmt":"2012-11-29T06:37:35","guid":{"rendered":"http:\/\/www.zamaudio.com\/?p=651"},"modified":"2012-11-29T17:49:49","modified_gmt":"2012-11-29T06:49:49","slug":"how-to-install-cuda-5-0-toolkit-on-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/www.zamaudio.com\/?p=651","title":{"rendered":"How to install CUDA 5.0 Toolkit on Ubuntu 12.04"},"content":{"rendered":"<p>This set of instructions explains how to get a complete CUDA 5.0 Toolkit compiler up and running in Ubuntu 12.04 for the x86_64 architecture.<br \/>\nIt explains how to avoid getting stuck with a fast booting bios and missing out on loading GRUB by introducing a 3 second timeout.  This timeout can be removed after everything is set up.<br \/>\nIt also explains how to fix all the linking issues with the toolchains, and how to fix a garbled display when setting up a machine for use with Cuda 5.0 on Ubuntu 12.04.<\/p>\n<p>Be careful when pasting this code, you need to fix the line wrapping yourself.  Sorry about that.<\/p>\n<p><code>cd ~\/Desktop<br \/>\nwget http:\/\/developer.download.nvidia.com\/compute\/cuda\/5_0\/rel-update-1\/installers\/cuda_5.0.35_linux_64_ubuntu11.10-1.run<br \/>\nchmod +x cuda_5.0.35_linux_64_ubuntu11.10-1.run<br \/>\nsudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev<br \/>\nsudo ln -s \/usr\/lib\/x86_64-linux-gnu\/libglut.so.3 \/usr\/lib\/libglut.so<br \/>\n<\/code><\/p>\n<p>#Edit this file:<br \/>\n<code>sudo gedit \/etc\/modprobe.d\/blacklist.conf<br \/>\n<\/code><\/p>\n<p>#Put this at the end of the file:<\/p>\n<blockquote><p>blacklist vga16fb<br \/>\nblacklist nouveau<br \/>\nblacklist rivafb<br \/>\nblacklist nvidiafb<br \/>\nblacklist rivatv\n<\/p><\/blockquote>\n<p>#Save and close.<\/p>\n<p>#Edit this file:<br \/>\n<code>sudo gedit \/etc\/default\/grub<br \/>\n<\/code><\/p>\n<p>#Put these settings in the file:<\/p>\n<blockquote><p>GRUB_HIDDEN_TIMEOUT=3<br \/>\nGRUB_HIDDEN_TIMEOUT_QUIET=false<br \/>\nGRUB_CMDLINE_LINUX_DEFAULT=&#8221;nomodeset&#8221; # used to be quiet splash<br \/>\nGRUB_TERMINAL=console  # fixes stupid slow scrolling problem in grub\n<\/p><\/blockquote>\n<p><code>sudo update-grub<\/code><\/p>\n<p>#Reboot<\/p>\n<p>#Hit LEFT SHIFT when 3 second countdown<br \/>\n<code>e<\/code><\/p>\n<p>#Append this word to the end of the linux boot option:<br \/>\n<code>text<\/code><\/p>\n<p>#Hit Ctrl-X to boot<\/p>\n<p>#Login in text mode:<\/p>\n<p>#Remove all nvidia crap<br \/>\n<code>sudo apt-get remove --purge nvidia-*<\/code><\/p>\n<p>#BACKUP YOUR xorg.conf then do this:<\/p>\n<p><code>sudo dpkg-reconfigure xserver-xorg<br \/>\nsudo apt-get install -V nvidia-experimental-310 nvidia-experimental-310-dev<br \/>\nsudo ln -s \/usr\/lib\/nvidia-experimental-310\/libcuda.so \/lib\/libcuda.so<br \/>\n<\/code><\/p>\n<p>#Restore your xorg.conf<\/p>\n<p>#Check your version of gcc\/g++, you need 4.5<br \/>\n<code>gcc -v<br \/>\nsudo apt-get install gcc-4.5<br \/>\nsudo apt-get install g++-4.5<br \/>\ncd \/usr\/bin<br \/>\nsudo rm gcc<br \/>\nsudo ln -s gcc-4.5 gcc<br \/>\nsudo rm g++<br \/>\nsudo ln -s g++-4.5 g++<br \/>\n<\/code><\/p>\n<p>#Now install Cuda 5.0 &#8211; BUT DON&#8217;T INSTALL BUNDLED NVIDIA DRIVER!<br \/>\n<code>cd ~\/Desktop<br \/>\nsudo .\/cuda_5.0.35_linux_64_ubuntu11.10-1.run<br \/>\n<\/code><\/p>\n<p>#Fix up linker options by creating this new file:<br \/>\n<code><br \/>\nsudo nano \/etc\/ld.so.conf.d\/cuda50.conf<br \/>\n<\/code><\/p>\n<p>#Throw in these two lines, save and quit<\/p>\n<blockquote><p>\/lib<br \/>\n\/usr\/local\/cuda-5.0\/lib\n<\/p><\/blockquote>\n<p>#Update linker config<br \/>\n<code>sudo ldconfig<\/code><\/p>\n<p>#Add this to your path (or whichever place you told it to install):<br \/>\n<code>sudo gedit ~\/.bashrc<\/code><\/p>\n<blockquote><p>export PATH=${PATH}:\/usr\/local\/cuda-5.0\/bin\n<\/p><\/blockquote>\n<p>Now you should be able to compile Cuda 5.0 Samples or your own project using Ubuntu 12.04!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This set of instructions explains how to get a complete CUDA 5.0 Toolkit compiler up and running in Ubuntu 12.04 for the x86_64 architecture. It explains how to avoid getting stuck with a fast booting bios and missing out on loading GRUB by introducing a 3 second timeout. This timeout can be removed after everything [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=\/wp\/v2\/posts\/651"}],"collection":[{"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=651"}],"version-history":[{"count":5,"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=\/wp\/v2\/posts\/651\/revisions"}],"predecessor-version":[{"id":656,"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=\/wp\/v2\/posts\/651\/revisions\/656"}],"wp:attachment":[{"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zamaudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}