TF2.0 ptxas ignores PATH · Issue #33375 · tensorflow/tensorflow (github.com)
The workaround for this particular problem on unix-based machines is to link your cuda bin to your working directory. Go to the directory, where you launch your python code and create the link:ln -s /full/path/to/your/cuda/installation/bin .
This sovles the problem. The point is that TF first tries to load the ptxas from ./bin directory, then from /usr/local/cuda/bin. Unfortunately, it completely ignores the environment variables (which I consider to be a bug).