How to Install TensorFlow GPU on Linux

Tech With Tim · Beginner ·📰 AI News & Updates ·7y ago

Key Takeaways

The video demonstrates how to install TensorFlow 2.0 GPU version on a Linux machine, specifically on Ubuntu, by following the steps listed on the TensorFlow website, including installing CUDA, Nvidia drivers, and TensorFlow 2.0 using pip3.

Full Transcript

hey guys so in today's video I'm gonna be showing you how to install tensorflow 2.0 GPU version on Anna bunt 2 / Linux machine now this should work for any version of Linux or any Linux operating system although the one I am gonna be showing you on is a bun to 18 point 0.4 now you may notice that I'm actually on a Windows machine right now and that this is actually just in a bunch of terminal that's open now I'm actually just SS aged into a server that I have that contains 2 1080 graphics card so GTX 1080s and that's how I'm gonna be showing you how to do this now quickly if you don't understand the difference between the CPU and the GPU version the CPU version is essentially just way slower and you would only really use the CPU version if you don't have a graphics card in your computer that is capable of running tensorflow 2.0 GPU so quickly before we go forward and you guys get frustrated with not being able to install this make sure that you have a graphics card that actually works for this programmer for this module that means you have to have a graphics card that is a gtx 1050 TI or higher those are the ones that are listed on tensorflow website as compatible with tensorflow 2.0 GPU if you want to have a quick thing without having to go to the website to see if yours works even as 4 gigs of video RAM and is a GTX generation card or higher it most likely works with tensorflow 2.0 now I don't know about all the different cards but you have any questions leave them below I'll try to answer that for you but any 1060 1070 1080 or r-tx cards they have CUDA cores on them will work for this essentially you just need a CUDA enable GPU so you can check if yours meets that requirement before moving forward now to do this I'm just gonna be following the steps listed on the tensorflow website now you may run into some issues while doing this but for Ubuntu this is pretty straightforward and I'm essentially just gonna be copying these commands and pasting them in my terminal now if you'd like to just try to do this without following along with video go ahead but I will be kind of showing you some fixes that I ran into while I was doing this um so let's go ahead and get started so actually let me just split the screen up so we can have a look at both them at once I'm in my Linux machine right now you just have to get to the terminal you notice that I don't even have a desktop and I'm literally just gonna start copying and pasting these commands now the first thing that we need to install is actually CUDA now CUDA is what allows us to use the CUDA cores on our GPU to actually run the code so just go ahead and keep copying these commands it will take a second and I actually already have this installed on my machine so I'm gonna go through the steps with you guys but again if anything is different on my machine that's probably because it's already installed so if you don't know how to copy it into a window like this you just right click on your mouse and it'll copy if you're using a server like I am but anyways we'll just go through all of these and keep going now I will have all these commands listed in my description as well and that should show you guys you know if the website goes down at any point you can just copy it from there as well so yeah it literally just keep going all we're doing here is adding the video packages we're gonna make sure we have the Nvidia drivers for our graphics card that are correct and then we're gonna go ahead and install tensorflow 2.0 so yep just go through these commands there's not really much for me to say as I copy these in and eventually we will get through them all alright so now we're gonna install the even a video driver you can see that's all commented out on this tensorflow website here copy that and I can just continue go I don't really have any commentary for you guys here so we'll copy this this is gonna install obviously the development and runtime libraries which we need and it says minimum four gigs or approximately four gigabytes which will mean that's how long it how many gigabytes is getting take up on a machine so this will take a second and I'll fast-forward through these stuff if it does take a while finally we're going to install tensor RT I don't even know what this is but apparently it's required and then after we're done this we should actually be finished installing everything that we need for tensorflow 2.0 to work again if you guys want to go through this just go to the website copy all these commands in order paste them into here and they should work properly now finally what we have to do is actually install tensorflow 2.0 so we've got all the dependents the dependencies installed and now to install tensorflow 2.0 we're just gonna say pip 3 install tensorflow and i believe we're gonna say - GPU and then equals equals 2.0 point I gotta find it up here too make sure that we do it correctly two-point 0.0 - alpha zero like that so then we'll do that and that should install tents flow 2.0 for us now I already have this installed but this will actually take a few minutes to install because there is quite a bit of stuff that it needs to download on your computer so anyways that has been it for installing tensorflow 2.0 on your computer using the GPU version again throughout the rest of the neural network series I'm gonna be going forward doing this on in a bunting machine so running all of the code I'll do the development and windows throw the files on my server train the model train the models excuse me and then take the models off and use them on my Windows machine so if you want to validate if this is working you can really quickly just do Python 3 in Linux and then you can cite do import tensorflow and doing that you shouldn't get any errors and if you don't get any errors then you have successfully installed tensorflow 2.0 now a few errors here because they're still listening and stuff wasn't working if for some reason when you install tensorflow and you notice that it's not using your GPU go ahead and uninstall the cpu version of tensorflow so just pip3 on on the install and then tensorflow and i guess you'd have to just do just tensorflow like that and that will install the cpu version if it is installed in your machine so anyways that has been it for how to install tensorflow 2.0 GPU version on a bun - pretty straightforward just go through copies commands if you guys have any questions or errors please just leave them in the comments below and i will try my best to help you up

