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?
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: