Tensorflow can't find libcuda.so (CUDA 7.5)
I've installed CUDA 7.5 toolkit, and Tensorflow inside anaconda env. The CUDA driver is also installed. The folder containing the so
libraries is in LD_LIBRARY_PATH
. When I import tensorflow I get the following error:
Couldn't open CUDA library libcuda.so. LD_LIBRARY_PATH:
/usr/local/cuda-7.5/lib64
In this folder, there exist a file named libcudart.so
(which is actually a symbolic link to libcudart.so.7.5
). So (just as a guess) I created a symbolic link to libcudart.so
named libcuda.so
. Now the library is found by Tensorflow, but as soon as I call tensorflow.Session()
I get the following error:
F tensorflow/stream_executor/cuda/cuda_driver.cc:107] Check failed: f
!= nullptr could not find cuInitin libcuda DSO; dlerror:
/usr/local/cuda-7.5/lib64/libcudart.so.7.5: undefined symbol: cuInit
Any ideas?
python cuda tensorflow
|
show 6 more comments
I've installed CUDA 7.5 toolkit, and Tensorflow inside anaconda env. The CUDA driver is also installed. The folder containing the so
libraries is in LD_LIBRARY_PATH
. When I import tensorflow I get the following error:
Couldn't open CUDA library libcuda.so. LD_LIBRARY_PATH:
/usr/local/cuda-7.5/lib64
In this folder, there exist a file named libcudart.so
(which is actually a symbolic link to libcudart.so.7.5
). So (just as a guess) I created a symbolic link to libcudart.so
named libcuda.so
. Now the library is found by Tensorflow, but as soon as I call tensorflow.Session()
I get the following error:
F tensorflow/stream_executor/cuda/cuda_driver.cc:107] Check failed: f
!= nullptr could not find cuInitin libcuda DSO; dlerror:
/usr/local/cuda-7.5/lib64/libcudart.so.7.5: undefined symbol: cuInit
Any ideas?
python cuda tensorflow
libcuda is part of the CUDA driver, not the CUDA toolkit. Have you installed the CUDA driver?
– talonmies
Jul 17 '16 at 13:53
1
libcuda.so
andlibcudart.so
are not the same thing. And whilelibcudart.so
should probably be in/usr/local/cuda-7.5/lib64
on your machine,libcuda.so
should be somewhere else. And the symbolic link fromlibcuda.so
tolibcudart.so
is a completely broken idea. They are different libraries.
– Robert Crovella
Jul 17 '16 at 14:16
1
You should attempt to discover wherelibcuda.so
is on your machine. There are linux utilities which can find files for you, such asfind
. Have you tried any of them?
– Robert Crovella
Jul 17 '16 at 14:18
1
Thelibcuda.so
should be in some location like/usr/lib64
on your machine (it may vary by linux distro). That is the one you want to use and the folder you want to include in yourLD_LIBRARY_PATH
. There is probably alibcuda.so
in/usr/local/cuda-7.5/lib64/stubs
directory on your machine. You don't want to be using that. It exists for a different purpose.
– Robert Crovella
Jul 17 '16 at 14:37
1
@ItamarKatz: Please add a short answer summarising what you did to solve this problem.
– talonmies
Jul 18 '16 at 7:37
|
show 6 more comments
I've installed CUDA 7.5 toolkit, and Tensorflow inside anaconda env. The CUDA driver is also installed. The folder containing the so
libraries is in LD_LIBRARY_PATH
. When I import tensorflow I get the following error:
Couldn't open CUDA library libcuda.so. LD_LIBRARY_PATH:
/usr/local/cuda-7.5/lib64
In this folder, there exist a file named libcudart.so
(which is actually a symbolic link to libcudart.so.7.5
). So (just as a guess) I created a symbolic link to libcudart.so
named libcuda.so
. Now the library is found by Tensorflow, but as soon as I call tensorflow.Session()
I get the following error:
F tensorflow/stream_executor/cuda/cuda_driver.cc:107] Check failed: f
!= nullptr could not find cuInitin libcuda DSO; dlerror:
/usr/local/cuda-7.5/lib64/libcudart.so.7.5: undefined symbol: cuInit
Any ideas?
python cuda tensorflow
I've installed CUDA 7.5 toolkit, and Tensorflow inside anaconda env. The CUDA driver is also installed. The folder containing the so
libraries is in LD_LIBRARY_PATH
. When I import tensorflow I get the following error:
Couldn't open CUDA library libcuda.so. LD_LIBRARY_PATH:
/usr/local/cuda-7.5/lib64
In this folder, there exist a file named libcudart.so
(which is actually a symbolic link to libcudart.so.7.5
). So (just as a guess) I created a symbolic link to libcudart.so
named libcuda.so
. Now the library is found by Tensorflow, but as soon as I call tensorflow.Session()
I get the following error:
F tensorflow/stream_executor/cuda/cuda_driver.cc:107] Check failed: f
!= nullptr could not find cuInitin libcuda DSO; dlerror:
/usr/local/cuda-7.5/lib64/libcudart.so.7.5: undefined symbol: cuInit
Any ideas?
python cuda tensorflow
python cuda tensorflow
edited Jul 18 '16 at 12:25
talonmies
59.6k17129199
59.6k17129199
asked Jul 17 '16 at 13:38
Itamar KatzItamar Katz
7,40433360
7,40433360
libcuda is part of the CUDA driver, not the CUDA toolkit. Have you installed the CUDA driver?
– talonmies
Jul 17 '16 at 13:53
1
libcuda.so
andlibcudart.so
are not the same thing. And whilelibcudart.so
should probably be in/usr/local/cuda-7.5/lib64
on your machine,libcuda.so
should be somewhere else. And the symbolic link fromlibcuda.so
tolibcudart.so
is a completely broken idea. They are different libraries.
– Robert Crovella
Jul 17 '16 at 14:16
1
You should attempt to discover wherelibcuda.so
is on your machine. There are linux utilities which can find files for you, such asfind
. Have you tried any of them?
– Robert Crovella
Jul 17 '16 at 14:18
1
Thelibcuda.so
should be in some location like/usr/lib64
on your machine (it may vary by linux distro). That is the one you want to use and the folder you want to include in yourLD_LIBRARY_PATH
. There is probably alibcuda.so
in/usr/local/cuda-7.5/lib64/stubs
directory on your machine. You don't want to be using that. It exists for a different purpose.
– Robert Crovella
Jul 17 '16 at 14:37
1
@ItamarKatz: Please add a short answer summarising what you did to solve this problem.
– talonmies
Jul 18 '16 at 7:37
|
show 6 more comments
libcuda is part of the CUDA driver, not the CUDA toolkit. Have you installed the CUDA driver?
– talonmies
Jul 17 '16 at 13:53
1
libcuda.so
andlibcudart.so
are not the same thing. And whilelibcudart.so
should probably be in/usr/local/cuda-7.5/lib64
on your machine,libcuda.so
should be somewhere else. And the symbolic link fromlibcuda.so
tolibcudart.so
is a completely broken idea. They are different libraries.
– Robert Crovella
Jul 17 '16 at 14:16
1
You should attempt to discover wherelibcuda.so
is on your machine. There are linux utilities which can find files for you, such asfind
. Have you tried any of them?
– Robert Crovella
Jul 17 '16 at 14:18
1
Thelibcuda.so
should be in some location like/usr/lib64
on your machine (it may vary by linux distro). That is the one you want to use and the folder you want to include in yourLD_LIBRARY_PATH
. There is probably alibcuda.so
in/usr/local/cuda-7.5/lib64/stubs
directory on your machine. You don't want to be using that. It exists for a different purpose.
– Robert Crovella
Jul 17 '16 at 14:37
1
@ItamarKatz: Please add a short answer summarising what you did to solve this problem.
– talonmies
Jul 18 '16 at 7:37
libcuda is part of the CUDA driver, not the CUDA toolkit. Have you installed the CUDA driver?
– talonmies
Jul 17 '16 at 13:53
libcuda is part of the CUDA driver, not the CUDA toolkit. Have you installed the CUDA driver?
– talonmies
Jul 17 '16 at 13:53
1
1
libcuda.so
and libcudart.so
are not the same thing. And while libcudart.so
should probably be in /usr/local/cuda-7.5/lib64
on your machine, libcuda.so
should be somewhere else. And the symbolic link from libcuda.so
to libcudart.so
is a completely broken idea. They are different libraries.– Robert Crovella
Jul 17 '16 at 14:16
libcuda.so
and libcudart.so
are not the same thing. And while libcudart.so
should probably be in /usr/local/cuda-7.5/lib64
on your machine, libcuda.so
should be somewhere else. And the symbolic link from libcuda.so
to libcudart.so
is a completely broken idea. They are different libraries.– Robert Crovella
Jul 17 '16 at 14:16
1
1
You should attempt to discover where
libcuda.so
is on your machine. There are linux utilities which can find files for you, such as find
. Have you tried any of them?– Robert Crovella
Jul 17 '16 at 14:18
You should attempt to discover where
libcuda.so
is on your machine. There are linux utilities which can find files for you, such as find
. Have you tried any of them?– Robert Crovella
Jul 17 '16 at 14:18
1
1
The
libcuda.so
should be in some location like /usr/lib64
on your machine (it may vary by linux distro). That is the one you want to use and the folder you want to include in your LD_LIBRARY_PATH
. There is probably a libcuda.so
in /usr/local/cuda-7.5/lib64/stubs
directory on your machine. You don't want to be using that. It exists for a different purpose.– Robert Crovella
Jul 17 '16 at 14:37
The
libcuda.so
should be in some location like /usr/lib64
on your machine (it may vary by linux distro). That is the one you want to use and the folder you want to include in your LD_LIBRARY_PATH
. There is probably a libcuda.so
in /usr/local/cuda-7.5/lib64/stubs
directory on your machine. You don't want to be using that. It exists for a different purpose.– Robert Crovella
Jul 17 '16 at 14:37
1
1
@ItamarKatz: Please add a short answer summarising what you did to solve this problem.
– talonmies
Jul 18 '16 at 7:37
@ItamarKatz: Please add a short answer summarising what you did to solve this problem.
– talonmies
Jul 18 '16 at 7:37
|
show 6 more comments
2 Answers
2
active
oldest
votes
For future reference, here is what I found out and what I did to solve this problem.
The system is Ubuntu 14.04 64 bit. The NVIDIA driver version that I was trying to install was 367.35. The installation resulted in an error towards the end, with message:
ERROR: Unable to load the kernel module 'nvidia-drm'
However the CUDA samples compiled and run with no problem, so the driver was at least partially installed correctly. However, when I checked the version using:
cat /proc/driver/nvidia/version
The version I got was different (I don't remember exactly but some 352 sub-version).
So I figured out I better remove all traces of the driver and re-install. I followed the instructions in the accepted answer here: https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely, except for the command that makes sure nouveau driver will be loaded in boot.
I finally reinstalled the most up-to-date NVIDIA driver (367.35). The installation finished with no errors and Tensorflow was able to load all libraries.
I think the problem began when someone who worked on the installation before me used apt-get
to install the driver, and not a run
script. Not sure however.
PS during installation there is a warning:
The distribution-provided pre-install script failed! Are you sure
you want to continue?
Looking at the logs I could locate this pre-install script, and its content is simply:
# Trigger an error exit status to prevent the installer from overwriting
# Ubuntu's nvidia packages.
exit 1
so it seems ok to install despite this warning.
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
add a comment |
I had this error on a couple of Ubuntu 16.04 machines. I tried just updating the NVIDIA drivers and Cuda toolkit hoping that apt
would take care of replacing the missing file, but that didn't happen.
Here's a hopefully clear explanation of how I fixed an error like:
...libcuda.so.1: cannot open shared object file: No such file or directory
You are missing this libcuda.so.1
file apparently.
If you look at other SO posts, you will discover that libcuda.so.1
is actually a symbolic link (fancy Unix term for a thing that looks like a file but actually is just a pointer to another file). Specifically, it is a symbolic link to a libcuda.so.# file that is part of the NVIDIA graphics drivers!!! (not part of the Cuda toolkit). So if you do find wherever the package manager has put the libcuda.so.1
file on your system, you'll see it's pointing to this driver-related file:
$ ls /usr/lib/x86_64-linux-gnu/libcuda.so.1 -la
lrwxrwxrwx 1 root root 17 Oct 25 14:29 /usr/lib/x86_64-linux-gnu/libcuda.so.1 -> libcuda.so.410.73
Okay, so you need to make a symbolic link like the one you found, but where?
I.e., where is Tensorflow looking for this libcuda.so.1
? Obviously not where your package manager stuck it.
It turns out that Tensorflow looks in the "load library path".
You can see this path like so:
$ echo $LD_LIBRARY_PATH
and what you get back should include the installed Cuda toolkit:
/usr/local/cuda/lib64
(The exact path might vary on your system)
If not, you need to add the toolkit to $LD_LIBRARY_PATH using some shell command like this (from the NVIDIA Toolkit install manual):
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
(If you don't find anything in /usr/local/cuda
you might not have the toolkit installed.)
Now that you know where Tensorflow looks on the $LD_LIBRARY_PATH for Cuda toolkit, you can add a symbolic link to the toolkit directory.
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.410.73 /usr/local/cuda/lib64/libcuda.so.1
Or you can just listen to other posts that don't explain what's going on but instead tell you to try installing more things in a bunch of different ways. Didn't work for me though :(
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38421840%2ftensorflow-cant-find-libcuda-so-cuda-7-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
For future reference, here is what I found out and what I did to solve this problem.
The system is Ubuntu 14.04 64 bit. The NVIDIA driver version that I was trying to install was 367.35. The installation resulted in an error towards the end, with message:
ERROR: Unable to load the kernel module 'nvidia-drm'
However the CUDA samples compiled and run with no problem, so the driver was at least partially installed correctly. However, when I checked the version using:
cat /proc/driver/nvidia/version
The version I got was different (I don't remember exactly but some 352 sub-version).
So I figured out I better remove all traces of the driver and re-install. I followed the instructions in the accepted answer here: https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely, except for the command that makes sure nouveau driver will be loaded in boot.
I finally reinstalled the most up-to-date NVIDIA driver (367.35). The installation finished with no errors and Tensorflow was able to load all libraries.
I think the problem began when someone who worked on the installation before me used apt-get
to install the driver, and not a run
script. Not sure however.
PS during installation there is a warning:
The distribution-provided pre-install script failed! Are you sure
you want to continue?
Looking at the logs I could locate this pre-install script, and its content is simply:
# Trigger an error exit status to prevent the installer from overwriting
# Ubuntu's nvidia packages.
exit 1
so it seems ok to install despite this warning.
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
add a comment |
For future reference, here is what I found out and what I did to solve this problem.
The system is Ubuntu 14.04 64 bit. The NVIDIA driver version that I was trying to install was 367.35. The installation resulted in an error towards the end, with message:
ERROR: Unable to load the kernel module 'nvidia-drm'
However the CUDA samples compiled and run with no problem, so the driver was at least partially installed correctly. However, when I checked the version using:
cat /proc/driver/nvidia/version
The version I got was different (I don't remember exactly but some 352 sub-version).
So I figured out I better remove all traces of the driver and re-install. I followed the instructions in the accepted answer here: https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely, except for the command that makes sure nouveau driver will be loaded in boot.
I finally reinstalled the most up-to-date NVIDIA driver (367.35). The installation finished with no errors and Tensorflow was able to load all libraries.
I think the problem began when someone who worked on the installation before me used apt-get
to install the driver, and not a run
script. Not sure however.
PS during installation there is a warning:
The distribution-provided pre-install script failed! Are you sure
you want to continue?
Looking at the logs I could locate this pre-install script, and its content is simply:
# Trigger an error exit status to prevent the installer from overwriting
# Ubuntu's nvidia packages.
exit 1
so it seems ok to install despite this warning.
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
add a comment |
For future reference, here is what I found out and what I did to solve this problem.
The system is Ubuntu 14.04 64 bit. The NVIDIA driver version that I was trying to install was 367.35. The installation resulted in an error towards the end, with message:
ERROR: Unable to load the kernel module 'nvidia-drm'
However the CUDA samples compiled and run with no problem, so the driver was at least partially installed correctly. However, when I checked the version using:
cat /proc/driver/nvidia/version
The version I got was different (I don't remember exactly but some 352 sub-version).
So I figured out I better remove all traces of the driver and re-install. I followed the instructions in the accepted answer here: https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely, except for the command that makes sure nouveau driver will be loaded in boot.
I finally reinstalled the most up-to-date NVIDIA driver (367.35). The installation finished with no errors and Tensorflow was able to load all libraries.
I think the problem began when someone who worked on the installation before me used apt-get
to install the driver, and not a run
script. Not sure however.
PS during installation there is a warning:
The distribution-provided pre-install script failed! Are you sure
you want to continue?
Looking at the logs I could locate this pre-install script, and its content is simply:
# Trigger an error exit status to prevent the installer from overwriting
# Ubuntu's nvidia packages.
exit 1
so it seems ok to install despite this warning.
For future reference, here is what I found out and what I did to solve this problem.
The system is Ubuntu 14.04 64 bit. The NVIDIA driver version that I was trying to install was 367.35. The installation resulted in an error towards the end, with message:
ERROR: Unable to load the kernel module 'nvidia-drm'
However the CUDA samples compiled and run with no problem, so the driver was at least partially installed correctly. However, when I checked the version using:
cat /proc/driver/nvidia/version
The version I got was different (I don't remember exactly but some 352 sub-version).
So I figured out I better remove all traces of the driver and re-install. I followed the instructions in the accepted answer here: https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely, except for the command that makes sure nouveau driver will be loaded in boot.
I finally reinstalled the most up-to-date NVIDIA driver (367.35). The installation finished with no errors and Tensorflow was able to load all libraries.
I think the problem began when someone who worked on the installation before me used apt-get
to install the driver, and not a run
script. Not sure however.
PS during installation there is a warning:
The distribution-provided pre-install script failed! Are you sure
you want to continue?
Looking at the logs I could locate this pre-install script, and its content is simply:
# Trigger an error exit status to prevent the installer from overwriting
# Ubuntu's nvidia packages.
exit 1
so it seems ok to install despite this warning.
edited Apr 13 '17 at 12:22
Community♦
11
11
answered Jul 18 '16 at 8:01
Itamar KatzItamar Katz
7,40433360
7,40433360
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
add a comment |
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
Thank you for adding the answer. I am hoping that adding a few good, canonical "I can't make tensorflow build/work/run" will help reduce the volume of redundant and borderline off-topic questions which the release of tensorflow has triggered.
– talonmies
Jul 18 '16 at 10:57
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
I know my question was borderline off-topic, but I reviewed answers on other websites and I didn't have much hope getting help there. I decided to pay the inevitable downvotes on SO and get help - which I did.
– Itamar Katz
Jul 18 '16 at 11:14
add a comment |
I had this error on a couple of Ubuntu 16.04 machines. I tried just updating the NVIDIA drivers and Cuda toolkit hoping that apt
would take care of replacing the missing file, but that didn't happen.
Here's a hopefully clear explanation of how I fixed an error like:
...libcuda.so.1: cannot open shared object file: No such file or directory
You are missing this libcuda.so.1
file apparently.
If you look at other SO posts, you will discover that libcuda.so.1
is actually a symbolic link (fancy Unix term for a thing that looks like a file but actually is just a pointer to another file). Specifically, it is a symbolic link to a libcuda.so.# file that is part of the NVIDIA graphics drivers!!! (not part of the Cuda toolkit). So if you do find wherever the package manager has put the libcuda.so.1
file on your system, you'll see it's pointing to this driver-related file:
$ ls /usr/lib/x86_64-linux-gnu/libcuda.so.1 -la
lrwxrwxrwx 1 root root 17 Oct 25 14:29 /usr/lib/x86_64-linux-gnu/libcuda.so.1 -> libcuda.so.410.73
Okay, so you need to make a symbolic link like the one you found, but where?
I.e., where is Tensorflow looking for this libcuda.so.1
? Obviously not where your package manager stuck it.
It turns out that Tensorflow looks in the "load library path".
You can see this path like so:
$ echo $LD_LIBRARY_PATH
and what you get back should include the installed Cuda toolkit:
/usr/local/cuda/lib64
(The exact path might vary on your system)
If not, you need to add the toolkit to $LD_LIBRARY_PATH using some shell command like this (from the NVIDIA Toolkit install manual):
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
(If you don't find anything in /usr/local/cuda
you might not have the toolkit installed.)
Now that you know where Tensorflow looks on the $LD_LIBRARY_PATH for Cuda toolkit, you can add a symbolic link to the toolkit directory.
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.410.73 /usr/local/cuda/lib64/libcuda.so.1
Or you can just listen to other posts that don't explain what's going on but instead tell you to try installing more things in a bunch of different ways. Didn't work for me though :(
add a comment |
I had this error on a couple of Ubuntu 16.04 machines. I tried just updating the NVIDIA drivers and Cuda toolkit hoping that apt
would take care of replacing the missing file, but that didn't happen.
Here's a hopefully clear explanation of how I fixed an error like:
...libcuda.so.1: cannot open shared object file: No such file or directory
You are missing this libcuda.so.1
file apparently.
If you look at other SO posts, you will discover that libcuda.so.1
is actually a symbolic link (fancy Unix term for a thing that looks like a file but actually is just a pointer to another file). Specifically, it is a symbolic link to a libcuda.so.# file that is part of the NVIDIA graphics drivers!!! (not part of the Cuda toolkit). So if you do find wherever the package manager has put the libcuda.so.1
file on your system, you'll see it's pointing to this driver-related file:
$ ls /usr/lib/x86_64-linux-gnu/libcuda.so.1 -la
lrwxrwxrwx 1 root root 17 Oct 25 14:29 /usr/lib/x86_64-linux-gnu/libcuda.so.1 -> libcuda.so.410.73
Okay, so you need to make a symbolic link like the one you found, but where?
I.e., where is Tensorflow looking for this libcuda.so.1
? Obviously not where your package manager stuck it.
It turns out that Tensorflow looks in the "load library path".
You can see this path like so:
$ echo $LD_LIBRARY_PATH
and what you get back should include the installed Cuda toolkit:
/usr/local/cuda/lib64
(The exact path might vary on your system)
If not, you need to add the toolkit to $LD_LIBRARY_PATH using some shell command like this (from the NVIDIA Toolkit install manual):
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
(If you don't find anything in /usr/local/cuda
you might not have the toolkit installed.)
Now that you know where Tensorflow looks on the $LD_LIBRARY_PATH for Cuda toolkit, you can add a symbolic link to the toolkit directory.
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.410.73 /usr/local/cuda/lib64/libcuda.so.1
Or you can just listen to other posts that don't explain what's going on but instead tell you to try installing more things in a bunch of different ways. Didn't work for me though :(
add a comment |
I had this error on a couple of Ubuntu 16.04 machines. I tried just updating the NVIDIA drivers and Cuda toolkit hoping that apt
would take care of replacing the missing file, but that didn't happen.
Here's a hopefully clear explanation of how I fixed an error like:
...libcuda.so.1: cannot open shared object file: No such file or directory
You are missing this libcuda.so.1
file apparently.
If you look at other SO posts, you will discover that libcuda.so.1
is actually a symbolic link (fancy Unix term for a thing that looks like a file but actually is just a pointer to another file). Specifically, it is a symbolic link to a libcuda.so.# file that is part of the NVIDIA graphics drivers!!! (not part of the Cuda toolkit). So if you do find wherever the package manager has put the libcuda.so.1
file on your system, you'll see it's pointing to this driver-related file:
$ ls /usr/lib/x86_64-linux-gnu/libcuda.so.1 -la
lrwxrwxrwx 1 root root 17 Oct 25 14:29 /usr/lib/x86_64-linux-gnu/libcuda.so.1 -> libcuda.so.410.73
Okay, so you need to make a symbolic link like the one you found, but where?
I.e., where is Tensorflow looking for this libcuda.so.1
? Obviously not where your package manager stuck it.
It turns out that Tensorflow looks in the "load library path".
You can see this path like so:
$ echo $LD_LIBRARY_PATH
and what you get back should include the installed Cuda toolkit:
/usr/local/cuda/lib64
(The exact path might vary on your system)
If not, you need to add the toolkit to $LD_LIBRARY_PATH using some shell command like this (from the NVIDIA Toolkit install manual):
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
(If you don't find anything in /usr/local/cuda
you might not have the toolkit installed.)
Now that you know where Tensorflow looks on the $LD_LIBRARY_PATH for Cuda toolkit, you can add a symbolic link to the toolkit directory.
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.410.73 /usr/local/cuda/lib64/libcuda.so.1
Or you can just listen to other posts that don't explain what's going on but instead tell you to try installing more things in a bunch of different ways. Didn't work for me though :(
I had this error on a couple of Ubuntu 16.04 machines. I tried just updating the NVIDIA drivers and Cuda toolkit hoping that apt
would take care of replacing the missing file, but that didn't happen.
Here's a hopefully clear explanation of how I fixed an error like:
...libcuda.so.1: cannot open shared object file: No such file or directory
You are missing this libcuda.so.1
file apparently.
If you look at other SO posts, you will discover that libcuda.so.1
is actually a symbolic link (fancy Unix term for a thing that looks like a file but actually is just a pointer to another file). Specifically, it is a symbolic link to a libcuda.so.# file that is part of the NVIDIA graphics drivers!!! (not part of the Cuda toolkit). So if you do find wherever the package manager has put the libcuda.so.1
file on your system, you'll see it's pointing to this driver-related file:
$ ls /usr/lib/x86_64-linux-gnu/libcuda.so.1 -la
lrwxrwxrwx 1 root root 17 Oct 25 14:29 /usr/lib/x86_64-linux-gnu/libcuda.so.1 -> libcuda.so.410.73
Okay, so you need to make a symbolic link like the one you found, but where?
I.e., where is Tensorflow looking for this libcuda.so.1
? Obviously not where your package manager stuck it.
It turns out that Tensorflow looks in the "load library path".
You can see this path like so:
$ echo $LD_LIBRARY_PATH
and what you get back should include the installed Cuda toolkit:
/usr/local/cuda/lib64
(The exact path might vary on your system)
If not, you need to add the toolkit to $LD_LIBRARY_PATH using some shell command like this (from the NVIDIA Toolkit install manual):
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
(If you don't find anything in /usr/local/cuda
you might not have the toolkit installed.)
Now that you know where Tensorflow looks on the $LD_LIBRARY_PATH for Cuda toolkit, you can add a symbolic link to the toolkit directory.
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.410.73 /usr/local/cuda/lib64/libcuda.so.1
Or you can just listen to other posts that don't explain what's going on but instead tell you to try installing more things in a bunch of different ways. Didn't work for me though :(
answered Nov 25 '18 at 1:53
NickleDaveNickleDave
6910
6910
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38421840%2ftensorflow-cant-find-libcuda-so-cuda-7-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
libcuda is part of the CUDA driver, not the CUDA toolkit. Have you installed the CUDA driver?
– talonmies
Jul 17 '16 at 13:53
1
libcuda.so
andlibcudart.so
are not the same thing. And whilelibcudart.so
should probably be in/usr/local/cuda-7.5/lib64
on your machine,libcuda.so
should be somewhere else. And the symbolic link fromlibcuda.so
tolibcudart.so
is a completely broken idea. They are different libraries.– Robert Crovella
Jul 17 '16 at 14:16
1
You should attempt to discover where
libcuda.so
is on your machine. There are linux utilities which can find files for you, such asfind
. Have you tried any of them?– Robert Crovella
Jul 17 '16 at 14:18
1
The
libcuda.so
should be in some location like/usr/lib64
on your machine (it may vary by linux distro). That is the one you want to use and the folder you want to include in yourLD_LIBRARY_PATH
. There is probably alibcuda.so
in/usr/local/cuda-7.5/lib64/stubs
directory on your machine. You don't want to be using that. It exists for a different purpose.– Robert Crovella
Jul 17 '16 at 14:37
1
@ItamarKatz: Please add a short answer summarising what you did to solve this problem.
– talonmies
Jul 18 '16 at 7:37