Error loading cudart libraries 32-bit app on 64-bit


I am trying to run a 32-bit CUDA Linux application (compiled with CUDA 2.3) on a 64-bit Linux system running CUDA 3.0(Ubuntu 9.10).
I packaged the application this way:

  1. I ran “ldd” on the binary and then noted down all the dependent 32-bit libraries.
  2. I bundled the app with all of its dependent libraries into an archive.

I unzipped the archive inside my home directory and ran the application from the command prompt after setting the “LD_LIBRARY_PATH” to “.” (Current directory)
I get “Segmentation fault”.
If I “sudo” the application, the error changes to “Error loading libcudart…”

  1. I don’t understand why I have to “sudo” to run this application. It runs fine without a “sudo” in the original 32-bit system.

  2. I don’t understand why the 32-bit cudart is not being able to be loaded.

  3. SeLinux is disabled

  4. I also added the unzipped package path to “/etc/” and ran “ldconfig”

Any help?
Best Regards,

I don’t think that can work. The size of device pointers is different on 32 and 64 bit platforms and even though you might have the 32 bit runtime support included with the app, the driver libraries are expecting the the supplied device pointers in the executable are the same size as host pointers. That isn’t the case here.

Thanks for replying back so sooon!! It was great!

I fear that is not the case. 32-bit apps should run good on 64-bit OSes.
At least on windows, I can run 32-bit CUDA Apps with 32-bit runtime talking to a 64-bit driver.

The “size of pointer” and other such issues must be handled by the driver. The driver should know that it is talking to a 32-bit app (or) Atleast, I expect the driver to know as was the case for windows.

ANyway, Thanks for a quick reply. Feels soooo Gooood.

Run ldd on the 64 bit machine with the environment set as you think is should be (I would never make the ldconfig changes you did) and post the output, then run the app in gdb and get a trace (bt is the command) and post that as well.

okay, will do it. Thanks for the inputs!

Okay, Strace helped. FOr some reason, the dynamic linker was not searching the LD_LIBRARY_PATH for 32-bit libs.
I just copied the cuda libraries to /usr/lib32 and it all worked fine!
The permission problem seems to be related to “ulimit”. The last system call when the app seg-faulted was related to ulimits.
But I could not solve the problem. FOr the momment, I am happy with Sudo. I will dig more later,

Thank you Avidday,

Best regards,