online version not working for my ubuntu 10.04

26 views
Skip to first unread message

Junjie Wu

unread,
Aug 4, 2010, 8:00:15 PM8/4/10
to VSCSE Many-core Processors 2010
Hello,

I just downloaded the online.tgz to my 64-bit ubuntu 10.04. parboil
fails when linking the library:

nvcc -L/media/Software/CUDA_WORKSHOP_UIUC1008.online/common/lib -lm -
lpthread -lcuda -L/usr/local/cuda/lib64 -L/media/Software/
CUDA_WORKSHOP_UIUC1008.online/common/lib build/cuda_default/
deviceQuery.o -o build/cuda_default/deviceQuery -lparboil_cuda -lcuda -
lcudart -lparboil
/usr/bin/ld: cannot find -lcuda
collect2: ld returned 1 exit status

I'm pretty sure that my environmental setup is correct, cause I can
still run the intro-to-cuda programs on my computer.

Any hints?

Regards,
- Junjie Wu

Heeseok Kim

unread,
Aug 4, 2010, 10:18:28 PM8/4/10
to vscse-many-core...@googlegroups.com
Copied from previous thread. How about change $CUDAHOME as below?

Here is the revision history.

    Date: 08/04/2010: Revising the Makefiles for machines not having NVCC
    installed at /usr/local/cuda. If you have no problems with the package
    downloaded previously, please ignore this update.
    
    You'll need to revise the Makefile and macro within it listed below to fit your
    environment. The default value for $CUDAHOME is "/usr/local/cuda".

    $PARBOIL_ROOT/common/platform/cuda.mk
    CUDAHOME=<cuda installation directory>
    
    After this, you just need to copy the "benchmarks" directory from your old
    package directory to the new one.

Michael Matthews

unread,
Aug 4, 2010, 10:30:20 PM8/4/10
to vscse-many-core...@googlegroups.com
The error message says it can't fine libcuda, so a quick fix would be to find that library, and either add it to the LD_LIBRARY_PATH environment variable (`export LD_LIBRARY_PATH=/path/to/library`, or hack the make file and an a -L argument.  It's possible that the CUDAHOME variable help with this, but the general way to include a library path is like that.  You can also add the path to the /etc/ld.so.conf, or as an included file in there, and conf `ldconfig` to have it permanently included in all library search paths.

...also, it looks like "-L/usr/local/cuda/lib64" is already included in that nvcc line, so symlinking to libcuda in that directory is another option: `ln -s /usr/local/cuda/lib64 /path/to/libcuda.so`.  You might have to create that directory first.  That's sort of a hacky way.

Incidentally, I just checked, and I have libcuda.so in /usr/lib/.  I'm not sure when I installed the CUDA SDK, but that's where I have a version on my Lucid installation.

Hope that helps.

John Stratton

unread,
Aug 4, 2010, 10:36:02 PM8/4/10
to vscse-many-core...@googlegroups.com
Either check that your default environment variables have the path to libcuda in your CUDA install directory, or add a -L to that directory in common/platforms/cuda.mk in the same line that includes -lcuda. 

--John
================
John Stratton
217-621-9501
507 W Green St Apt 10
Champaign, IL 61820

Junjie Wu

unread,
Aug 4, 2010, 11:30:28 PM8/4/10
to VSCSE Many-core Processors 2010
Thank you for all your replies. I removed every -lcuda in every
makefile (common/mk/cuda.mk and common/platform/cuda.mk) and the
problem solved.

Btw, there's no libcuda.so at all under my cuda installation path. I
have is libcudart.so instead. I checked the official makefile in cuda
SDK and it never specifies both lcuda and lcudart. There's an if-else
statements picks exactly one of them and that's why I don't have
problem with intro-to-cuda course.

- Junjie

On Aug 4, 10:36 pm, John Stratton <john.a.strat...@gmail.com> wrote:
> Either check that your default environment variables have the path to
> libcuda in your CUDA install directory, or add a -L to that directory in
> common/platforms/cuda.mk in the same line that includes -lcuda.
>
> --John
> ================
> John Stratton
> 217-621-9501
> 507 W Green St Apt 10
> Champaign, IL 61820
>

Keith Callenberg

unread,
Aug 6, 2010, 11:56:57 AM8/6/10
to VSCSE Many-core Processors 2010
Hi Junjie,

I am running Ubuntu 10.04 64-bit and have had some problems compiling
the SDK examples. There are still some things I haven't tried yet, but
did you need to do anything different other than installing GCC 4.3?

I have followed some of the tips in this thread but still no luck:
http://forums.nvidia.com/index.php?showtopic=167422

Keith

Michael Matthews

unread,
Aug 6, 2010, 12:09:03 PM8/6/10
to vscse-many-core...@googlegroups.com
Keith,

What specific problem are you having?  I seem to recall that installing the SDK involved changing up some environment variables and such which might not have been well-documented.

~Michael Matthews

Junjie Wu

unread,
Aug 6, 2010, 2:39:09 PM8/6/10
to VSCSE Many-core Processors 2010
Hi Keith,

I followed the official getting started guide on cuda download page. A
common thought: Did you set the environmental variables as told after
intalling the cuda toolkit? You should have
1) /usr/local/cuda/bin included in $PATH
2) /usr/local/cuda/lib64 included in $LD_LIBRARY_PATH
(adapt the path if you installed the cuda toolkit elsewhere)

Since you've done with switching to gcc 4.3, you shouldn't get any
errors from gcc. Once you have these variables set, the ld should be
able to find the libraries.

These are the thing all I went through. Hope it helps. If you post
your error messages here, others and I may further help. :)

- Junjie
Reply all
Reply to author
Forward
0 new messages