dyld: Library not loaded: @rpath/libcudart.dylib ?
What am I doing wrong?

RCS-Mac-Pro:~ rmark$
cd /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_
RCS-Mac-Pro:Mandelbrot_ rmark$ ls -l
total 69096
-rwxr-xr-x 1 rmark staff 758500 Sep 14 08:45 Mandelbrot
drwxrwxr-x 7 rmark staff 238 Sep 19 20:05 data
-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.0.dylib
-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.dylib
-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.dylib
-rwxrwxr-x 1 rmark staff 15913168 Sep 3 10:00 libcublas.dylib
-rwxrwxr-x 1 rmark staff 5444172 Sep 3 10:00 libcublasemu.dylib
-rwxrwxr-x 1 rmark staff 276652 Sep 3 10:00 libcudart.dylib
-rwxrwxr-x 1 rmark staff 8481764 Sep 3 10:00 libcufft.dylib
-rwxrwxr-x 1 rmark staff 1501720 Sep 3 10:00 libcufftemu.dylib
-rw-rw-r-- 1 rmark staff 2197668 Sep 9 02:34 libnvcuvid.dylib
-rwxrwxr-x 1 rmark staff 13100 Sep 3 10:00 libtlshook.dylib
-rw-r--r-- 1 rmark staff 88094 Sep 14 08:52
mandelbrot_NV9600GT.jpg
-rw-rw-r-- 1 rmark staff 47 Sep 9 02:34 params.txt
RCS-Mac-Pro:Mandelbrot_ rmark
$ /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot
dyld: Library not loaded: @rpath/libcudart.dylib
Referenced
from: /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot
Reason: image not found
Trace/BPT trap
What am I doing wrong?



RCS-Mac-Pro:~ rmark$

cd /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_

RCS-Mac-Pro:Mandelbrot_ rmark$ ls -l

total 69096

-rwxr-xr-x 1 rmark staff 758500 Sep 14 08:45 Mandelbrot

drwxrwxr-x 7 rmark staff 238 Sep 19 20:05 data

-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.0.dylib

-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.dylib

-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.dylib

-rwxrwxr-x 1 rmark staff 15913168 Sep 3 10:00 libcublas.dylib

-rwxrwxr-x 1 rmark staff 5444172 Sep 3 10:00 libcublasemu.dylib

-rwxrwxr-x 1 rmark staff 276652 Sep 3 10:00 libcudart.dylib

-rwxrwxr-x 1 rmark staff 8481764 Sep 3 10:00 libcufft.dylib

-rwxrwxr-x 1 rmark staff 1501720 Sep 3 10:00 libcufftemu.dylib

-rw-rw-r-- 1 rmark staff 2197668 Sep 9 02:34 libnvcuvid.dylib

-rwxrwxr-x 1 rmark staff 13100 Sep 3 10:00 libtlshook.dylib

-rw-r--r-- 1 rmark staff 88094 Sep 14 08:52

mandelbrot_NV9600GT.jpg

-rw-rw-r-- 1 rmark staff 47 Sep 9 02:34 params.txt

RCS-Mac-Pro:Mandelbrot_ rmark

$ /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot

dyld: Library not loaded: @rpath/libcudart.dylib

Referenced

from: /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot

Reason: image not found

Trace/BPT trap

#1
Posted 09/30/2009 07:48 PM   
you're not doing wrong but it seems like you didn't set properly environment variables to your library path

open a terminal
export LD_LIBRARY_PATH=your_full_path_to_the_library

should then work properly

regards

[quote name='rmark' post='594725' date='Sep 30 2009, 09:48 PM']What am I doing wrong?

