0

In Ubuntu 16.04.4, I installed the TensorFlow 1.3 ROCm port (for an AMD Radeon RX Vega 64) according to the instructions starting at "Install required python packages" in

https://github.com/ROCmSoftwarePlatform/tensorflow/blob/rocm-v1/rocm_docs/tensorflow-install-basic.md

where I had previously installed ROCm from the AMD Debian repository according to the instructions in

https://github.com/RadeonOpenCompute/ROCm

Then, using pip to install the TF .whl package with no virtualization:

$ wget http://repo.radeon.com/rocm/misc/tensorflow/tensorflow-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl
$ sudo python -m pip install tensorflow-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl

When I try to verify the installation using

$ python -c "import tensorflow as tf; print(tf.__version__)"

I get the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libCXLActivityLogger.so: cannot open shared object file: No such file or directory

I verified that _pywrap_tensorflow_internal.so is present:

$ find / -name \*pywrap\* -ls 2>/dev/null
 27526810      4 -rw-r--r--   1 root     staff        2558 Jul 20 11:41 /usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py
 27526811      4 -rw-r--r--   1 root     staff        1312 Jul 20 11:41 /usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.pyc
 27526813     92 -rw-r--r--   1 root     staff       93912 Jul 20 11:41 /usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.pyc
 27526815 227172 -rwxr-xr-x   1 root     staff   232620600 Jul 20 11:41 /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so
 27526816     72 -rw-r--r--   1 root     staff       70386 Jul 20 11:41 /usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py

Also checked my wheel and pip versions:

$ pip list | grep wheel
wheel                        0.29.0
$ pip -V
pip 10.0.1 from ---- python2.7/site-packages/pip (python 2.7)

At first glance it looks as if some environmental variable is not set, so that _pywrap_tensorflow_internal.so is not being searched for on the correct path. Can anyone tell me if this is the case - or if the source of the problem is elsewhere? I did some searches and have come up essentially empty. Thanks in advance for any helpful responses.

HEKTO
  • 3,876
  • 2
  • 24
  • 45
dhfx
  • 1
  • 3

1 Answers1

2

Your immediate problem is that the library file libCXLActivityLogger.so is missing, since you probably never installed it. On Ubuntu, assuming that you've already added the ROCm software repository, you can obtain and install this library with:

$ sudo apt-get install cxlactivitylogger

However, you probably will then find that you are missing further libraries necessary to run TensorFlow. When you installed ROCm according to the directions at https://github.com/RadeonOpenCompute/ROCm, you only installed the "core" ROCm packages, and so you are missing some additional ROCm software components that are needed to run ROCm TensorFlow (such as MIOpen, rocRAND, rocFFT, etc.). To install these additional libraries, follow the instructions that you overlooked at:

https://github.com/ROCmSoftwarePlatform/tensorflow/blob/rocm-v1/rocm_docs/tensorflow-install-basic.md

specifically this command that will install all the needed ROCm packages to run TensorFlow:

$ sudo apt-get update && \
      sudo apt-get install -y --allow-unauthenticated \
      rocm-dkms rocm-dev rocm-libs \
      rocm-device-libs \
      hsa-ext-rocr-dev hsakmt-roct-dev hsa-rocr-dev \
      rocm-opencl rocm-opencl-dev \
      rocm-utils \
      rocm-profiler cxlactivitylogger \
      miopen-hip miopengemm