Cuda on CentOS 7

I need the cuda libs on CentOS 7. Since I’m lazy, I synced the software from a different system, and now it complains. To play on the safe side, I’m going to install several CUDA libraries and drivers. First I take the lastest one. It is available on the NVIDIA developer zone. Just select your arch, OS, version, and download type. I choose Linux, x86_64, CentOS, 7, runfile(local). The runfile I get (as of today) is called cuda_8.0.44_linux.run. Once I have the *.run file on a comfortable place, I make it executable, and run it. First one needs to agree on the EULA. After that, these are the options offered, and my choices:

Logging to /tmp/cuda_install_25014.log
...now the EULA comes ...
Do you accept the previously read EULA?
accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver 
for Linux-x86_64 367.48?
(y)es/(n)o/(q)uit: yes

Do you want to install the OpenGL libraries?
(y)es/(n)o/(q)uit [ default is yes ]: yes

Do you want to run nvidia-xconfig?
This will update the system X configuration 
file so that the NVIDIA X driver is used. 
The pre-existing X configuration file will be backed up.
This option should not be used on systems that require a custom
X configuration, such as systems with multiple GPU vendors.
(y)es/(n)o/(q)uit [ default is no ]: yes

Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: yes

Enter Toolkit Location
 [ default is /usr/local/cuda-8.0 ]:

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: n

Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
 [ default is /root ]: /usr/local/cuda-8.0-samples

Installing the NVIDIA display driver...
Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...
Missing recommended library: libGLU.so
Missing recommended library: libXmu.so

Installing the CUDA Samples in /usr/local/cuda-8.0-samples ...
Copying samples to 
/usr/local/cuda-8.0-samples/NVIDIA_CUDA-8.0_Samples now...
Finished copying samples.

===========
= Summary =
===========

Driver: Installed
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in 
/usr/local/cuda-8.0-samples, but missing recommended libraries

Please make sure that
 - PATH includes /usr/local/cuda-8.0/bin
 - LD_LIBRARY_PATH includes 
/usr/local/cuda-8.0/lib64, or, 
add /usr/local/cuda-8.0/lib64 to 
/etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, 
run the uninstall script in /usr/local/cuda-8.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall

Please see CUDA_Installation_Guide_Linux.pdf 
in /usr/local/cuda-8.0/doc/pdf for detailed 
information on setting up CUDA.

Logfile is /tmp/cuda_install_25014.log

Now I fix the missing recommended libraries:

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

Then, over it, I’m going to install cuda-7.5 (the recommended one for relion). I download the binaries from the cuda developers archive. The runfile is called in a similar way,  cuda_7.5.18_linux.run. I do the same, and I get a similar output. But I keep the newest NVIDIA drivers. So this is the summary:

Install NVIDIA Accelerated Graphics Driver 
for Linux-x86_64 352.39? ((y)es/(n)o/(q)uit): n

===========
= Summary =
===========

Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-7.5
Samples: Installed in /usr/local/cuda-7.5-samples

Please make sure that
 - PATH includes /usr/local/cuda-7.5/bin
 - LD_LIBRARY_PATH includes 
/usr/local/cuda-7.5/lib64, or, 
add /usr/local/cuda-7.5/lib64 to 
/etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, 
run the uninstall script in /usr/local/cuda-7.5/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall

Please see CUDA_Installation_Guide_Linux.pdf 
in /usr/local/cuda-7.5/doc/pdf for detailed 
information on setting up CUDA.

***WARNING: Incomplete installation! 
This installation did not install the CUDA Driver. 
A driver of version at least 352.00 is required for 
CUDA 7.5 functionality to work.
To install the driver using this installer, 
run the following command, replacing  
with the name of this run file:
 sudo .run -silent -driver

Logfile is /tmp/cuda_install_61893.log

Now I add the cuda 7 libraries. You can find them in this cuda developers link. My binary is called cuda_7.0.28_linux.run. I run it in the same way that for cuda_7.5…I’m not going to copy the output. At the end, you get a similar warning also.

It’s time to test this. I’m going to make a module with the libraries, and see if I get all the functionalities I want. I’ll keep you updated, or I will update this.

EDIT: sometimes you need also the NVIDIA graphics to work, not only the functionalities. See Installing Nvidia drivers for details about how to be sure you have libraries and drivers.

Advertisements

About bitsanddragons

A traveller, an IT professional and a casual writer
This entry was posted in bits, centos. Bookmark the permalink.

One Response to Cuda on CentOS 7

  1. Pingback: Installing Nvidia drivers | Bits and Dragons

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