CentOS/RedHat install Tensorflow in HPC
来源:互联网 发布:捕鱼刷分软件 编辑:程序博客网 时间:2024/06/01 08:49
Problem
Tensorflow(a .so library file in the python library path) need the Glibc2.15 + , but the Glibc version in RedHat in HPC is 2.12. This make the tensorflow install fail.
Analysis(Principle)
The .so dynamic library file is linked/loaded to the python executable file by the Dynamic linker/loader
in runtime
. We can specify the new Glibc’s library file(libc.so.6
) path to the LD_LIBRARY_PATH
environment, but the Glibc
and the Dynamic loader/ld.so.2
is corresponding. Thus we also need to specify the new Glibc
’s corresponding ld.so.2
file.
Refer to:
http://man7.org/linux/man-pages/man8/ld.so.8.html
http://man7.org/linux/man-pages/man1/ldd.1.html
https://www.cs.virginia.edu/~dww4s/articles/ld_linux.html
https://unix.stackexchange.com/questions/122670/using-alternate-libc-with-ld-linux-so-hacks-cleaner-method
Answer
We explicit specify the ld.so.2
’s path in command line instead of the default ld.so.2
file path which specified in the binary file1 2. And use the --library-path
parameter of ld.so.2
instead of LD_LIBRARY_PATH
environment.3 For example:
${HOME}/local/lib64/ld-linux-x86-64.so.2 --library-path ${HOME}/local/lib64:${HOME}/local/usr/lib64 ${HOME}/anaconda/tensorflow/bin/python
Refer to:
http://xr0038.hatenadiary.jp/entry/2016/08/31/165011
https://stackoverflow.com/questions/33655731/error-while-importing-tensorflow-in-python2-7-in-ubuntu-12-04-glibc-2-17-not-f/34897674#34897674
Set up the environment
modified from4
For the previous steps, please refer to the original blog.
# activate the tensorflow pyenv in the anacondasource activate tensorflowLDPATH="${HOME}/local/lib64/ld-linux-x86-64.so.2"LDLIBS="${HOME}/local/lib64"LDLIBS="${LDLIBS}:${HOME}/local/usr/lib64"LDLIBS="${LDLIBS}:/opt/cuda-7.5/lib64"PYPATH="${HOME}/anaconda/tensorflow/bin/python"# ${LDPATH} --library-path ${LDLIBS} ${PYPATH}# ipython は以下のように起動する.# IPYPATH="${HOME}/.pyenv/versions/TensorFlow/bin/ipython"# ${LDPATH} --library-path ${LDLIBS} ${PYPATH} ${IPYPATH}alias python-tensorflow="${LDPATH} --library-path ${LDLIBS} ${PYPATH}"# alias ipython-tensoflow="${LDPATH} --library-path ${LDLIBS} ${PYPATH} ${IPYPATH}"
Use
~ python-tensorflow>>> import tensorflow as tf>>> sess = tf.Session()>>> exit()~ python-tensorflow xxx.py
- http://man7.org/linux/man-pages/man8/ld.so.8.html ↩
- patchELF ↩
- http://man7.org/linux/man-pages/man8/ld.so.8.html#OPTIONS ↩
- http://xr0038.hatenadiary.jp/entry/2016/08/31/165011 ↩
- CentOS/RedHat install Tensorflow in HPC
- centos 7 pip install tensorflow
- install nginx in centos
- install nginx in centos
- gcc install in CentOS
- Install JSON PHP Extension on CentOs / RedHat
- CentOS / Redhat: Install KVM Virtualization Software
- install postgresql9.6.3 in redhat 7
- install mysql in centos 6
- telnet install in centos 6
- install salt in centos 6.5
- Install terminator in CentOS 7
- Install NextCloud in CentOS 7
- Golden Rules in HPC
- [centos]install python3.5 in centos
- Groovy in Linux(redhat/CentOs/Debian)
- RedHat / CentOS Install and Configure Cacti Network Graphing Tool
- Install MongoDB on RedHat Enterprise, CentOS, or Fedora Linux
- 数据结构--哈希表
- genymotion下载360桌面之后安装的时候 提示此应用与您的手机不兼容
- 公开课分享《如何快速有效地编写一份商业计划书》
- CSDN-markdown编辑器
- 使用spring-loaded实现应用热部署
- CentOS/RedHat install Tensorflow in HPC
- Codeforces Round #376 (Div. 2)C(DFS)
- 过滤器的常见应用
- LoRa开发6:接收数据帧
- 用十条命令在一分钟内检查Linux服务器性能
- 浅谈javascript的Array.prototype.slice.call
- codeforces-16A-A. Flag (C && 简单模拟 && 暴力农夫山泉)
- linux export命令
- Leetcode - Remove Nth Node From End of List