cbuchner1 / CudaMiner

a CUDA accelerated litecoin mining application based on pooler's CPU miner
Other
692 stars 304 forks source link

/usr/bin/ld: cannot find -lcudart #23

Closed rapsli closed 10 years ago

rapsli commented 10 years ago

I have been digging for hours, but could not find anything. I have followed these instructions https://forum.litecoin.net/index.php?topic=3231.0

after the make command that's what I get:

nvcc -g -O2 -arch=compute_35 --maxrregcount=64 --ptxas-options=-v -I./compat/jansson -o titan_kernel.o -c titan_kernel.cu
g++  -g -O2 -pthread -L/usr/local/cuda/lib64  -o cudaminer cudaminer-cpu-miner.o cudaminer-util.o cudaminer-sha2.o cudaminer-scrypt.o salsa_kernel.o spinlock_kernel.o legacy_kernel.o fermi_kernel.o test_kernel.o titan_kernel.o -L/usr/lib/x86_64-linux-gnu -lcurl compat/jansson/libjansson.a -lpthread  -lcudart -fopenmp  
/usr/bin/ld: cannot find -lcudart
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [cudaminer] Fehler 1
make[2]: Verlasse Verzeichnis '/home/rapsli/CudaMiner'
make[1]: *** [all-recursive] Fehler 1
make[1]: Verlasse Verzeichnis '/home/rapsli/CudaMiner'
make: *** [all] Fehler 2

From what I have read it doesn't find the lcudart lib? Any hints?

I'm running Ubuntu 13.04, 64 Bit

cbuchner1 commented 10 years ago

generally found in /usr/local/cuda/lib64 or /usr/local/cuda/lib, which should either be in the LD_LIBRARY_PATH or stated in a config file in /etc/ld.so.conf.d (then run ldconfig with root permissions)

2013/11/28 Raphael notifications@github.com

I have been digging for hours, but could not find anything. I have followed these instructions https://forum.litecoin.net/index.php?topic=3231.0

after the make command that's what I get:

nvcc -g -O2 -arch=compute_35 --maxrregcount=64 --ptxas-options=-v -I./compat/jansson -o titan_kernel.o -c titan_kernel.cu g++ -g -O2 -pthread -L/usr/local/cuda/lib64 -o cudaminer cudaminer-cpu-miner.o cudaminer-util.o cudaminer-sha2.o cudaminer-scrypt.o salsa_kernel.o spinlock_kernel.o legacy_kernel.o fermi_kernel.o test_kernel.o titan_kernel.o -L/usr/lib/x86_64-linux-gnu -lcurl compat/jansson/libjansson.a -lpthread -lcudart -fopenmp /usr/bin/ld: cannot find -lcudart collect2: Fehler: ld gab 1 als Ende-Status zurück make[2]: * [cudaminer] Fehler 1 make[2]: Verlasse Verzeichnis '/home/rapsli/CudaMiner' make[1]: * [all-recursive] Fehler 1 make[1]: Verlasse Verzeichnis '/home/rapsli/CudaMiner' make: *\ [all] Fehler 2

From what I have read it doesn't find the lcudart lib? Any hints?

I'm running Ubuntu 13.04, 64 Bit

— Reply to this email directly or view it on GitHubhttps://github.com/cbuchner1/CudaMiner/issues/23 .

rapsli commented 10 years ago

Hi

Well my cuda ist in /usr/local/cuda-5.5/lib64 I have set the LD_LIBRARY_PATH And I have even made a symlink from /usr/local/cuda-5.5/lib64 to /usr/local/cuda/lib64 but without success. Any way to trace the error better?

rapsli commented 10 years ago

I could fix this, by copying /usr/local/cuda-5.5/lib64 to /usr/local/cuda/lib64, but never the less, now I can compile it, but when starting cudaminer I get the following error:

Unable to query CUDA driver version! Is an nVidia driver installed?

~/CudaMiner$ nvidia-smi -a

will output:

Timestamp                       : Thu Nov 28 21:05:47 2013
Driver Version                  : 313.30

Attached GPUs                   : 1
GPU 0000:01:00.0
    Product Name                : GeForce 8600 GTS
    Display Mode                : N/A
    Persistence Mode            : Disabled
    Driver Model
        Current                 : N/A
        Pending                 : N/A
    Serial Number               : N/A
    GPU UUID                    : GPU-ab6dd804-e121-4dbc-1ee8-4768c76e8d4d
    VBIOS Version               : 60.84.5E.00.00
...

So, yes it seems to be installed properly. Any ideas?