RCS-Mac-Pro:~ rmark$
cd /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_
RCS-Mac-Pro:Mandelbrot_ rmark$ ls -l
total 69096
-rwxr-xr-x 1 rmark staff 758500 Sep 14 08:45 Mandelbrot
drwxrwxr-x 7 rmark staff 238 Sep 19 20:05 data
-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.0.dylib
-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.dylib
-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.dylib
-rwxrwxr-x 1 rmark staff 15913168 Sep 3 10:00 libcublas.dylib
-rwxrwxr-x 1 rmark staff 5444172 Sep 3 10:00 libcublasemu.dylib
-rwxrwxr-x 1 rmark staff 276652 Sep 3 10:00 libcudart.dylib
-rwxrwxr-x 1 rmark staff 8481764 Sep 3 10:00 libcufft.dylib
-rwxrwxr-x 1 rmark staff 1501720 Sep 3 10:00 libcufftemu.dylib
-rw-rw-r-- 1 rmark staff 2197668 Sep 9 02:34 libnvcuvid.dylib
-rwxrwxr-x 1 rmark staff 13100 Sep 3 10:00 libtlshook.dylib
-rw-r--r-- 1 rmark staff 88094 Sep 14 08:52
mandelbrot_NV9600GT.jpg
-rw-rw-r-- 1 rmark staff 47 Sep 9 02:34 params.txt
RCS-Mac-Pro:Mandelbrot_ rmark
$ /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot
dyld: Library not loaded: @rpath/libcudart.dylib
Referenced
from: /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot
Reason: image not found
Trace/BPT trap[/quote]
you're not doing wrong but it seems like you didn't set properly environment variables to your library path



open a terminal

export LD_LIBRARY_PATH=your_full_path_to_the_library



should then work properly



regards



[quote name='rmark' post='594725' date='Sep 30 2009, 09:48 PM']What am I doing wrong?



RCS-Mac-Pro:~ rmark$

cd /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_

RCS-Mac-Pro:Mandelbrot_ rmark$ ls -l

total 69096

-rwxr-xr-x 1 rmark staff 758500 Sep 14 08:45 Mandelbrot

drwxrwxr-x 7 rmark staff 238 Sep 19 20:05 data

-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.0.dylib

-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.1.5.dylib

-rw-rw-r-- 1 rmark staff 222040 Sep 9 02:34 libGLEW.dylib

-rwxrwxr-x 1 rmark staff 15913168 Sep 3 10:00 libcublas.dylib

-rwxrwxr-x 1 rmark staff 5444172 Sep 3 10:00 libcublasemu.dylib

-rwxrwxr-x 1 rmark staff 276652 Sep 3 10:00 libcudart.dylib

-rwxrwxr-x 1 rmark staff 8481764 Sep 3 10:00 libcufft.dylib

-rwxrwxr-x 1 rmark staff 1501720 Sep 3 10:00 libcufftemu.dylib

-rw-rw-r-- 1 rmark staff 2197668 Sep 9 02:34 libnvcuvid.dylib

-rwxrwxr-x 1 rmark staff 13100 Sep 3 10:00 libtlshook.dylib

-rw-r--r-- 1 rmark staff 88094 Sep 14 08:52

mandelbrot_NV9600GT.jpg

-rw-rw-r-- 1 rmark staff 47 Sep 9 02:34 params.txt

RCS-Mac-Pro:Mandelbrot_ rmark

$ /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot

dyld: Library not loaded: @rpath/libcudart.dylib

Referenced

from: /Applications/CUDA/CUDA_Nvidia_GPU_Benches/Mandelbrot_/Mandelbrot

Reason: image not found

Trace/BPT trap

#2
Posted 10/01/2009 07:25 PM   
I wish NVidia would use the "-install_name" linker option when they build their dylibs. Then this would be a non-issue.

Most Mac apps and libraries assume that users do not know how to play with DYLD_LIBRARY_PATH environment variable. The "-install_name" linker option sets a default value for the library search path, so the user does not have to diddle with these Environment variables. Unfortunately NVidia does not set this when they build their dynamic libraries.

Here is what they need to add to their makefile:
-install_name "/usr/local/cuda/lib/libcudart.dylib"

See the [topic="155824"]Makefile templage for Cocoa/CUDA projects[/topic] for showing how to set this option. That example shows how to set it for a new dyllib that is shipped inside of a new application's bundle.
I wish NVidia would use the "-install_name" linker option when they build their dylibs. Then this would be a non-issue.



Most Mac apps and libraries assume that users do not know how to play with DYLD_LIBRARY_PATH environment variable. The "-install_name" linker option sets a default value for the library search path, so the user does not have to diddle with these Environment variables. Unfortunately NVidia does not set this when they build their dynamic libraries.



Here is what they need to add to their makefile:

-install_name "/usr/local/cuda/lib/libcudart.dylib"



See the [topic="155824"]Makefile templage for Cocoa/CUDA projects[/topic] for showing how to set this option. That example shows how to set it for a new dyllib that is shipped inside of a new application's bundle.

