dlerror: libcuXXX.so.10.0:cannot open shared object file解決方法
6962 ワード
機械に装着cuda tookitは10.2バージョンなのでtensorflow-gpu 1をテストしています.14.0のときにライブラリファイルが見つからないことを提示したのは、https://blog.csdn.net/u014421914/article/details/103410545のヒントを得て、tfパスの下でこれらの欠落したファイルのソフト接続を作成します.
初測定で解決できる
… 2020-02-24 00:04:28.126910: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0 2020-02-24 00:04:28.128464: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0 2020-02-24 00:04:28.129871: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcufft.so.10.0 2020-02-24 00:04:28.130144: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcurand.so.10.0 2020-02-24 00:04:28.131733: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusolver.so.10.0 2020-02-24 00:04:28.132707: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusparse.so.10.0 2020-02-24 00:04:28.141224: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7 … 2020-02-24 00:04:29.846404: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/device:GPU:0 with 2784 MB memory) -> physical GPU (device: 0, name: GeForce GTX 960, pci bus id: 0000:01:00.0, compute capability: 5.2) True True
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/local/cuda/lib64/libcudart.so' ./libcudart.so.10.0
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/lib/x86_64-linux-gnu/libcublas.so' ./libcublas.so.10.0
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/local/cuda/targets/x86_64-linux/lib/libcufft.so' ./libcufft.so.10.0
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/local/cuda/targets/x86_64-linux/lib/libcurand.so' ./libcurand.so
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/local/cuda/targets/x86_64-linux/lib/libcurand.so' ./libcurand.so.10.0
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/local/cuda/targets/x86_64-linux/lib/libcusolver.so' ./libcusolver.so.10.0
$PYTHON_PATH/site-packages/tensorflow$ ln -s '/usr/local/cuda/targets/x86_64-linux/lib/libcusparse.so' ./libcusparse.so.10.0
初測定で解決できる
import tensorflow as tf
print(tf.test.is_gpu_available())
print(tf.test.is_built_with_cuda())
… 2020-02-24 00:04:28.126910: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0 2020-02-24 00:04:28.128464: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0 2020-02-24 00:04:28.129871: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcufft.so.10.0 2020-02-24 00:04:28.130144: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcurand.so.10.0 2020-02-24 00:04:28.131733: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusolver.so.10.0 2020-02-24 00:04:28.132707: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusparse.so.10.0 2020-02-24 00:04:28.141224: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7 … 2020-02-24 00:04:29.846404: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/device:GPU:0 with 2784 MB memory) -> physical GPU (device: 0, name: GeForce GTX 960, pci bus id: 0000:01:00.0, compute capability: 5.2) True True