Q:

How can I make a GPU on Google AI Platform's BASIC_GPU scale-tier visible to my tensorflow program?

I am having trouble getting my code running on Google Cloud's AI platform to find and use the GPU when I have a BASIC_GPU scale-tier. I don't have a local GPU, so I haven't been able to test whether I can recognize a GPU locally.
I call google's ai-platform API with the following code:
gcloud ai-platform jobs submit training $JOB_NAME \
--job-dir $OUTPUT_PATH \
--runtime-version 1.13 \
--python-version 3.5 \
--package-path source/ \
--module-name source.train \
--region $REGION \
--scale-tier BASIC_GPU \
-- \

In my training code I print:
  tf.logging.info('Is GPU Available: ' + str(tf.test.is_gpu_available()))

And it prints out: Is GPU Available: False. 
I'm trying to figure out how I can get TF to see the GPU so that I can use it to speed up my training process and make good use of the BASIC_GPU scale-tier.
Thanks!

A:

In the setup.py file, which specifies the required packages, you need to have tensorflow-gpu be added to the list of required packages. 
For example: the setup.py could look like
from setuptools import find_packages
from setuptools import setup
import sys
sys.path.append('/source/')

REQUIRED_PACKAGES = ['tensorflow-gpu==1.13.1', 'matplotlib', 'ray', 'psutil', 'requests']

setup(
    name='source',
    version='0.1',
    install_requires=REQUIRED_PACKAGES,
    packages=find_packages(),
    include_package_data=True,
    description='Generic example trainer package.'
    )

If instead of tensorflow-gpu==1.13.1 it was tensorflow==1.13.1 it wouldn't have the correct package, and so wouldn't be able to find the GPU. There are some versions of tensorflow (1.15) where the gpu and non-gpu versions have been combined, but for those where they are still separate you will need to make sure that you require the gpu version if you intend to use the GPU.

