Error in Installation of NVIDIA_CUDA-9.2_Samples/5_Simulations/nbody on CentOS 7.4.1708

When I’m making executables inside NVIDIA_CUDA-9.2_Samples, an error occurs inside the nbody directory of 5_Simulations.

"/usr/local/cuda-9.2"/bin/nvcc -ccbin g++   -m64      -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o nbody bodysystemcuda.o nbody.o render_particles.o  -L/usr/lib64/nvidia -lGL -lGLU -lglut
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../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: *** [nbody] Error 1
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core)
Release:        7.4.1708
Codename:       Core

It needs to find the NVIDIA libGL, which is installed by the GPU driver.

Your driver install may be broken, or you may have selected “no” when prompted to install the OpenGL libraries when installing the driver, or the driver may have installed the libGL in a place other than what that makefile is looking for

Thank you. It worked. I reinstalled the driver.