#3
Posted 01/09/2010 10:24 PM   
Does it work for you now rmark? I'm having the same problem even though I've added the environment variables. It looks like this:

[code]export PATH=/usr/local/cuda/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH[/code]

Im compiling a Matlab mex file using the following commands in Matlab console:
[code]!nvcc -c knn.cu -Xcompiler -fPIC -I/Applications/MATLAB_R2009b.app/extern/include/
nvmex knn.o -L/usr/local/cuda/lib -lcudart -lcufft -cxx -lcuda[/code]

It's compiling alright but recieve the following error when running the program:
[code]??? Invalid MEX-file '/Users/Snut/CUDA/v2/knn.mexmaci':
dlopen(/Users/Snut/CUDA/v2/knn.mexmaci, 1): Library not loaded: @rpath/libcudart.dylib
Referenced from: /Users/Snut/CUDA/v2/knn.mexmaci
Reason: image not found.[/code]

What's up with that?

Edit: typo
Does it work for you now rmark? I'm having the same problem even though I've added the environment variables. It looks like this:



export PATH=/usr/local/cuda/bin:$PATH

export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH




Im compiling a Matlab mex file using the following commands in Matlab console:

!nvcc -c knn.cu -Xcompiler -fPIC -I/Applications/MATLAB_R2009b.app/extern/include/

nvmex knn.o -L/usr/local/cuda/lib -lcudart -lcufft -cxx -lcuda




It's compiling alright but recieve the following error when running the program:

??? Invalid MEX-file '/Users/Snut/CUDA/v2/knn.mexmaci':

dlopen(/Users/Snut/CUDA/v2/knn.mexmaci, 1): Library not loaded: @rpath/libcudart.dylib

Referenced from: /Users/Snut/CUDA/v2/knn.mexmaci

Reason: image not found.




What's up with that?



Edit: typo

#4
Posted 01/11/2010 10:40 AM   
[quote name='Steve Brodhead' post='978475' date='Jan 9 2010, 05:24 PM']I wish NVidia would use the "-install_name" linker option when they build their dylibs. Then this would be a non-issue.

Most Mac apps and libraries assume that users do not know how to play with DYLD_LIBRARY_PATH environment variable. The "-install_name" linker option sets a default value for the library search path, so the user does not have to diddle with these Environment variables. Unfortunately NVidia does not set this when they build their dynamic libraries.

Here is what they need to add to their makefile:
-install_name "/usr/local/cuda/lib/libcudart.dylib"

See the [topic="155824"]Makefile templage for Cocoa/CUDA projects[/topic] for showing how to set this option. That example shows how to set it for a new dyllib that is shipped inside of a new application's bundle.[/quote]

Nvidia is actually doing something much better than using -install_name now by using @rpath/libcudart.dylib .

To take advantage of this all you need to do is use -Xlinker -rpath,/usr/local/cuda/lib as an argument to nvcc during the build. This will bake a runtime library search path into the compiled binary such that user's who don't (or can't due to stability reasons) define DYLD_LIBRARY_PATH will be covered.
[quote name='Steve Brodhead' post='978475' date='Jan 9 2010, 05:24 PM']I wish NVidia would use the "-install_name" linker option when they build their dylibs. Then this would be a non-issue.



Most Mac apps and libraries assume that users do not know how to play with DYLD_LIBRARY_PATH environment variable. The "-install_name" linker option sets a default value for the library search path, so the user does not have to diddle with these Environment variables. Unfortunately NVidia does not set this when they build their dynamic libraries.



Here is what they need to add to their makefile:

-install_name "/usr/local/cuda/lib/libcudart.dylib"



See the [topic="155824"]Makefile templage for Cocoa/CUDA projects[/topic] for showing how to set this option. That example shows how to set it for a new dyllib that is shipped inside of a new application's bundle.



Nvidia is actually doing something much better than using -install_name now by using @rpath/libcudart.dylib .



To take advantage of this all you need to do is use -Xlinker -rpath,/usr/local/cuda/lib as an argument to nvcc during the build. This will bake a runtime library search path into the compiled binary such that user's who don't (or can't due to stability reasons) define DYLD_LIBRARY_PATH will be covered.

#5
Posted 07/25/2010 02:18 PM   
Scroll To Top