cuda 9.0 install with nvidia-384 drivers

I have followed all the steps on the installation guide but my make fails for nbody simulation with the following error.
I can see that libnvidia-tls.so.384.111 is present at /usr/lib/nvidia-384/tls/ . How do I add it to -rpath or -rpath-link?
Please help me with where I’m going wrong, thanks!

/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 nbody bodysystemcuda.o nbody.o render_particles.o -L/usr/lib/nvidia-384 -lGL -lGLU -lX11 -lglut
/usr/bin/ld: warning: libnvidia-tls.so.384.111, needed by /usr/lib/nvidia-384/libGL.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvidia-glcore.so.384.111, needed by /usr/lib/nvidia-384/libGL.so, not found (try using -rpath or -rpath-link)
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv018tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv017glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv023tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv016glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv015tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv019tls’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv000glcore' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv017tls’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv013tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv018glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv024tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv022tls’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv007tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv009tls’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv020tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv014glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv015glcore' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv016tls’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv001glcore' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv024glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv008tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv006tls’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv021tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv023glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv011tls' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv020glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to _nv022glcore' /usr/lib/nvidia-384/libGL.so: undefined reference to _nv027glcore’
/usr/lib/nvidia-384/libGL.so: undefined reference to `_nv014tls’
collect2: error: ld returned 1 exit status
Makefile:298: recipe for target ‘nbody’ failed
make: *** [nbody] Error 1

I’m getting the same error, any help is definitely appreciated!

I assume this is on Ubuntu

Instead of just issuing make, try:

GLLINK="-L/usr/lib/nvidia-384/ -L/usr/lib/nvidia-384/tls/" make

that may not fix all the link errors. If it does not, I’ll need to know where libnvidia-glcore.so.384.111 is.

Thanks! I moved this to my /etc/ld.so.conf and everything builds great.

@jpratt, can you please elaborate on what you moved to /etc/ld.so.conf.d? And any other helpful info as I’m experiencing the same issue. Thanks!