Installing CUDA 7 on CentOS 7 – The Golden Path for OpenGL Samples to Work

1. Install CentOS 7 – this should be pretty straightforward!

2. Follow this guide to install CUDA 7 : http://developer.download.nvidia.com/compute/cuda/7_0/Prod/doc/CUDA_Getting_Started_Linux.pdf

CUDA installation has to be done in command line mode, no X Windows. So once you go in CentOS 7 GUI, open a terminal and type

$ systemctl set-default multi-user.target

$ reboot

CentOS 7’s default mode now will be to reboot to CLI.

Start the CUDA 7 installation.

Remember to install the OpenGL Libraries. Read 4.2 onwards carefully! Follow all the steps.

3. Disable the nouveau drivers (as you are installing NVIDIA drivers)

Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:

$ blacklist nouveau

$ options nouveau modeset=0

4. Regenerate the kernel initramfs

$ dracut --force

5. Run nvidia-xconfig to recreate the config file for X Windows.

$ nvidia-xconfig

$ reboot

6. Set the library paths for CUDA 7 libraries on boot       

$ cd  /etc/profile.d

$ vim cudapaths.sh

Type the following into the cudapaths.sh script.

export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH

Save and reboot the OS.

7. Install 3rd Party Libraries (for GL)

If you try to compile one of the projects under 3-Imaging, you will get a lot of lib* not found errors. You got to install the libraries manually.

$ yum install mesa-libGLES.x86_64 mesa-libGL-devel.x86_64 mesa-libGLU-devel.x86_64 mesa-libGLw.x86_64 mesa-libGLw-devel.x86_64 libXi-devel.x86_64 freeglut-devel.x86_64 freeglut.x86_64

8. Reinstall NVIDIA Drivers to Fix Symbolic Links

Due to a bug when installing the 3rd party drivers, you will need to re-run the driver installation to fix some symbolic links. Bug Info: https://www-947.ibm.com/support/entry/portal/docdisplay?lndocid=migr-5094265

Download drivers here: http://www.geforce.com/drivers/results/84721

The next person who tells me installing stuff in Linux is as easy as doing it in Windows/OSX, I am going to punch him in the face.

Advertisements

5 thoughts on “Installing CUDA 7 on CentOS 7 – The Golden Path for OpenGL Samples to Work

  1. Thanks you to share the installation guide.
    It took me hours to try to fix the openGL problems.
    I never thought that it just needed reinstalling ,and the bug is still not fixed in CUDA-7.5.

    Like

  2. Hello thank for this tutorial I’m trying to install the Nvidia Quadro 4000 with CUDA Driver Tools downloaded from his website following this tutorial but when I install everything whitout problem the video card stops working and does not give video signal an either allows to bring up the GUI of Centos 7 only command line interface. Any help you can give, please

    Like

    • You could try nvidia-xconfig to generate a xorg.conf file. Did you download the latest nvidia drivers? I don’t have experience with Quadro 4000 so I can’t say for sure.

      Like

      • Yes I download latest Nvidia Drivers and also tried with nvidia-config but does not work. Also I download the latest Cuda Toolkit 7.5. The problem is that it install but not recognized any of the CUDA commands and either GUI interface is showing up.

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s