shrUtils.h Where is this file?

When I compile the basic program in the CUDA examples 3.0; I get the following error.

shrUtils.h: No such file or directory

I know the earlier versions of this program compiled with no problem, but this is the latest version and I am unfamiliar with the file shrUtils.h. I cannot search for it because i am using a computer remotely which is now locked. Where is this file? I am assuming that it was installed with the 3.0 version software, but the compiler is not finding it because there is no path to it. If I knew where it was, I would add a path to PATH.



Yes, that I where I found it. But I still get the error cannot find shrUtils.h, when I compile.

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/src/BlackScholes$ nvcc -g -G -I…/…/common/inc -L…/…/lib -o BlackScholes BlackScholes_gold.cpp -lcutil error: shrUtils.h: No such file or directory

My path;

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/src/BlackScholes$ echo $PATH


I gave it the path that you said. The user is errol. But why is it still not able to find the file?


PATH has absolutely nothing to do with it and won’t fix anything. This might:

nvcc -g -G -I../../common/inc -I../../common/shared -L../../lib -o BlackScholes BlackScholes_gold.cpp -lcutil

You really will get a lot more done in a lot less time if you make the effort to read and understand the Linux and CUDA toolchain documentation. This “development and debugging by forum questions” methodology can’t be all that efficient.

That was the command that I was using. It is the same as yours and I got this error. I will use your command exactly as you state it and see what happens.

nvcc -g -G -I…/…/common/inc -I…/…/common/shared -L…/…/lib -o BlackScholes BlackScholes_gold.cpp -lcutil error: shrUtils.h: No such file or directory


This command worked perfectly in a previous installation of CUDA.

Here it is not finding shrUtils,h. Since I know the file is on the disk and where it is, I must assume the compiler is not finding it because it is not in the path. I know now that $PATH has nothing to do with it, so I changed it back. I know that it must be LD_LIBRAY_PATH since that it only path remaining; when I installed an earlier version CUDA it instructed me to alter the LD_LIBRARY_PATH. I did not do this current installation and it is possible that the person who did the installing did not alter the LD_LIBRARY_PATH.

I am guessing that I must include

/home/errol/NVIDIA_GPU_Computing_SDk/shared/inc (the location of shrUtils.h)


Will that take care of this error?



errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/src/BlackScholes$ echo $LD_LIBRARY_PATH


Again, LD_LIBRARY_PATH also has nothing to do with this - it controls the ability of the linux runtime to find libraries when programs are run.

On my fresh version 3.0 SDK installation this works :

avidday@cuda:~/NVIDIA_GPU_Computing_SDK_3.0/C/src/BlackScholes$ nvcc -g -G -I../../common/inc -I../../../shared/inc -L../../lib -L../../../shared/lib -o BlackScholes BlackScholes_gold.cpp -lcutil_x86_64 -lshrutil_x86_64

avidday@cuda:~/NVIDIA_GPU_Computing_SDK_3.0/C/src/BlackScholes$ ./BlackScholes 


./BlackScholes Starting...

Initializing data...

...allocating CPU memory for options.

...allocating GPU memory for options.

...generating input data in CPU mem.

...copying input data to GPU mem.

Data init done.

Executing Black-Scholes GPU kernel (512 iterations)...

Options count			 : 8000000	 

BlackScholesGPU() time	: 5.915592 msec

Effective memory bandwidth: 13.523584 GB/s

Gigaoptions per second	: 1.352358	 

BlackScholes, Throughput = 1.3524 GOptions/s, Time = 0.00592 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128

Reading back GPU results...

Checking the results...

...running CPU calculations.

Comparing the results...

L1 norm: 1.804101e-07

Max absolute error: 1.239777e-05

Shutting down...

...releasing GPU memory.

...releasing CPU memory.

Shutdown done.

[BlackScholes] - Test Summary


Press <Enter> to Quit...


If you are using a 32 bit machine or have things in the a different place, the paths required for -I and -L will change, and so will the library names. I will leave it as an exercise to the reader to work out how they should be changed.

Below is my attempt to get matrixMul to compile (the program is unimportant, compiling an example is), but it says that it cannot find -lcutil_i386.a. On close examination of the output and specifically the include lists shows I gave it the path to -libcutil_i386.a. It still says that it cannot find it!

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/src/matrixMul$ nvcc -g -G -I…/…/common/inc -L…/…/lib -I /home/errol/NVIDIA_GPU_Computing_SDK/shared/inc -L /home/errol/NVIDIA_GPU_Computing_SDK/C/lib -L /home/errol/NVIDIA_GPU_Computing_SDK/shared/lib -o matrixMul matrixMul_gold.cpp -libcutil_i386.a -libshrutil_i386.a

/usr/bin/ld: cannot find -libcutil_i386.a

collect2: ld returned 1 exit status

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/src/matrixMul$ cd …

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/src$ cd …

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C$ cd lib

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/lib$ ls

