djm34 / ccminer-msvc2015

ccminer updated to the latest version of visual studio (2015)
GNU General Public License v3.0
33 stars 25 forks source link

Compiling or execution issue on Ubuntu 16.04 #14

Closed Sviluppo718 closed 7 years ago

Sviluppo718 commented 7 years ago

Hi,

The compiling (using autogen.sh, configure -- and, when the error discussed next occurred, build.sh also) seems to have bullt this fork of ccminer but I keep getting the error: " ./ccminer: error while loading shared libraries: libcudart.so.8.0: cannot open shared object file: No such file or directory "

I think the problem may have something to do with Nvidia in the past week or two updated the Ubuntu drivers, I've currently got 384.59 and it hasn't let me re-install CUDA 8 since then (Currenly nvcc-version outputs "Cuda compilation tools, release 7.5, V7.5.17").

Based on the INSTALL file I've also:

used sudo to manually create the file /etc/profile.d/cuda.sh and it now has only the line " 'export PATH=$PATH:/usr/local/cuda/bin' in it, and

(Probably most directly touching on an eventual solution) used sudo to create the file /etc/ld.so.conf.d/cuda.conf (it didn't exist before but there was a cuda-8-0.conf there from when CUDA 8 was installed before the nvidia driver update). The only line in the new cuda.conf file is "/usr/local/cuda/lib64"

Any ideas how to get this miner to function in this instance? (I've tried the CPU miner but I find the temperature gets above 80C too easily even when I used the max-temp control/flag and I'd like to give the GPU miner a whirl and see if I don't have any eminent meltdown problems using that with this computer ^_^).

djm34 commented 7 years ago

it seems you haven't set the LD_LIBRARY_PATH (however it shouldn't matter while compiling, since it uses only nvcc), but you can set it manually. personnally I don't use /etc/profile.d/cuda.sh, I just add manually the PATH and LD_LIBRARY_PATH in my .bashrc file. Also, you shouldn't have to reinstall cuda when you change the drivers (recently, I had to reinstal my drivers, this was done without touching at cuda. If this driver cause too much problem, may-be you should uninstall and reinstal an older one.

Sviluppo718 commented 7 years ago

I may be close to resolving this (but using "export LD_LIBRARY_PATH=usr/local/cuda/lib64:$LD_LIBRARY_PATH" immediately before recompiling and also before running still resulted in the same error when I tried to run the miner).

Also, this page http://wiredrevolution.com/system-administration/how-to-correctly-use-ld_library_path seemed to advise against permanently hard-wiring some libraries (as in .bashrc) . My impression is that LD_LIBRARY_PATH is limited in scope or duration (but I'm no expert, just trying to learn some more while getting this working). I didn't find a command to output what is currently stored in the associated registers but perhaps I didn't search long enough.

This page may hold part of the answer https://cgcvtutorials.wordpress.com/2016/10/14/error-while-loading-shared-libraries-libcudart-so-8-0-cannot-open-shared-object-file-no-such-file-or-directory I tried two of the three things here with no discernible improvement as a result.

*** But perhaps the "shared libraries" in the error is because I have the file libcudart.so.8.0 in both: /usr/local/cuda-8.0/lib64 and in /usr/local/cuda/lib64

Perhaps it's trying to pull the library in from two separate directories and the system doesn't know which one to use, then conflicts and refuses to run. It may be necessary for me to edit the makefile in some parts(?)


When the update to the drivers occurred (I did a sudo apt-get update and then upgrade and had hell to pay that night afterward) I couldn't get into the gui after the login screen, it would simply go blank and return to the login infinitely. (I already had experience with the "service lightdm start" and command-line only ctrl-alt-f2 stuff.)

Something that I read somewhere asserted that I should purge cuda and virtually everything Nvidia and then reinstall. That's what I did and my CUDA is probably jumbled up a bit unfortunately.

I'm not going to have access to my computer for three days (will be out of town and can't take it with) so I'll have to stew or mull over this in the meantime, but thanks for the help and any further suggestions.

Sviluppo718 commented 7 years ago

I've got the miner working/mining now. The nvidia-cuda-toolkit that's downloadable from the repositories using APT (instead of directly from Nvidia's site) is 7.5 only -- at some point I downloaded that. After purging all CUDA, I reinstalled 8.0; thinking there might be some sort of conflict.

I also ensured that the PATH variable includes /usr/local/cuda-8.0/bin and that the LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64 (and did sudo ldconfig). After setting those environment variables I cloned the miner into a directory using git, then ran: autogen.sh, configure.sh, and make and things are good now.