0

I am installing pycuda2011.2.2 on ubuntu 11.10, but can't complete it. Cuda is 4.0. When I do:

$ make -j 4 

I get this error:

/usr/bin/ld: cannot find -lcuda 
/usr/bin/ld: skipping incompatible /usr/local/cuda/lib/libcurand.so when searching for -lcurand

Why this error? I think that cuda is 32 bit on 64 bit machine. But I can't see whether it's 32 bit or 64 bit.

Also, can anyone share code to make "gcc 4.4" as priority, just for my account and not all account?

jokerdino
  • 41,320
user55717
  • 11
  • 1
  • 4

2 Answers2

1

I don't understand why you would want to run make at all when building pycuda - it does not even have a Makefile (apart from the documentation).

You install pycuda by running ./configure.py with the appropriate options followed by LDFLAGS=-L/usr/lib/nvidia-current python setup.py install.

You need to set the LDFLAGS environment variable so that the pycuda setup can find libcuda.so, which on ubuntu systems is in a non-standard location (/usr/lib/nvidia-current).

If you're really asking about compiling the CUDA SDK (in which case you should definitely edit your question!), see my response on the NVIDIA forums.

kynan
  • 2,207
0

What about removing -lcuda from the Makefile? Last time I checked the toolkit and sdk, I could not find a libcuda.so file.

There have also been changes in the strictness of the compiler, so -lcuda must come after object files and other libraries which depend on it. You likely have to move -lcuda to the end of the $(CC) line (or whatever compiler command is used).

Lekensteyn
  • 174,277
  • I don't see -lcuda in Makefile.TRy this to find your libcuda.so: – user55717 May 11 '12 at 18:57
  • Have you looked at http://askubuntu.com/q/131506/6969 for installing CUDA? A default installation does not work properly (at least, not for me on 12.04) – Lekensteyn May 11 '12 at 20:01
  • sorry, I left comment open and it got published.Try this to find your libcuda.so: ......@ubuntu:/usr$ locate libcuda.so => /usr/lib/nvidia-current/libcuda.so . Also, Can you please elaborate what you said before ? CUDA is already installed on machine which i got, so i don't know if its just default or not. – user55717 May 11 '12 at 20:17
  • i haven't checked that thread as CUDA is already installed. – user55717 May 11 '12 at 20:35
  • @user55717 Check the SDK installation part on http://askubuntu.com/a/133869/6969, it mentions some changes that you need to perform to get the CUDA toolkit and compiler working in 12.04. – Lekensteyn May 11 '12 at 20:56
  • I opened common.mk but it won't let me modify even if I have sudo access.Every time it opens new common.mk (common.mk(1), common.mk(2)...). I do see -lcuda there, which if removed, may relieve me of error. That file is in someone else's account. Is this why I can't modify ? – user55717 May 16 '12 at 08:29
  • See http://askubuntu.com/a/121790/6969 for how to edit system files. Please upvote that answer if it helped you – Lekensteyn May 16 '12 at 13:08
  • Sorry, can't vote bcoz my reputation is less than 15. Once i get to 15 i will upvote it, if that helps. I couldn't modify bcoz of permission issue. Now i got write permission from user and modified file. Thanks for the link which has 'SDK installation part'. Turned out the user didn't did those modification. Now I did those modifications in 'common.mk', but still same error '-lcuda not found'. I will post a summary of my A-Z installation steps today. Really need to solve this issue. I appreciate your assiatance. – user55717 May 22 '12 at 15:16
  • Use grep to find out what adds -lcuda and remove it. – Lekensteyn May 22 '12 at 15:28
  • I followed your article and removed -lcuda from "home/mmm/NVIDIA_GPU_Computing_SDK/C/common/common.mk". I found lcuda at many places. One of them: ..../common/SAVE2012.05.25_common.mk: LIB += -lcuda ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB}. Shall i modify this and others like you mentioned in SDK article ? In result of grep I saw this : /home/mmm/NVIDIA_GPU_Computing_SDK/NVDIA_SDK.script:/usr/bin/ld: cannot find -lcuda . It explicitly mentioned that it can't find -lcuda. But I don't know how to interpret it. – user55717 May 22 '12 at 17:23
  • -lcuda means that the linker should link the binary to the cuda library (libcuda.so). I'd say, remove it. – Lekensteyn May 22 '12 at 17:51
  • -lcuda is in couple of files of directory C. It may be in other directories. Shall I remove -lcuda in all, and swap ${OPENGLLIB} and (RENDERCHECKGLLIB) in those files too ? like you mentioned in SDK portion of article. – user55717 May 24 '12 at 17:26
  • I'd say, try it. – Lekensteyn May 25 '12 at 09:11
  • 1
    I got a therad that address same problem:<a href="http:// http://forums.nvidia.com/index.php?showtopic=224718&st=0#entry1413660"target=_blank>here.Finally pycuda installed. I was about to try your suggestion, but that thread was a bullseye, so i didn't tried that.Lekensteyn, thanks a lot for continuous support. – user55717 May 25 '12 at 19:31
  • unfortunately, i never found that thread till now. – user55717 May 25 '12 at 19:38
  • @user55717 Hmm, last time I could not find that file, but now it's suddenly in my /usr/lib/nvidia-current folder. Glad that you've solved it. – Lekensteyn May 25 '12 at 20:25
  • i am glad too. Just tried to run pycuda example and it gave error. so i am trying to resolve it. Can that problem be discussed on ubuntu forum ? – user55717 May 25 '12 at 21:18