缺少推荐的库:libGLU.so

时间:2014-03-12 18:33:30

标签: linux ubuntu cuda gpu

我正在尝试安装NVIDIA CUDA。安装工具包时,它显示以下错误消息。

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

我不是Linux人员,所以我使用apt-get install libGLU.so来安装它,但它没有用。我该如何修复并安装这些?我在32位Linux上。

6 个答案:

答案 0 :(得分:18)

试试apt-get install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev。您可以通过searching the Ubuntu package contents自行查找此信息。

答案 1 :(得分:3)

我使用nvidia-docker来设置CUDA开发环境,也遇到同样的问题。所以我尝试解决这个问题并写下Dockerfile。还添加了一些有用的评论,希望它会有所帮助。

这是我的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"]

答案 2 :(得分:0)

安装完上述第三方库后,如果遇到类似的情况,再次运行NVIDIA驱动程序安装不会有任何危害:

/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

这是因为某些符号链接被安装破坏了。这是带有CentOS 7的CUDA 7。 https://www-947.ibm.com/support/entry/portal/docdisplay?lndocid=migr-5094265

答案 3 :(得分:0)

根据这个答案https://stackoverflow.com/a/42428296/3425200, 安装libs后,应将环境设置为:

GLPATH=/usr/lib make

而不是make。

答案 4 :(得分:0)

我得到了同样的错误。我尝试了sudo apt-get install libglu1-mesa并且有效。

答案 5 :(得分:0)

可能对其他用户使用yum有帮助: 在cuda-10.0中为我工作:

  

sudo yum安装mesa-libGLU-devel mesa-libGL-devel libXmu-devel.i686   libXi-devel.i686