HOW TO: Install/config CUDA 5.5 on Fedora 19 on an Optimus laptop

Providing this here so that (1) I can find it when setting this up in future and (2) hopefully others won’t have to endure the grief I endured trying to get CUDA running on (in spite of ?) Optimus.

NVIDIA: YOU REALLY NEED TO FIX THIS!!! It seems to be an issue in every Linux distro, and I’ve yet to find a single coherent recipe (such as below).

  1. Install bumblebee:
    see This page has moved
    BE SURE TO INSTALL THE NONFREE VERSION!
    NOTE: Primus does not work on my system! YMMV

  2. Install CUDA 5.5 from RUN package
    see http://thunderbirdtrr.blogspot.com/2013/10/fedora-20-nvidia-optimus-cuda-55.html#.Uyy043VdXqU

BUT: there’s much more to the install than described on that blog, and its for Fedora 20. Use the /usr/local/cuda-5.5 install directory, instead of /opt, and adjust the procedures appropriately. Also DECLINE THE NVIDIA DRIVER INSTALL during the install script. Note that this may emit an error at the end of the install, but it seems to be mostly harmless.

Be sure to install the samples so you can verify things when done.

  1. symlink the /usr/lib64/nvidia-bumblebee directory to a /usr/lib64/nvidia directory (use sudo!)

  2. Install support graphics libs (some may already be installed):
    sudo yum install mesa-libGL-devel
    sudo yum install mesa-libGLU-devel
    sudo yum install libXi-devel
    sudo yum install libXmu-devel
    sudo yum install freeglut-devel.x86_64

  3. update PATH with /usr/local/cuda-5.5/bin and
    LD_LIBRARY_PATH with /usr/local/cuda-5.5/lib64:/usr/lib64/nvidia

  4. cd to NVIDIA samples directory and “make”

  5. run simple samples using optirun:
    cd 1_Utilities/deviceQuery
    optirun ./deviceQuery

NOTE: numerous samples require higher level CUDA capability
(my 555M only supports 2.1, my 670 supports 3.0, need 780 to support 3.5,
most mobiles are 3.0 or less - except for the oddball “5.0”, which
seems more like a 2.5 level)

NOTE2: need MPI compiler to build/run MPI samples, but the make will skip as needed.