Original Description

This tutorial will show you how to install tensorflow gpu on linux/ubuntu. Installing tensorflow gpu requires that you have a CUDA enabled gpu (typically a GTX1050ti 0r higher). Tensorflow website: https://www.tensorflow.org/install/gpu Playlist: https://www.youtube.com/watch?v=OS0Ddkle0o4&list=PLzMcBGfZo4-lak7tiFDec5_ZMItiIIfmj Commands: # Add NVIDIA package repositories wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub sudo apt-get update wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb sudo apt-get update # Install NVIDIA driver sudo apt-get install --no-install-recommends nvidia-driver-410 # Reboot. Check that GPUs are visible using the command: nvidia-smi # Install development and runtime libraries (~4GB) sudo apt-get install --no-install-recommends \ cuda-10-0 \ libcudnn7=7.4.1.5-1+cuda10.0 \ libcudnn7-dev=7.4.1.5-1+cuda10.0 # Install TensorRT. Requires that libcudnn7 is installed above. sudo apt-get update && \ sudo apt-get install nvinfer-runtime-trt-repo-ubuntu1804-5.0.2-ga-cuda10.0 \ && sudo apt-get update \ && sudo apt-get install -y --no-install-recommends libnvinfer-dev=5.0.2-1+cuda10.0 Want a sneak peak into my life? Follow my Instagram @tech_with_tim where I'm going to be filming a video each morning sharing my goals for the day and what I have planned: https://www.instagram.com/tech_with_tim ◾◾◾◾◾ 💻 Enroll in The Fundamentals of Programming w/ Python https://tech-with-tim.teachable.com/p... 📸 Instagram: https://www.instagram.com/tech_with_tim 🌎 Website https://techwithtim.net 📱 Twitte
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Tech With Tim · Tech With Tim · 0 of 60

