Least Action

Nontrivializing triviality..and vice versa.

Archive for the ‘CUDA’ Category

NVIDIA CUDA on Fedora 20 x86-64 with NVIDIA Optimus

leave a comment »

So after weeks of experimentation, and frustration, I think I have finally gotten CUDA to work on my MSI GE 70 2OE-071 laptop. As you may know, NVIDIA Optimus is a technology that enables power-sharing and switching between Intel HD and NVIDIA GPUs on laptops. For some reason, MSI and some other manufacturers have disabled the option to disable Optimus technology from within the BIOS. Now as far as I know, Linux has shaky support for Optimus, and while I had no trouble with any Linux distro on my previous Dell XPS laptops (which did have Optimus) I just couldn’t get NVIDIA discrete graphics to work on my MSI “gaming” laptop, which is a shame, because much of my work involves (or has involved) the use of CUDA, and I am not eager to spend my programming time on Windows.

This is not an exhaustive guide, and I invite suggestions and corrections from users who may stumble upon this blog post. I tried to reproduce the scenario on my own laptop in order to make sure I didn’t miss anything.

Typically there are six stages in NVIDIA CUDA installation on Linux:

1. Get rid of the nouveau driver if you are installing the proprietary NVIDIA driver by hand.
2. Reboot, get to a text mode (sadly, init doesn’t work anymore, so if you’re a old Unix user like me, you have to google this up before you start playing with your system).
3. Install the NVIDIA device driver.
4. Reboot, make sure a basic X configuration works (known as the “graphical mode” nowadays).
5. Install the CUDA toolkit, and set PATH and LD_LIBRARY_PATH variables.
6. Compile CUDA samples.

Now I believe much of the errors you will face in steps 1 through 6 are from a partial understanding of the way the X Server and Linux work, and that is based on my own experience. Playing with Linux can be a humbling experience even for someone who has used it for over a decade! But this is quite a lot of fun if you can document everything, and remember what you did to get something to work. It also helps if you have a system to play with, so if you have issues with installing and re-installing the OS n times before you can get to perfection, then this guide isn’t for you. Sorry!

Stuff I had to get to run the CUDA samples:
gcc-g++ in Fedora
libXmu-devel in Fedora (this installs the libXmu libraries)



Written by Vivek

April 20, 2014 at 19:16

Posted in CUDA, Linux, Programming

CUDA on Ubuntu Maverick Meerkat 10.10

with one comment

(To be edited)

If you’re getting errors like

/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLU
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: cannot find -lXi
/usr/bin/ld: cannot find -lXmu
/usr/bin/ld: cannot find -lglut

then you need to do the following

sudo apt-get install libxi libxi-dev

Running make again will result in the following errors:

/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLU
/usr/bin/ld: cannot find -lXmu
/usr/bin/ld: cannot find -lglut

Now, let’s execute:

sudo apt-get install freeglut3 freeglut3-dev

This brings down the errors to

/usr/bin/ld: cannot find -lXmu

So, we just have to do one more apt-get:

sudo apt-get install libxmu6 libxmu-dev

If you get errors suggesting that your libcudart.so.1 is missing, it means your LD_CONFIG_PATH isn’t set right. To set it permanently, use

sudo ldconfig -v /usr/local/cuda/lib64/

on a 64-bit system and

sudo ldconfig -v /usr/local/cuda/lib/

on a 32 bit system.

Written by Vivek

January 25, 2011 at 22:49

CUDA on a Dell XPS 15 in Windows 7 64-bit

leave a comment »

I just figured out how to get NVIDIA CUDA to work on my laptop. You need to replace the generic Dell driver with this one:


You need to do a custom clean installation and make sure the PhysX box is checked.

I had to do some CUDA programming on the Windows partition, so now I have to figure out how to configure all my IDEs to work with CUDA. I will try and post detailed configuration info for Netbeans at least.

Written by Vivek

January 22, 2011 at 11:07