Error compiling SDK 3.1 code samples Error Compiling SDK Examples: calling a host function from devi

Hi there,

I am new to CUDA and am attempting to get the 3.1 SDK code samples to compile fully. After creating some missing sym links for libglut and libGLU, I have successfully compiled the “common” tools and deviceQuery and that works fine, but when I try to compile the whole batch of sample code I get:

This does not seem to be related to my environment, yet I can’t believe there is actually a illegal call to a host function from a device function in the actual sample code? What the heck? (Getting these code samples to compile is proving more challenging than I expected.)

Can someone please point me in the right direction so I can get the rest of the code sample to compile?

Toolkit: 3.1

SDK: 3.1

OpenSuse 11.3

gcc: 4.5.0

ldd (GNU libc) 2.11.2

Thank you,

Pete

After further research I see I was encountering a similar issue to that which Fedora 13 / Ubuntu 10.04 and earlier users have experienced. When distros upgrade their GCC, glibc, etc. it can easily conflict with the CUDA Toolkit and SDK, which expect specific versions of such for the build environment to work correctly.

In my case (on OpenSUSE 11.3, CUDA Toolkit 3.1, Nvidia driver 256.35, gcc 4.5) it was pretty easy to resolve simply be installing gcc43, gcc43-c++, etc. and then setting up update-alternatives to easily switch versions. I accomplished this using the following package versions and set up update-alternatives as:

I found the following two posts helpful in determining and resolving my issue:

http://lukas.ahrenberg.se/archives/154

http://forums.nvidia.com/index.php?showtopic=157513

Furthermore, if using Suse, ensure you set up the necessary symlinks for libglut and libGLU as stated in the release notes, else you will get /usr/bin/ld: cannot find -lglut when you compile.

Also, at first I was getting the devices are busy or unavailable error - but after suspending / resuming compositing and restarting plasma-desktop (KDE) the demos then ran fine.

Now that I have the SDK Code Samples running I can say - it was worth it, they are pretty cool.

Cheers,

Pete

Thanks, that was immensely helpful in getting CUDA 3.2 SDK examples to compile on Ubuntu 11.04.