Runtime 32/64 conflict on fresh Cuda 2.3 install on Ubuntu 9.04

I have just downloaded and installed the latest driver, toolkit, and sdk:

and after installing the libraries, setting path, etc., I can build the sdk.

However running applications in the sdk produces the error:

particles: error while loading shared libraries: wrong ELF class: ELFCLASS32

so it looks like I am cross compiling. I do not want to compile for 32 bits, but for the native 64 bit machine.

I looked in the Release Notes, but didn’t see any way to force the 64 bits.

I did not have this problem on the machine I built a week ago using Cuda 2.2 and retrograde compiler, etc.

Is /usr/local/cuda/lib64 in /etc/ ?

No, and it isn’t in /etc/* either.

Also: no appearances of cuda in /etc/ or /etc/* on the machine that does not have the problem.

EDIT: adding a file /etc/ containing /usr/local/cuda/lib64 appears to make no difference.

/usr/local/cuda/lib64 is there, and appears to have sensible shared objects in it.

EDIT2: I just forced the issue by setting LD_LIBRARY_PATH to /usr/local/cuda/lib64. Unless someone explains what’s wrong with that, I’ll just use that.

Did you run ldconfig after adding the /etc/ file, otherwise the library path is not up to date.


Good catch - I left that out. I took the forced LD_LIBRARY_PATH out of the .profile and went back to the cuda2.3.conf file, and, having run ldconfig, it works.


I did everything you said and I could not run the SDK examples.

If I set LD_LIBRARY_PATH as /usr/local/cuda/lib, I get:

error while loading shared libraries: wrong ELF class: ELFCLASS32

and if I set LD_LIBRARY_PATH as /usr/local/cuda/lib64, I get:

Segmentation fault

I have configured /etc/ld.conf.d/cuda-2.3.conf and ran ldconfig, but it still not working.

im getting this error:

“error while loading shared libraries: wrong ELF class: ELFCLASS32”

my paths are in .profile

~/.profile: executed by the command interpreter for login shells.

This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login


see /usr/share/doc/bash/examples/startup-files for examples.

the files are located in the bash-doc package.

the default umask is set in /etc/profile; for setting the umask

for ssh logins, install and configure the libpam-umask package.

#umask 022

if running bash

if [ -n “$BASH_VERSION” ]; then
# include .bashrc if it exists
if [ -f “$HOME/.bashrc” ]; then
. “$HOME/.bashrc”

set PATH so it includes user’s private bin if it exists

if [ -d “$HOME/bin” ] ; then




export PATH

i dont know if that is ok. i assume its not because im getting an error xD.
i didnt quite understand what you all wrote up there.