0

I am trying to deploy a flask (python 3.5) application on an AWS EC2 instance using Apache2 that utilizes the GPU for a tensorflow model (AWS Deep Learning AMI - CUDA 8). And I am receiving the following error:

ImportError: libcusolver.so.8.0: cannot open shared object file: No such file
or directory

I have seen various iterations of this problem across StackOverflow and GitHub including, here: Tensorflow: ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory.

However these do not seem to apply to this case, because I only receive this error when deploying with Apache (it works fine when using Flask's in-built development server, or running the associated scripts manually).

Could anyone provide information as to why I might be receiving this error using Apache only and how I might seek to rectify it?

talonmies
  • 70,661
  • 34
  • 192
  • 269
Edward Atkins
  • 406
  • 5
  • 12

1 Answers1

2

I was able to resolve the issue, using some information found here: https://github.com/tensorflow/tensorflow/issues/4547. I was ignorant to the fact that Apache2 would ignore system level environment variables, and that they had to be set separately.

I needed to set export LD_LIBRARY_PATH=/usr/local/cuda/lib64 in the Apache2 Environment Variables config file, which I found at /etc/apache2/envvars.

Edward Atkins
  • 406
  • 5
  • 12