ImportError: libcudart.so.7.5 when I debug TensorFlow programs using VScode with the python extension? -
i have installed vscode python extension on ubuntu system. have installed tensorflow 0.9, cuda 7.5 , cudnn library correctly.
however, when debug tensorflow program using vscode, give error importing tensorflow (import tensorflow) below:
importerror: libcudart.so.7.5: cannot open shared object file: no such file or directory
i can sure libraries have been installed successfully. because can debug , run python programs in vscode, , can run tensorflow programs using ubuntu terminal.
besides, when import tensorflow ubuntu terminal, gives output follows:
i tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcublas.so locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcudnn.so locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcufft.so locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcuda.so locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcurand.so locally
as can see, didn't use lib 'libcudart.so.7.5'.
i have checked cuda path in ~/.bashrc, bellow:
export cuda_home=/usr/local/cuda-7.5 export ld_library_path=/usr/local/cuda-7.5/lib64 export path=$path:/usr/local/cuda-7.5/bin
since cuda installed in path '/usr/local/cuda-7.5', , can find 'libcudart.so.7.5' lib in path, don't think there error.
so problem? why importing terminal, there no error, there such error when importing vscode? thank you.
i have solved problem after searching , reading many web pages. method bellows:
first, link cuda library using following command:
sudo ldconfig /usr/local/cuda/lib64
then, can import tensorflow in vscode. however, there still 1 error, bellow:
i tensorflow/stream_executor/dso_loader.cc:99] couldn't open cuda library libcudnn.so. ld_library_path: tensorflow/stream_executor/cuda/cuda_dnn.cc:1562] unable load cudnn dso
although program can run, seems program cannot find cudnn library. found cudnn library not installed correctly on ubuntu system. modified installation using following commands:
cd ~/cuda sudo cp include/cudnn.h /usr/include sudo cp lib64/libcudnn* /usr/lib/x86_64-linux-gnu/ sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcudnn*
here, '~/cuda' path of cudnn installation files.
finally, after these steps, can import tensorflow , debug program in vscode now.
Comments
Post a Comment