cbuchner1 commented 10 years ago

does the laptop use Optimus technology, maybe? On Linux I then require to start programs needing the discrete nVidia GPU using optirun. Not sure about your system.

2013/11/28 Raphael notifications@github.com

I could fix this, by copying /usr/local/cuda-5.5/lib64 to /usr/local/cuda/lib64, but never the less, now I can compile it, but when starting cudaminer I get the following error:

Unable to query CUDA driver version! Is an nVidia driver installed?

~/CudaMiner$ nvidia-smi -a

will output:

Timestamp : Thu Nov 28 21:05:47 2013 Driver Version : 313.30

Attached GPUs : 1 GPU 0000:01:00.0 Product Name : GeForce 8600 GTS Display Mode : N/A Persistence Mode : Disabled Driver Model Current : N/A Pending : N/A Serial Number : N/A GPU UUID : GPU-ab6dd804-e121-4dbc-1ee8-4768c76e8d4d VBIOS Version : 60.84.5E.00.00 ...

So, yes it seems to be installed properly. Any ideas?

— Reply to this email directly or view it on GitHubhttps://github.com/cbuchner1/CudaMiner/issues/23#issuecomment-29483226 .

rapsli commented 10 years ago

This is not a laptop, not sure if it uses Optimus technology. It has an intel Core2duo 3.00 Ghz chip. How could I test this out?

cbuchner1 commented 10 years ago

Another idea: maybe the installed nVidia driver module does not meet the minimum requirements for CUDA 5.5

I have developed with CUDA 5.0, and there the minimum requirement was in the range of a 305 driver version.

2013/11/29 Raphael notifications@github.com

This is not a laptop, not sure if it uses Optimus technology. It has an intel Core2duo 3.00 Ghz chip. How could I test this out?

— Reply to this email directly or view it on GitHubhttps://github.com/cbuchner1/CudaMiner/issues/23#issuecomment-29509230 .

kieths commented 10 years ago

That explains what has prevented me from using cudaminer these several months. My 8300 gts cannot run with a driver version greater than 270 (which is being correctly recognized as having cuda/opencl by the gpu-z utility). 

I have tried several work arounds I,  but any driver after 270 refuses to enable opencl/cuda.  Looks like I'm stuck running without cudaminer for now.

