CUDA 8.0 missing required libraries on Ubuntu 16.04
I've just installed CUDA 8.0 on my fresh Mint18 install (which is Ubuntu16.04 underneath) and despite carefully following the preinstall instructions, it seems to be missing some requirements. During the install it complained about not being able to find libGLU.so, libX11.so, libXi.so and libXmu.so, but claimed to have installed successfully without them. Following the guide, I then tried compiling the sample programs, which also complained a lot. First it couldn't find g++, which wasn't listed in the requirements (just gcc) so I installed that. Then it got a bit further, but said: [code]>>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<< >>> WARNING - libGLU.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 - gl.h 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. <<< >>> WARNING - Xlib.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<< [/code] So far as I can find, none of these are mentioned in the install guide. It does mention ICC, PGI, XLC and CLANG, but no mention of what they are or how to install them. The sample "make" seems to complete without crashing, but doesn't produce the actual "nbody" file which I'm supposed to run to prove the install has worked. Is there something obvious that the install guide has assumed I have? Thanks in advance, Tom
I've just installed CUDA 8.0 on my fresh Mint18 install (which is Ubuntu16.04 underneath) and despite carefully following the preinstall instructions, it seems to be missing some requirements.
During the install it complained about not being able to find libGLU.so, libX11.so, libXi.so and libXmu.so, but claimed to have installed successfully without them.
Following the guide, I then tried compiling the sample programs, which also complained a lot. First it couldn't find g++, which wasn't listed in the requirements (just gcc) so I installed that. Then it got a bit further, but said:
>>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> WARNING - libGLU.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 - gl.h 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. <<<
>>> WARNING - Xlib.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<<

So far as I can find, none of these are mentioned in the install guide. It does mention ICC, PGI, XLC and CLANG, but no mention of what they are or how to install them.

The sample "make" seems to complete without crashing, but doesn't produce the actual "nbody" file which I'm supposed to run to prove the install has worked.

Is there something obvious that the install guide has assumed I have?
Thanks in advance,
Tom

#1
Posted 02/13/2017 11:42 PM   
The install guide mentions that some additional libraries may be required for various samples, but does not outline each requirement for each sample across all distros, etc. [url]http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#install-libraries[/url] These GL/X libraries are only required for certain sample codes that use CUDA/OpenGL interop functionality. If you're not particularly concerned about these sample codes, then you can just skip/ignore by running: make -k and *most* of the sample codes will be correctly built for your use. If you want these OpenGL interop sample codes to be correctly built, you'll need to install the various libraries. Concise instructions vary by distro, I don't happen to know what they are or the best install method for Arch linux, but google searches usually turn up the necessary info for me. Note that Arch Linux (even though it is "Ubuntu 16.04 underneath") is not an officially supported distro, so I make no claims of correctness. YMMV.
The install guide mentions that some additional libraries may be required for various samples, but does not outline each requirement for each sample across all distros, etc.

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#install-libraries

These GL/X libraries are only required for certain sample codes that use CUDA/OpenGL interop functionality. If you're not particularly concerned about these sample codes, then you can just skip/ignore by running:

make -k

and *most* of the sample codes will be correctly built for your use.

If you want these OpenGL interop sample codes to be correctly built, you'll need to install the various libraries. Concise instructions vary by distro, I don't happen to know what they are or the best install method for Arch linux, but google searches usually turn up the necessary info for me. Note that Arch Linux (even though it is "Ubuntu 16.04 underneath") is not an officially supported distro, so I make no claims of correctness. YMMV.

#2
Posted 02/13/2017 11:55 PM   
Thanks txbob. For anyone else trying to do the same thing, I've finally got this working by doing: [code] sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev [/code] then using [code] GLPATH=/usr/lib make [/code] instead of just "make"
Thanks txbob.

For anyone else trying to do the same thing, I've finally got this working by doing:
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev

then using
GLPATH=/usr/lib make

instead of just "make"

#3
Posted 02/15/2017 11:50 AM   
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 Also answered in there: https://stackoverflow.com/a/46362272/1851492 [code] # 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"] [/code]
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


Also answered in there:

https://stackoverflow.com/a/46362272/1851492


# 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"]

#4
Posted 09/22/2017 11:03 AM   
Scroll To Top

Add Reply