Unable to make the CUDA Sample after installing the CUDA toolkit

I have the GEFORCE GTX 1050 GPU to use i installed the nvidia 884.98 driver using RHEL/CentOS 7.3 Bumblebee setup procedure from " http://ezequielm.com/blog/rhelcentos-7-3-bumblebee-setup/" on redhat 7.4 linux x86_64. The nvidia driver is installed according to the above blog i checked using “optirun nvidia-settings -c :8.0” command and got the Nvidia X server settings screen and when i used this commad “dmesg | grep bbswitch” also i got the following output.
21.900440] bbswitch: version 0.8
[ 21.900451] bbswitch: Found integrated VGA device 0000:00:02.0: SB.PCI0.GFX0
[ 21.900459] bbswitch: Found discrete VGA device 0000:01:00.0: SB.PCI0.PEG0.PEGP
[ 21.900618] bbswitch: detected an Optimus _DSM function
[ 21.900630] bbswitch: device 0000:01:00.0 is in use by driver ‘nvidia’, refusing OFF
[ 21.900634] bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on

i think the driver is working. Next, i try to install the CUDA toolkit and i try to validate the successful installation of the toolkit using “nvcc -V” command and i got:
vcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

Next, i try to run the make command to run the CUDA sample before running the command “./deviceQuery” but i face an error as follows:

[root@localhost ~]# cd NVIDIA_CUDA-9.0_Samples
[root@localhost NVIDIA_CUDA-9.0_Samples]# make
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleOccupancy’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleOccupancy’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMultiCopy’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMultiCopy’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMul’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMul’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleCallback’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleCallback’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAdd_nvrtc’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAdd_nvrtc’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/template’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/template’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleCubemapTexture’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleCubemapTexture’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/cppOverload’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/cppOverload’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/cudaTensorCoreGemm’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/cudaTensorCoreGemm’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/systemWideAtomics’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/systemWideAtomics’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleIPC’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleIPC’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleVoteIntrinsics’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleVoteIntrinsics’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleSeparateCompilation’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleSeparateCompilation’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTexture’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTexture’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/UnifiedMemoryStreams’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/UnifiedMemoryStreams’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/cudaOpenMP’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/cudaOpenMP’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleSurfaceWrite’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleSurfaceWrite’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/cppIntegration’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/cppIntegration’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/inlinePTX_nvrtc’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/inlinePTX_nvrtc’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/clock_nvrtc’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/clock_nvrtc’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/fp16ScalarProduct’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/fp16ScalarProduct’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTemplates’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTemplates’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMulCUBLAS’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMulCUBLAS’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAddDrv’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAddDrv’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMulDrv’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMulDrv’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAssert_nvrtc’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAssert_nvrtc’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/cdpSimpleQuicksort’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/cdpSimpleQuicksort’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleStreams’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleStreams’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simplePrintf’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simplePrintf’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleLayeredTexture’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleLayeredTexture’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/clock’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/clock’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleVoteIntrinsics_nvrtc’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleVoteIntrinsics_nvrtc’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleCooperativeGroups’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleCooperativeGroups’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleZeroCopy’
make[1]: Nothing to be done for `all’.

make[1]: Leaving directory `/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleZeroCopy’
WARNING - No MPI compiler found.
CUDA Sample “simpleMPI” cannot be built without an MPI Compiler.
This will be a dry-run of the Makefile.
For more information on how to set up your environment to build and run this

sample, please refer the CUDA Samples documentation and release notes
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMPI’
[@] mpicxx -I…/…/common/inc -o simpleMPI_mpi.o -c simpleMPI.cpp
[@] /usr/local/cuda-9.0/bin/nvcc -ccbin g++ -I…/…/common/inc -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_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o simpleMPI.o -c simpleMPI.cu
[@] mpicxx -o simpleMPI simpleMPI_mpi.o simpleMPI.o -L/usr/local/cuda-9.0/lib64 -lcudart
[@] mkdir -p …/…/bin/x86_64/linux/release
[@] cp simpleMPI …/…/bin/x86_64/linux/release
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMPI’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/cdpSimplePrint’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/cdpSimplePrint’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTextureDrv’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTextureDrv’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAdd’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAdd’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAtomicIntrinsics_nvrtc’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAtomicIntrinsics_nvrtc’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAtomicIntrinsics’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAtomicIntrinsics’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/inlinePTX’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/inlinePTX’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simplePitchLinearTexture’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simplePitchLinearTexture’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMultiGPU’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMultiGPU’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTemplates_nvrtc’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleTemplates_nvrtc’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleP2P’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleP2P’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/asyncAPI’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/asyncAPI’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMul_nvrtc’
cp “”/usr/local/cuda-9.0"/include/cooperative_groups.h" .
cp “”/usr/local/cuda-9.0"/include/cooperative_groups_helpers.h" .
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/0_Simple/matrixMul_nvrtc’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAssert’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleAssert’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQueryDrv’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQueryDrv’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/1_Utilities/p2pBandwidthLatencyTest’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/1_Utilities/p2pBandwidthLatencyTest’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/1_Utilities/topologyQuery’
make[1]: Nothing to be done for all’.
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/1_Utilities/topologyQuery’
make[1]: Entering directory /root/NVIDIA_CUDA-9.0_Samples/1_Utilities/bandwidthTest’
make[1]: Nothing to be done forall’.
make[1]: Leaving directory /root/NVIDIA_CUDA-9.0_Samples/1_Utilities/bandwidthTest’
make[1]: Entering directory/root/NVIDIA_CUDA-9.0_Samples/2_Graphics/Mandelbrot’
“/usr/local/cuda-9.0”/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_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o Mandelbrot Mandelbrot.o Mandelbrot_cuda.o Mandelbrot_gold.o -L/usr/lib64/nvidia -lGL -lGLU -lX11 -lglut
/usr/bin/ld: warning: libGLX.so.0, needed by /usr/lib64/nvidia/libGL.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libGLdispatch.so.0, needed by /usr/lib64/nvidia/libGL.so, not found (try using -rpath or -rpath-link)
/usr/lib64/nvidia/libGL.so: undefined reference to __glDispatchRegisterStubCallbacks’
/usr/lib64/nvidia/libGL.so: undefined reference to__glXGLLoadGLXFunction’
/usr/lib64/nvidia/libGL.so: undefined reference to _glapi_Current’
/usr/lib64/nvidia/libGL.so: undefined reference to__glDispatchFini’
/usr/lib64/nvidia/libGL.so: undefined reference to _glapi_get_current’
/usr/lib64/nvidia/libGL.so: undefined reference to__glDispatchUnregisterStubCallbacks’
/usr/lib64/nvidia/libGL.so: undefined reference to __glDispatchInit’
collect2: error: ld returned 1 exit status
make[1]: *** [Mandelbrot] Error 1
make[1]: Leaving directory/root/NVIDIA_CUDA-9.0_Samples/2_Graphics/Mandelbrot’
make: *** [2_Graphics/Mandelbrot/Makefile.ph_build] Error 2

[root@localhost NVIDIA_CUDA-9.0_Samples]#

What is the error that happed? and how to fix it?
Please i need solution highly!
Thanks.

Please some body who face this challenge reply me.

some CUDA sample apps need various OpenGL libraries (and GL/X libraries) installed in order for you to build those apps. If you don’t have the necessary libraries installed, those apps won’t build. I assume since you have no idea what this is or what the error is here, you probably don’t need or care about those apps like Mandelbrot. If that is the case, then

Just do:

make -k

and it will build all the samples that it is capable of building.

If you think you need this sample app or these libraries, start by reading the install guide here:

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

1 Like