libcutil_i386.a libparamgl_i386.a librendercheckgl_i386.a

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/lib$ pwd


errol@fermi:~/NVIDIA_GPU_Computing_SDK/C/lib$ cd …

errol@fermi:~/NVIDIA_GPU_Computing_SDK/C$ cd …

errol@fermi:~/NVIDIA_GPU_Computing_SDK$ cd shared/lib

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared/lib$ ls

libshrutil_i386.a linux

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared/lib$ pwd


errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared/lib$ cd …

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared$ cd …

errol@fermi:~/NVIDIA_GPU_Computing_SDK$ ls

bin C cudpp_license.txt doc lib license.txt OpenCL shared

errol@fermi:~/NVIDIA_GPU_Computing_SDK$ cd shared

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared$ ls inc lib Makefile obj src

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared$ cd inc

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared/inc$ ls

cmd_arg_reader.h dynlink multithreading.h nvMath.h nvShaderUtils.h rendercheckGL.h stopwatch_base.inl

cudpp exception.h nvGlutWidgets.h nvMatrix.h nvVector.h shrUtils.h stopwatch.h

cuvid GL nvGLWidgets.h nvQuaternion.h nvWidgets.h stopwatch_base.h stopwatch_linux.h

errol@fermi:~/NVIDIA_GPU_Computing_SDK/shared/inc$ pwd


I believe that this is the 32 bit equivalent of the 64 bit command that you gave, however, it still is not finding -lcutil_i386.a. I give the path to -lcutil_i386.a (home/errol/NVIDIA_GPU_Computing_SDK/C/lib) and it says it cannot find the file.

I gave the path to -libshrutil_i386.a (/home/errol/NVIDIA_GPU_Computing_SDK/shared/lib) and it found the file.

I gave it the path to shrUtils.h (/home/errol/NVIDIA_GPU_Computing_SDK/shared/inc) and it found the file.

It finds everything, but -lcutil_i386.a. What is the error here?


The name. When you specify a library, don’t add any extension - the linker will look for shared or static versions automatically, so the link command should be just -lcutil_i386 . You can clearly see that in the example I posted.

OK. I will try it.

Where is this discussed in the CUDA literature? I check the makefile for an it does not even mention -libcutil.a or libcutil_i386.a.

I saw it in the posted example, true. It fact it easily compiled in earlier versions of CUDA - once I got the syntax right. But this one is seems different. It is much harder.


I tried your suggestion and the result is shown below:

nvcc -g -G -I…/…/common/inc -L…/…/lib -I /home/errol/NVIDIA_GPU_Computing_SDK/shared/inc -L /home/errol/NVIDIA_GPU_Computing_SDK/C/lib -L /home/errol/NVIDIA_GPU_Computing_SDK/shared/lib -o matrixMul matrixMul_gold.cpp -libcutil_i386 -libshrutil_i386

/usr/bin/ld: cannot find -libcutil_i386

collect2: ld returned 1 exit status

This time I put a copy of libcutil_i386.a in the same directory as the matrixMul code. It still gave the same error. I am assuming that there must be something wrong with the file. When it cannot find the file when it is even in the same directory as the source - the file has to be corrupted.

I am unsure as to how to test -libcutil_i386 accessibilitty any other way. Clearly, no matter what I do it still cannot access this file.

How can I test this file for correctness or corruptedness?


PS. does the /usr/bin/ld: have anything t

o do with this? It is in the error message.

Try -lcutil_i386 instead of -libcutil_i386.

When providing a link command with “-l” , it will search for a file named “” or “lib.a”
So “-lcutil_i386” corresponds to the files “” or “libcutil_i386.a”


You did not try my suggestion at all. Quoting myself (with emphasis):

To link libcutil_i386.a your link commands must be -lcutil_i386 and if the library is in a non-system path, that path must be supplied in a -L argument.

It isn’t. The library which you are trying to link with is an internal component of the SDK and not part of CUDA. It has no documentation and is not meant to be used for anything else. The actual arguments to nvcc to specify paths and libraries are briefly covered in the nvcc documentation (and the help nvcc will print using nvcc --help), but the description is brief because nvcc just follows the conventions used by gcc, and anyone with even passing familiarity with gcc (or just about any other unix compiler for that matter), will know what to do.

Nonsense. If you read the documentation for gcc or ld you will see that the current directory is not in the library search path by default. I am sure the library is fine - a corrupted file won’t generate a file not found error. You really need to spend some time and familiarize yourself with the gnu tool chain - make, gcc, ld . It will demystify all of this and make your life so much easier.

Please gives me a web address that discuses this. Linux books are at a premium around here, while websites are not. Anyway, the Linux book that I would get will probably discuss this topic lightly. It it just a good idea to get a website not a book. Please give me a website.


How about the gcc online documentation?