Bobcares

Tensorflow-GPU with NVIDIA CUDA on Google Cloud | Installation

by | Mar 5, 2023

Here is a guide to help you Tensorflow-GPU with NVIDIA CUDA on Google Cloud. Our Google Cloud Support team is here to lend a hand with your queries and issues.

Tensorflow-GPU with NVIDIA CUDA on Google Cloud | Installation

If you are looking for a guide to help you install Tensorflow-GPU with NVIDIA CUDA on a Google Cloud instance, you are in luck. Our experts have put together this step-by-step guide to help you out:

  1. To begin with, we have to set up a Google instance.
  2. After that, we have to connect to the SSH server.
  3. Then, we have to download a copy of the cuDNN library for CUDA by taking an NVIDIA membership.
  4. Next, we have to upload the cuDNN tar folder to our instance with this command:
    gcloud compute scp /Users/meghadesai/Desktop/cudnn-9.0-linux-x64-v7.1.tgz @test-gpu:~/Copy Code
  5. After the file is unpacked, we have to copy it to the cuda directory.
  6. Then, we have to install the required python packages: with these commands:
    sudo apt-get install ipython
    sudo apt-get install python3-pipCopy Code
  7. Next, we have to run this command:
    sudo apt-get install openjdk-8-jdk git python-dev python3-dev python-numpy python3-numpy python-six python3-six build-essential python-pip python3-pip python-virtualenv swig python-wheel python3-wheel libcurl3-dev libcupti-devCopy Code
  8. After that, run the following command:
    nano ~/.bashrcCopy Code
  9. At this point, we have to these lines of code, to ensure that the VM instance is aware of the CUDA file from the previous step.
    export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
    export CUDA_HOME=/usr/local/cudaCopy Code
  10. Next, we have to reload the file and then add the Bazel repository for Google Cloud APIs.
    echo “deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8” | sudo tee /etc/apt/sources.list.d/bazel.list
    curl https://bazel.build/bazel-release.pub... | sudo apt-key add -
    sudo apt-get install bazel
    sudo apt-get upgrade bazelCopy Code
  11. Then, we have to clone Tensorflow’s git directory to our instance with this command:
    git clone https://github.com/tensorflow/tensorflow
    cd ~/tensorflow
    ./configureCopy Code
  12. Now, it is time to run these commands in the same sequence:
    /usr/bin/python3.5Copy Code

    Press enter

    /usr/local/lib/python3.5/dist-packagesCopy Code

    Press ‘y’

    bazel build — config=opt — config=cuda
    //tensorflow/tools/pip_package:build_pip_package
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkgCopy Code
  13. Finally, we can run this command and exit SSH:
    sudo pip3 install /tmp/tensorflow_pkg/tensorflow [PRESS TAB TO COMPLETE FILENAME]Copy Code
  14. It is now time to reconnect to the SSH server window and run the following code to verify that GPU is set and being used.

    Tensorflow-GPU with NVIDIA CUDA on Google Cloud | Installation

Let us know in the comments if you need further help with installing Tensorflow-GPU with NVIDIA CUDA on Google Cloud.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

To sum up, our Support Techs demonstrated how to Tensorflow-GPU with NVIDIA CUDA on Google Cloud Platform

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Speed issues driving customers away?
We’ve got your back!