25

I am trying to install NVIDIA CUDA. When it is installing the tool kit, it displayed the following error message.

Missing recommended library: libGLU.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so

I am not a Linux guy, so I used apt-get install libGLU.so to install it, but it did not work. How can I fix this and install these? I am on 32 bit Linux.

PeakGen
  • 21,894
  • 86
  • 261
  • 463

6 Answers6

21

Try apt-get install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev. You can find this info yourself by searching the Ubuntu package contents.

Ben Whaley
  • 32,811
  • 7
  • 87
  • 85
  • 2
    Thanks for the reply. libGLU is still missing, others are installed, – PeakGen Mar 12 '14 at 18:57
  • 5
    It's possible that the `libglu1-mesa` install did not set up a necessary symbolic link. Something like this may be needed: `sudo ln -s /usr/lib/libGLU.so.1 /usr/lib/libGLU.so` HOWEVER, the directories may be sligltly different, such as `/usr/lib32` instead of `/usr/lib`. So learn what a symbolic link is (`man ln`), then poke around and see if you can find where `libglu1-mesa` put the `libGLU.so.1` file, then use that path accordingly. – Robert Crovella Mar 12 '14 at 19:15
  • I checked in both /usr/lib and /usr/lib32. Could not find it. – PeakGen Mar 12 '14 at 19:22
  • are there any libGLU.so.xxxxxxx files anywhere on your system? It may require two symbolic links libGLU.so -> libGLU.so.1 -> libGLU.so.11.5.19 or something like that. Learn how to search for files in linux. You can start with `sudo ls -l -R /* |grep libGLU` – Robert Crovella Mar 12 '14 at 19:54
  • 2
    @RobertCrovella I'd suggest `find / -name 'libGLU*'` instead. – Ben Whaley Mar 12 '14 at 20:00
  • 7
    `sudo ln -s /usr/lib/x86_64-linux-gnu/libGLU.so.1 /usr/lib/libGLU.so` on Ubuntu 14.04 did the job. Moreover, I did the `sudo ldconfig` after that. – kgadek Sep 08 '15 at 18:22
  • @Tracer try installing this sudo apt-get install libglu1-mesa-dev – surendran Nov 30 '15 at 17:08
7

I use nvidia-docker to setup a CUDA develop environment, also encounter the same issue. So I try to solve this issue and writing down a Dockerfile. Also adding some useful comments, hope it'll be helpful.

Here is my Dockerfile:

https://github.com/allenyllee/server_setup/blob/master/nvidia_docker/Dockerfile

# CUDA 8.0
#
# VERSION               0.0.1

FROM      nvidia/cuda:8.0-devel-ubuntu16.04
LABEL     maintainer="allen7575@gmail.com"

##
## Ubuntu - Packages - Search
## https://packages.ubuntu.com/search?suite=xenial&section=all&arch=amd64&searchon=contents&keywords=Search
##

###
### solve for
### >>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
### >>> WARNING - libX11.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
### >>> WARNING - Xlib.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
### >>> WARNING - gl.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
###
### 2_Graphics/volumeFiltering
### 2_Graphics/simpleGL
### 2_Graphics/bindlessTexture
### 2_Graphics/volumeRender
### 2_Graphics/Mandelbrot
### 2_Graphics/marchingCubes
### 2_Graphics/simpleTexture3D
### 3_Imaging/imageDenoising
### 3_Imaging/recursiveGaussian
### 3_Imaging/simpleCUDA2GL
### 3_Imaging/postProcessGL
### 3_Imaging/bicubicTexture
### 3_Imaging/boxFilter
### 3_Imaging/SobelFilter
### 3_Imaging/cudaDecodeGL
### 3_Imaging/bilateralFilter
### 5_Simulations/particles
### 5_Simulations/smokeParticles
### 5_Simulations/oceanFFT
### 5_Simulations/fluidsGL
### 5_Simulations/nbody
### 6_Advanced/FunctionPointers
### 7_CUDALibraries/randomFog
###
RUN apt update && apt -y install libgl1-mesa-dev

###
### solve for
### >>> WARNING - libGLU.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
### >>> WARNING - glu.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
### 
RUN apt update && apt -y install libglu1-mesa-dev

###
### solve for
### /usr/bin/ld: cannot find -lglut
### https://stackoverflow.com/questions/15064159/usr-bin-ld-cannot-find-lglut
###
RUN apt update && apt -y install freeglut3-dev

### 
### solve for
### >>> WARNING - egl.h not found, please install egl.h <<<
### >>> WARNING - eglext.h not found, please install eglext.h <<<
### >>> WARNING - gl31.h not found, please install gl31.h <<<
###
### 2_Graphics/simpleGLES_EGLOutput
### 2_Graphics/simpleGLES
### 2_Graphics/simpleGLES_screen
### 5_Simulations/nbody_opengles
### 5_Simulations/fluidsGLES
### 5_Simulations/nbody_screen
###
RUN apt update && apt -y install libgles2-mesa-dev


###
### You should also search 'UBUNTU_PKG_NAME = "nvidia-367"' and replace it to 'UBUNTU_PKG_NAME = "nvidia"' 
### for all matched files in the NVIDIA_CUDA-8.0_Samples folder to make it works.
###
RUN mkdir /usr/lib/nvidia && \
    ### solve for  /usr/bin/ld: cannot find -lnvcuvid \
    ### 3_Imaging/cudaDecodeGL \
    ln -s /usr/local/nvidia/lib64/libnvcuvid.so.1 /usr/lib/nvidia/libnvcuvid.so && \
    ### solve for >>> WARNING - libEGL.so not found, please install libEGL.so <<< \
    ### 3_Imaging/EGLStreams_CUDA_Interop \
    ln -s /usr/local/nvidia/lib64/libEGL.so.1 /usr/lib/nvidia/libEGL.so && \
    ### solve for >>> WARNING - libGLES.so not found, please install libGLES.so <<< \
    ### 2_Graphics/simpleGLES_EGLOutput \
    ### 2_Graphics/simpleGLES \
    ### 2_Graphics/simpleGLES_screen \
    ### 5_Simulations/nbody_opengles \
    ### 5_Simulations/fluidsGLES \
    ### 5_Simulations/nbody_screen \
    ln -s /usr/local/nvidia/lib64/libGLESv2_nvidia.so.2 /usr/lib/nvidia/libGLESv2.so


CMD    ["bash"]
allenyllee
  • 964
  • 1
  • 13
  • 16
3

According to this answer https://stackoverflow.com/a/42428296/3425200 , After you installed the libs, you should set the environment to make:

GLPATH=/usr/lib make

instead of make.

Find
  • 75
  • 1
  • 12
3

may be helpful for other user use yum: work for me in cuda-10.0:

sudo yum install mesa-libGLU-devel mesa-libGL-devel libXmu-devel.i686 libXi-devel.i686

LuciferJack
  • 781
  • 11
  • 12
0

After you do the installation of the above 3rd party libraries, no harm running the NVIDIA driver installation again if you encounter something like this:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../libGL.so when searching for -lGL/usr/bin/ld: skipping incompatible /lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [simpleGL] Error 1

This is because some of the symbolic links were broken by the installation. This is CUDA 7 with CentOS 7. https://www-947.ibm.com/support/entry/portal/docdisplay?lndocid=migr-5094265

lppier
  • 1,927
  • 3
  • 24
  • 62
0

I was getting the same error. I tried sudo apt-get install libglu1-mesa and it worked.

Faeza
  • 101
  • 5