PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Can link executable with libcuda.so dyanmic lirbary

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
THX 1138



Joined: 30 Jun 2011
Posts: 102

PostPosted: Mon Jun 18, 2012 11:05 am    Post subject: Can link executable with libcuda.so dyanmic lirbary Reply with quote

I had been using PGroup 32 bit workstation on Ubuntu 11.10 (32 bit versin with no trouble at all).

Then the directive came down to change everything to CentOS from Ubuntu and make it CentOS 6.2 64 bit. I was told that it would be no problem since you can compile and run 32 bit applications on the 64 bit CentOS OS. I am having trouble.

I was able to compile c1.c to c1.exe, but I could not run it. I am now showing the computer output and my steps.

drwxr-xr-x. 3 root root 4096 Jun 18 09:58 .
dr-xr-xr-x. 114 root root 69632 Jun 16 03:49 ..
lrwxrwxrwx. 1 root root 17 Jun 18 09:57 libcuda.so -> libcuda.so.295.59
lrwxrwxrwx. 1 root root 17 Jun 18 09:57 libcuda.so.1 -> libcuda.so.295.59
-rwxrwxrwx. 1 root root 8613044 Jun 7 00:50 libcuda.so.295.59
-rwxr-xr-x. 1 root root 652 Jun 7 01:25 libGL.la
lrwxrwxrwx. 1 root root 15 Jun 18 09:57 libGL.so -> libGL.so.295.59
lrwxrwxrwx. 1 root root 15 Jun 18 09:57 libGL.so.1 -> libGL.so.295.59
-rwxr-xr-x. 1 root root 1055440 Jun 16 10:16 libGL.so.295.59
lrwxrwxrwx. 1 root root 20 Jun 18 09:57 libnvcuvid.so -> libnvcuvid.so.295.59
lrwxrwxrwx. 1 root root 20 Jun 18 09:57 libnvcuvid.so.1 -> libnvcuvid.so.295.59
-rwxr-xr-x. 1 root root 2215712 Jun 16 10:16 libnvcuvid.so.295.59
lrwxrwxrwx. 1 root root 23 Jun 18 09:57 libnvidia-cfg.so -> libnvidia-cfg.so.295.59
lrwxrwxrwx. 1 root root 23 Jun 18 09:57 libnvidia-cfg.so.1 -> libnvidia-cfg.so.295.59
-rwxr-xr-x. 1 root root 136616 Jun 16 10:16 libnvidia-cfg.so.295.59
-rwxr-xr-x. 1 root root 27713008 Jun 16 10:16 libnvidia-compiler.so.295.59
-rwxr-xr-x. 1 root root 34731984 Jun 16 10:16 libnvidia-glcore.so.295.59
lrwxrwxrwx. 1 root root 22 Jun 18 09:57 libnvidia-ml.so -> libnvidia-ml.so.295.59
lrwxrwxrwx. 1 root root 22 Jun 18 09:57 libnvidia-ml.so.1 -> libnvidia-ml.so.295.59
-rwxr-xr-x. 1 root root 252200 Jun 16 10:16 libnvidia-ml.so.295.59
lrwxrwxrwx. 1 root root 18 Jun 18 09:57 libOpenCL.so -> libOpenCL.so.1.0.0
lrwxrwxrwx. 1 root root 18 Jun 18 09:57 libOpenCL.so.1 -> libOpenCL.so.1.0.0
lrwxrwxrwx. 1 root root 18 Jun 18 09:57 libOpenCL.so.1.0 -> libOpenCL.so.1.0.0
-rwxr-xr-x. 1 root root 21296 Jun 16 10:16 libOpenCL.so.1.0.0
-rw-r--r--. 1 root root 222674 Jun 16 10:16 libXvMCNVIDIA.a
lrwxrwxrwx. 1 root root 23 Jun 18 09:57 libXvMCNVIDIA_dynamic.so -> libXvMCNVIDIA.so.295.59
lrwxrwxrwx. 1 root root 23 Jun 18 09:57 libXvMCNVIDIA_dynamic.so.1 -> libXvMCNVIDIA.so.295.59
-rwxr-xr-x. 1 root root 158968 Jun 16 10:16 libXvMCNVIDIA.so.295.59
drwxr-xr-x. 2 root root 4096 Jun 18 09:58 tls
[james@james nvidia]$ file libcuda.so
libcuda.so: symbolic link to `libcuda.so.295.59'
[james@james nvidia]$ file libcuda.so.295.59
libcuda.so.295.59: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
[james@james nvidia]$ cd ..
[james@james lib64]$ pwd
/usr/lib64
[james@james lib64]$ cd ..
[james@james usr]$ cd /opt/pgi/
[james@james pgi]$ ls
flexlm.log INSTALL.txt license.bak license.dat license.info linux86 linux86-64 SUBSCRIPTION_SERVICE tmp_license_Linux_00146c707452_11dec2012
[james@james pgi]$ cd linux86
[james@james linux86]$ ls
12.5 2012
[james@james linux86]$ cd 12.5
[james@james 12.5]$ ls
bin etc include index.htm liblf LICENSE_JRE_6U21.txt LICENSE_OPENACC_BETA.txt LICENSE.txt mpi mpi.sh pgi.sh REDIST src
doc EXAMPLES include_acc lib LICENSE_ACML.txt LICENSE_NVIDIA_CUDA.txt LICENSE_STLport.txt man mpi.csh pgi.csh PORTABLE REDIST-RLR
[james@james 12.5]$ cd etc
[james@james etc]$ ls
modulefiles pgi_license_tool pgprof samples src
[james@james etc]$ cd samples
[james@james samples]$ ls
accel cudafor openacc
[james@james samples]$ cd accel
[james@james accel]$ ls
a.out c1.c c1.exe c2.c c3.c f1.f90 f2.f90 f3.f90 makefile
[james@james accel]$ ./c1.exe
bash: ./c1.exe: Permission denied
[james@james accel]$ sudo ./c1.exe
libcuda.so not found, exiting
Please check that the CUDA driver is installed and the shared object is in the install directory or on your LD_LIBRARY_PATH.
[james@james accel]$
[james@james accel]$
[james@james accel]$
[james@james accel]$ sudo find / -iname libcuda.so
/usr/lib64/nvidia/libcuda.so
[james@james accel]$ cd /tmp/pgi
[james@james pgi]$ ls
common install_acml install_env install_mpich jlog.txt linux86-64 linux86-64.mpich.tar.gz linux86-64.pgicuda.tar.gz linux86.mpich.tar.gz linux86.pgicuda.tar.gz postinstall
install install_cuda install_java INSTALL.txt linux86 linux86-64.eclipse.tar.gz linux86-64.pgiacml.tar.gz linux86.eclipse.tar.gz linux86.pgiacml.tar.gz pgilinux-2012-125.tar.gz
[james@james pgi]$ ./install_cuda
Usage: install_cuda [install dir]
Defaulting to
Do you want to continue? (y/n) y
script ./install_cuda
Installing PGI CUDA components into
This might take awhile ...
[james@james pgi]$


It said it could not find libcuda.so so I performed a find and it found it at

/usr/lib64/nvidia/libcuda.so

That of course means it is a 64 library since it is in the lib64 directory.

I made libcuda.so and libcuda.so.295.59 readable to all via the chmod 777 command.

The libcuda.so is symbolically linked to libcuda.so.295.59 so I had to make that file readable to all - again using chmod 777 libcuda.so.295.59. The chmod command worked. The compile command worked. The running of the compiled file did not work.

It as I have shown could not find the libcuda.so file. I nmade sure that LD_LIBRARY_PATH pointed to /usr/lib64/bin.

I am confused as to why it does not run. The c1.c program does compile and all files taht must be dynamically linked are able to be read, but they are 64 bit.

Yet is still says it cannot find libcuda.so and libcuda.so is in /usr/lib64/nvidia.

I am trying to compile and run 32 bit in 64 bit CentOS linux os.

Must I find a libcuda.so for 32 bit and place it in the /usr/lib/nvidia directory?

I was told to use the 64 bit directories even though I am comining in 32 bit. Someone over at NVIDA said that is wrong, thta I should use 32 bit. I do not know what to think now.

I did try the ./install_cuda command in /tmp/pgi/ since I was told by PGI tech support it must be a CUDA not a PGI probelem. It installed with no problem, but I do not think it is enough to run cuda based pgi programs. Do I need to install Cuda Toolkit 4.0 for 64 bit centOS? Also, what was installed in the ./install_cuda command andwhas is 32 or 64 bit?

Any help appreciated.Thanks in advance.

THX 1138
Back to top
View user's profile
toepfer



Joined: 04 Dec 2007
Posts: 48

PostPosted: Mon Jun 25, 2012 1:15 pm    Post subject: Reply with quote

After upgrading to CentOS 6.2 64-bit, did you re-install the compilers and tools?
Did you rebuild the c1.exe with the compilers after you installed them? Have you tried
building with the 64-bit compilers to see if that will work?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group