TensorFlow GPU
VirtualBox
Ubuntu
Windows 10
Installation Guide

How to install tensorflow GPU version on VirtualBox Ubuntu OS. And host OS is windows 10

ML System Design practice on Codemia

Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.

Practice ML system design

Introduction

Running TensorFlow with GPU support can significantly boost your model training workloads. This guide details the installation process of the TensorFlow GPU version on an Ubuntu OS running within a VirtualBox environment on a Windows 10 host. Using a virtualized environment ensures a decomposed system setup that is reusable and reproducible.

Prerequisites

  1. Windows 10 Host OS: Ensure that your system supports virtualization and has it enabled in the BIOS.
  2. Oracle VirtualBox: Install VirtualBox (Download here).
  3. Ubuntu ISO: Download the Ubuntu 20.04 LTS desktop image (Download here).
  4. NVIDIA GPU Drivers: Ensure your Windows system has the latest NVIDIA drivers (nvidia-smi should show your GPU properties).
  5. CUDA & cuDNN Compatibility: Check the compatibility matrix between TensorFlow, CUDA, and cuDNN.

Step-by-Step Installation

1. Setting Up VirtualBox

  • Install VirtualBox: Follow the installation instructions for VirtualBox on Windows.
  • Create a New Virtual Machine:
    • Start VirtualBox and click on “New”.
    • Name your virtual machine and set the type to “Linux” and version to “Ubuntu (64-bit)”.
    • Allocate at least 4GB of RAM and 2 CPU cores.
  • Attach Ubuntu ISO:
    • Go to “Settings” > “Storage”.
    • Under "Controller: IDE", click on "Empty", then choose the downloaded Ubuntu ISO.

2. Install Ubuntu in VirtualBox

  • Start the Virtual Machine: Launch the virtual machine and select “Install Ubuntu”.
  • Follow On-Screen Instructions: Choose your keyboard layout, and install updates during OS installation.
  • Reboot and Update: After installation, reboot and update the packages using:
  • Install NVIDIA Drivers and CUDA:
  • Verify CUDA Installation:
  • Install cuDNN:
    • Download cuDNN from NVIDIA’s website (requires free registration).
    • Copy cudnn-``<version>``-``<linux-x64>``.tgz to Ubuntu and extract it:
  • Set Up Python Environment:
    • Install Python via sudo apt install python3-pip python3-dev.
    • Create a virtual environment:
  • Install TensorFlow:
  • Verify TensorFlow Installation:

Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Basis Lab
No course covers this one yet

Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.

Build my course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

ML System Design practice on Codemia

Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.

Practice ML system design