← Previous Next →
1 A* Path Finding Algorithm(Visualization)
A* Path Finding Algorithm(Visualization)
Tech With Tim
2 Python Programming Tutorial #1 - Variables and Data Types
Python Programming Tutorial #1 - Variables and Data Types
Tech With Tim
3 Python Programming Tutorial #2 - Basic Operators and Input
Python Programming Tutorial #2 - Basic Operators and Input
Tech With Tim
4 Python Programming Tutorial #3 - Conditions
Python Programming Tutorial #3 - Conditions
Tech With Tim
5 Python Programming Tutorial #4 - IF/ELIF/ELSE
Python Programming Tutorial #4 - IF/ELIF/ELSE
Tech With Tim
6 Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Tech With Tim
7 Python Programming Tutorial #6 - For Loops
Python Programming Tutorial #6 - For Loops
Tech With Tim
8 Python Programming Tutorial #7 - While Loops
Python Programming Tutorial #7 - While Loops
Tech With Tim
9 Python Programming Tutorial #8 - Lists and Tuples
Python Programming Tutorial #8 - Lists and Tuples
Tech With Tim
10 Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Tech With Tim
11 Python Programming Tutorial #10 - String Methods
Python Programming Tutorial #10 - String Methods
Tech With Tim
12 How to Overclock a NVIDIA GPU
How to Overclock a NVIDIA GPU
Tech With Tim
13 Python Programming Tutorial #11 - Slice Operator
Python Programming Tutorial #11 - Slice Operator
Tech With Tim
14 Python Programming Tutorial #12 - Functions
Python Programming Tutorial #12 - Functions
Tech With Tim
15 Python Programming Tutorial #13 - How to Read a Text File
Python Programming Tutorial #13 - How to Read a Text File
Tech With Tim
16 Python Programming Tutorial #14 - Writing to a Text File
Python Programming Tutorial #14 - Writing to a Text File
Tech With Tim
17 Python Programming Tutorial #15 - Using .count() and .find()
Python Programming Tutorial #15 - Using .count() and .find()
Tech With Tim
18 Python Programming Tutorial #16 - Introduction to Modular Programming
Python Programming Tutorial #16 - Introduction to Modular Programming
Tech With Tim
19 Python Programming Tutorial #17 - Optional Parameters
Python Programming Tutorial #17 - Optional Parameters
Tech With Tim
20 Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Tech With Tim
21 Python Programming Tutorial #19 - Global vs Local Variables
Python Programming Tutorial #19 - Global vs Local Variables
Tech With Tim
22 Python Programming Tutorial #20 - Classes and Objects
Python Programming Tutorial #20 - Classes and Objects
Tech With Tim
23 Cool VBS Script to Prank Your Friends!
Cool VBS Script to Prank Your Friends!
Tech With Tim
24 How to Overclock an AMD GPU
How to Overclock an AMD GPU
Tech With Tim
25 Best GPU'S For Mining Ethereum (2018)
Best GPU'S For Mining Ethereum (2018)
Tech With Tim
26 Recursion and Memoization Tutorial Python
Recursion and Memoization Tutorial Python
Tech With Tim
27 Ethereum Mining Rig - Hardware Guide
Ethereum Mining Rig - Hardware Guide
Tech With Tim
28 Pygame Tutorial #1 - Basic Movement and Key Presses
Pygame Tutorial #1 - Basic Movement and Key Presses
Tech With Tim
29 How to Install Pygame (Windows 8/10)
How to Install Pygame (Windows 8/10)
Tech With Tim
30 How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
Tech With Tim
31 How to Mine Ethereum 2018 - WORKING (Super-Easy)
How to Mine Ethereum 2018 - WORKING (Super-Easy)
Tech With Tim
32 Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Tech With Tim
33 Pygame Tutorial #2 - Jumping and Boundaries
Pygame Tutorial #2 - Jumping and Boundaries
Tech With Tim
34 Pygame Tutorial #3 - Character Animation & Sprites
Pygame Tutorial #3 - Character Animation & Sprites
Tech With Tim
35 Pygame Tutorial #4 - Optimization & OOP
Pygame Tutorial #4 - Optimization & OOP
Tech With Tim
36 OBS Studio Tutorial - Best OBS Settings
OBS Studio Tutorial - Best OBS Settings
Tech With Tim
37 Linear Search Algorithm - Python Example and Code
Linear Search Algorithm - Python Example and Code
Tech With Tim
38 Make Any Mic Sound AMAZING! (WITH OBS)
Make Any Mic Sound AMAZING! (WITH OBS)
Tech With Tim
39 Binary Search Algorithm - Python Example & Code
Binary Search Algorithm - Python Example & Code
Tech With Tim
40 Pygame Tutorial #5 - Projectiles
Pygame Tutorial #5 - Projectiles
Tech With Tim
41 Pygame Game - Mini Golf
Pygame Game - Mini Golf
Tech With Tim
42 Pygame Tutorial - Projectile Motion (Part 1)
Pygame Tutorial - Projectile Motion (Part 1)
Tech With Tim
43 Pygame Tutorial - Projectile Motion (Part 2)
Pygame Tutorial - Projectile Motion (Part 2)
Tech With Tim
44 Pygame Tutorial #6 - Enemies
Pygame Tutorial #6 - Enemies
Tech With Tim
45 Pygame Tutorial #7 - Collision and Hit Boxes
Pygame Tutorial #7 - Collision and Hit Boxes
Tech With Tim
46 Pygame Tutorial #8 - Scoring and Health Bars
Pygame Tutorial #8 - Scoring and Health Bars
Tech With Tim
47 Cloud Mining vs. Hardware Mining - 2018
Cloud Mining vs. Hardware Mining - 2018
Tech With Tim
48 How to Install Pygame on Mac OSX (Fast-Simple)
How to Install Pygame on Mac OSX (Fast-Simple)
Tech With Tim
49 Pygame Tutorial #9 - Sound Effects, Music & More Collision
Pygame Tutorial #9 - Sound Effects, Music & More Collision
Tech With Tim
50 Pygame Tutorial #10 - Finishing Touches & Next Steps
Pygame Tutorial #10 - Finishing Touches & Next Steps
Tech With Tim
51 How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
Tech With Tim
52 How to Create a Button in Pygame [CODE IN DESCRIPTION]
How to Create a Button in Pygame [CODE IN DESCRIPTION]
Tech With Tim
53 Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Tech With Tim
54 Pygame Side-Scroller Tutorial #2 - Random Object Generation
Pygame Side-Scroller Tutorial #2 - Random Object Generation
Tech With Tim
55 Pygame Side-Scroller Tutorial #3 - Collision
Pygame Side-Scroller Tutorial #3 - Collision
Tech With Tim
56 Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Tech With Tim
57 How to Create A Message Box in Python - Tkinter
How to Create A Message Box in Python - Tkinter
Tech With Tim
58 Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Tech With Tim
59 How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
Tech With Tim
60 Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Tech With Tim

This video teaches how to install TensorFlow 2.0 GPU version on a Linux machine, which is essential for building and training machine learning models with GPU acceleration. The tutorial provides step-by-step instructions on installing CUDA, Nvidia drivers, and TensorFlow 2.0 using pip3.

Key Takeaways
  1. Install CUDA on Linux
  2. Install Nvidia drivers for the graphics card
  3. Install TensorFlow 2.0 using pip3
  4. Verify TensorFlow 2.0 installation by importing it in Python 3
💡 To install TensorFlow 2.0 GPU version on Linux, a CUDA-enabled GPU (such as GTX 1050 TI or higher) is required, and the installation process involves installing CUDA, Nvidia drivers, and TensorFlow 2.0 using pip3.

Related Reads

Up next
I Lost 94% of My Traffic. Then I Found the Unfair Advantage
Conor Martin
Watch →