-------- Original message -------- From: Christian Buchner notifications@github.com Date: 11/29/2013 9:09 AM (GMT-08:00) To: cbuchner1/CudaMiner CudaMiner@noreply.github.com Subject: Re: [CudaMiner] /usr/bin/ld: cannot find -lcudart (#23)

Another idea: maybe the installed nVidia driver module does not meet the minimum requirements for CUDA 5.5

I have developed with CUDA 5.0, and there the minimum requirement was in the range of a 305 driver version.

2013/11/29 Raphael notifications@github.com

This is not a laptop, not sure if it uses Optimus technology. It has an intel Core2duo 3.00 Ghz chip. How could I test this out?

— Reply to this email directly or view it on GitHubhttps://github.com/cbuchner1/CudaMiner/issues/23#issuecomment-29509230 .

— Reply to this email directly or view it on GitHub.

cbuchner1 commented 10 years ago

Build with an older Cuda version and remove the Titan kernel...

----- Ursprüngliche Nachricht ----- Von: "kieths" notifications@github.com Gesendet: ‎30.‎11.‎2013 07:27 An: "cbuchner1/CudaMiner" CudaMiner@noreply.github.com Cc: "Christian Buchner" Christian.Buchner@gmail.com Betreff: Re: [CudaMiner] /usr/bin/ld: cannot find -lcudart (#23)

That explains what has prevented me from using cudaminer these several months. My 8300 gts cannot run with a driver version greater than 270 (which is being correctly recognized as having cuda/opencl by the gpu-z utility).

I have tried several work arounds I, but any driver after 270 refuses to enable opencl/cuda. Looks like I'm stuck running without cudaminer for now.

-------- Original message -------- From: Christian Buchner notifications@github.com Date: 11/29/2013 9:09 AM (GMT-08:00) To: cbuchner1/CudaMiner CudaMiner@noreply.github.com Subject: Re: [CudaMiner] /usr/bin/ld: cannot find -lcudart (#23)

Another idea: maybe the installed nVidia driver module does not meet the minimum requirements for CUDA 5.5

I have developed with CUDA 5.0, and there the minimum requirement was in the range of a 305 driver version.

2013/11/29 Raphael notifications@github.com

This is not a laptop, not sure if it uses Optimus technology. It has an intel Core2duo 3.00 Ghz chip. How could I test this out?

— Reply to this email directly or view it on GitHubhttps://github.com/cbuchner1/CudaMiner/issues/23#issuecomment-29509230 .

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

kieths commented 10 years ago

Sorry, I'm not fully clear which file is relayed to the Titan kernel... Windows XP (32bit).  It would probably have been easier on Ubuntu Linux, but this is mfg default card for the XP system where it is installed.

-------- Original message -------- From: Christian Buchner notifications@github.com Date: 11/30/2013 1:01 AM (GMT-08:00) To: cbuchner1/CudaMiner CudaMiner@noreply.github.com Cc: kieths kieth@swaneys.com Subject: Re: [CudaMiner] /usr/bin/ld: cannot find -lcudart (#23)

Build with an older Cuda version and remove the Titan kernel...

----- Ursprüngliche Nachricht ----- Von: "kieths" notifications@github.com Gesendet: ‎30.‎11.‎2013 07:27 An: "cbuchner1/CudaMiner" CudaMiner@noreply.github.com Cc: "Christian Buchner" Christian.Buchner@gmail.com Betreff: Re: [CudaMiner] /usr/bin/ld: cannot find -lcudart (#23)

That explains what has prevented me from using cudaminer these several months. My 8300 gts cannot run with a driver version greater than 270 (which is being correctly recognized as having cuda/opencl by the gpu-z utility).

I have tried several work arounds I, but any driver after 270 refuses to enable opencl/cuda. Looks like I'm stuck running without cudaminer for now.

-------- Original message -------- From: Christian Buchner notifications@github.com Date: 11/29/2013 9:09 AM (GMT-08:00) To: cbuchner1/CudaMiner CudaMiner@noreply.github.com Subject: Re: [CudaMiner] /usr/bin/ld: cannot find -lcudart (#23)

Another idea: maybe the installed nVidia driver module does not meet the minimum requirements for CUDA 5.5

I have developed with CUDA 5.0, and there the minimum requirement was in the range of a 305 driver version.

2013/11/29 Raphael notifications@github.com

This is not a laptop, not sure if it uses Optimus technology. It has an
intel Core2duo 3.00 Ghz chip. How could I test this out?

— Reply to this email directly or view it on GitHubhttps://github.com/cbuchner1/CudaMiner/issues/23#issuecomment-29509230 .

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

kalebealvs commented 10 years ago

I was getting the same problem as you . Where is placed you Cuda installation?? Mine is on opt, so i linked to /usr/local and then problem solved.

archenroot commented 10 years ago

Well, I think that it should not be solved by using the link, even it is working and enough:-) CUDA sdk should be in /opt, not in /usr/local in general. So I see 2 ways of solution: 1.) append your location to ld search variable LD_LIBRARY_PATH - not preferred for me but http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/ 2.) change following flags in make file to reflect current setup - this will tell the linker where to search CUDA_CFLAGS = -I/usr/local/cuda/include CUDA_LDFLAGS = -L/usr/local/cuda/lib64

kalebealvs commented 10 years ago

On second step should him change the flags for /opt/cuda if you want to keep cuda sdk only on /opt?

archenroot commented 10 years ago

sorry, cannot try now, due to systemd and udev block conflicts I unmerged temporarily pam module and then lost ssh connection, so don't have now remote access to my workstation with 2x gtx660 :) (idiot, haha) will check over Christmas time. Still as far as I remember when playing around with this over last weekend gentoo location of cuda libraries is as following for cudart: /opt/cuda/lib/libcudart.so /opt/cuda/lib/libcudart.so.5.5 /opt/cuda/lib/libcudart.so.5.5.22 /opt/cuda/lib/libcudart_static.a /opt/cuda/lib64/libcudart.so /opt/cuda/lib64/libcudart.so.5.5 /opt/cuda/lib64/libcudart.so.5.5.22 /opt/cuda/lib64/libcudart_static.a

In the current Gentoo ebuild the startup folder is defined to /opt: "local cudadir=/opt/cuda"

So the answer to your question is yes. Changing to CUDA_LDFLAGS = -L/opt/cuda/lib64 and probably same apply for CUDA_CFLAGS if I am not wrong.

But the most easiest task is probably to change the file configure: ./configure "CFLAGS=-O3" "CXXFLAGS=-O3" --with-cuda=/usr/local/cuda to ./configure "CFLAGS=-O3" "CXXFLAGS=-O3" --with-cuda=/opt/cuda

roinou commented 10 years ago

Stupid thing, but it got me stuck on server installation of Ubuntu. Make sure the current user is part of the "video" group.