I'm trying to work with tensorflow on Ubuntu 18.04 using Deep Learning AMI from Amazon which has all CUDA verions installed. However, it's not so easy to make tensorflow 1.X work with GPU because some $PATH problems. When no action is taken, this run time error happens while using TF 1.X:
2020-03-25 16:31:58.162200: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
But it works correctly for TF 2.X
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda-10.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH" export PATH="/usr/local/cuda-10.0/bin:$PATH"
but with no effect (I did restart machine or use
source ~/.bashrc command).
However, if I add these variables to
/etc/environment then tensorflow finds these variables and works perfectly! Problem is, that it completely breaks machine as, i assume, it overrides all other
My theory is, that because
/etc/environment has the highest priority the variable
LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda-10.0/extras/CUPTI/lib64 is exactly what TF 1.X requires.
How do I add this variable correctly, so TF 1.X finds it's CUDA-10.0 files and TF 2.X finds its higher CUDA versions?