Installing Latest TensorFlow on Windows with CUDA, cudNN & GPU support - Step by Step Tutorial 2022
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- In this video I will show you how to set up and install the latest Tensorflow version with GPU support on Windows 10 & 11. We will require Visual C++, CUDA, CuDNN, as well as the Python libraries using Anaconda.
▶ Step 1: NVIDIA Video Driver [www.nvidia.com...]
▶ Step 2: Visual Studio C++ [visualstudio.m...]
▶ Step 3: CUDA [developer.nvid...]
▶ Step 4: CuDNN [developer.nvid...]
▶ Step 5: Anaconda [www.anaconda.com/]
▶ Step 6: Jupyter Notebook, Environment & TensorFlow/Keras
▶ Sponsor me on GitHub : github.com/spo...
▶ Join this channel to get access to perks: bit.ly/Bhavesh...
▶ Join the Telegram channel for regular updates: t.me/bhattbhav...
▶ If you like my work, you can buy me a coffee : bit.ly/BuyBhav...
*I use affiliate links on the products that I recommend. These give me a small portion of the sales price at no cost to you. I appreciate the proceeds and they help me to improve my channel!
▶ Best Book for Python : amzn.to/3qYThqu
▶ Best Book for Statistics : amzn.to/3vzvHEn
▶ Best Book for BERT: amzn.to/3lpX0fz
▶ Best Book for Machine Learning : amzn.to/2P6aZuT
▶ Best Book for Deep Learning : amzn.to/30UMTGl
▶ Best Intro Book for MLOps : amzn.to/3AoPZmM
Equipments I use for recording the videos:
▶ 1st Laptop I use : amzn.to/3AqI8Fp
▶ 2nd Laptop I use : amzn.to/3KAiYsB
▶ Microphone : amzn.to/3qUPxtz
▶ Camera : amzn.to/3rKQsM2
▶ Mobile Phone : amzn.to/3nRHP1f
▶ Ring Light : amzn.to/33LedM5
▶ RGB Light : amzn.to/3KzLgmS
▶ Bag I use : amzn.to/3AsM3RZ
If you do have any questions with what we covered in this video then feel free to ask in the comment section below & I'll do my best to answer those.
If you enjoy these tutorials & would like to support them then the easiest way is to simply like the video & give it a thumbs up & also it's a huge help to share these videos with anyone who you think would find them useful.
Please consider clicking the SUBSCRIBE button to be notified for future videos & thank you all for watching.
You can find me on:
▶ Blog - bhattbhavesh91...
▶ Twitter - / _bhaveshbhatt
▶ GitHub - github.com/bha...
▶ Medium - / bhattbhavesh91
▶ About.me - about.me/bhatt...
▶ Linktree - linktr.ee/bhat...
▶ DEV Community - dev.to/bhattbh...
▶ Telegram - t.me/bhattbhav...
#tensorflow #gpu #windows #cuda #cudnn
I don't comment often on social media, but I have to give you your "flowers" for this tutorial video. It really helped me, and for that I am thankful.
Glad it was helpful!
Hi Bhabesh, Thank you so much! I attempted to install Tensorflow on GPU twice and eventually gave up. Recently, I am working on a project where I am training 5370 lstm models on billions of observations and training on CPU is a joke. hence I had to make it work and I spent around 7 hours to figure it out and finally I stumbled on your video and it worked like a charm. You saved my life. Thank you so very much! God Bless you
Ya i resolved it too. As i also tried for so many hours.
I got it resolved from Krish Naik video
hey I need your help
@@AandGTech ya say
Thanks! Very helpful!
I follow the instructions and it works very well. Confirmed with actual TensorFlow usage. However, due to limitations for Windows native, I specify the version of some packages and software as follows:
- VS Community 2019
- CUDA 11.4
- CuDNN 8.2.4.15
- Python 3.9.7
- TensorFlow 2.7.0
To avoid errors in TensorFlow installation, you may need to install Protobuf==3.20.0 in advance.
Mine not working with Nvidia GeForce rtx 2050 card. Any suggestions please?
FYI, because after tensorflow-2.10, tensorflow will not support GPU on naive-windows instead of WSL2. So the last version is tensorflow-2.10.1.
Remember, you have to install CUDA-11.2 and cudnn-8.9 in your host machine.
Also, you need to install anaconda-navigator, any version is OK.
Then in anaconda-navigator create the virtual environment with Python 3.10.x, you cannot use Python 3.11, because that is the limit for tensorflow-2.10
After that, in your venv-python 3.10 in anaconda prompt:
pip install tensorflow==2.10.1
then you gonna see 'True'
Is it possible just use conda install cudnn and cuda to set up gpu?
or I have to manually do like the video shows?
Thank you! Your solution was very helpful!
THANK YOU SO MUCH!!!!
I was about to cry after going through hours of this (including the video) and it still showed False.
You extended my life a little longer
thenk you marry me please
for 11.2 win 11 option is not available, is it okay to download as win 10
Thanks! Very helpful!
I follow the instructions and it works very well. Confirmed with actual TensorFlow usage. However, due to limitations for Windows native, I specify the version of some packages and software as follows:
- VS Community 2022
- CUDA 11.8.0 [Highest supported version in Windows at the moment]
- CuDNN 8.9.5.30 [Highest supported version in Windows at the moment]
- Python 3.10.13 [Highest supported version in Windows at the moment]
- TensorFlow 2.10.0 [Highest supported version in Windows at the moment]
After searching for hours this info finally came to my rescue. Tysm 🙏🙏
Thank you so much Bhavesh. Worked Flawlessly and enjoyed the whole process ! Cheers
You are most welcome
hello @aneeshkalita7452 what specific version of cuDNN and CUDA libraries did you install?
Thank you so much. Best Tutorial in first go my laptop tensorflow is accessing the GPU of my machine. Thank you so much for beautiful lesson 😎
Glad you liked it!
Thank you for your kindness. I just bought a new computer and it has helped me tremendously.
You are welcome!
Hello. Everything went correctly. At the last step, when I am checking whether the GPU's are connected, it is returning False. Any suggestions?
Update?
@@arnabroy1206 Hello
I tried again a few times... but to no avail :(. As of now I still cannot connect to GPU's to train my ML model. I have tried with both PyTorch and Tensorflow.
I am facing the same issue. Did you find the solution please let me know.
@@dvamsidhar6008 Hi sorry but I gave up on that. I haven't tried installing CUDA again since then
Sorry that I'm not of help
Same issue with me, mine nvidia GeForce rtx 2050 card .
Thank you !!!, such an amazing video to install cuda and CuDNN , it was very helpfull and
it works!!!!
You're welcome!
Ty for saving me, now I can train NN so much faster, kudos for the excelent work
Great to hear!
Is that visual studio part is essential pls tell anyone
Hi Bhavesh Bhatt,
Thank you so much for this amazing video on installing a GPU for TensorFlow! It's been a lifesaver in getting me started.
I have a quick question though. I'm preparing for an upcoming TensorFlow exam and need to install TensorFlow 2.13.0 for it. I'm using a Windows 11 system with an NVIDIA RTX 3050 GPU. I'm a bit lost on the specific installation steps I need to follow for this setup.
Could you please provide some more detailed guidance on this? Your expertise would be a huge help in ensuring I have the correct setup for my exam.
Thanks again for your awesome tutorials!
Glad it was helpful!
Unfortunely, it did not work for me, even after using all the same versions. I have an RTX 4090 so I am not sure if that's the issue. I will have to do more research because CPU is not ideal. Thank you for the video because it gives me an introduction of what I may need to eventually do.
For anyone else: I got it to work but ended up using WSL which is Window's built in Ubuntu remote desktop (super simple). I followed a video that basically followed the directions on the Tensorflow website. I just ran commands in a shell and everything worked flawlessly.
Hi, I also installed it via wsl, which I am able to run in vsc. Everything works until I actually try to train the model.
It states that no libdevice is found.
Did you have a similar problem?
@@PetarLuketina Could you please tell which video did you referred for it?
guys I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
@@akashrai7102 worked for me too. Thanks bro
Thank you so much Bhavesh bhai it was a great effort and a great help indeed.
Dear Bhatt, I recently installed a RTX 4060 TI GPU in my PC, which cuda version do you suggest ? I have installed Anaconda/Spyder
i saw lot of videos and i to have RTX 4060 ti GPU in my PC, I am getting void array when i run " print(tf.config.list_physical_devices('GPU'))" as []
While downloading its saying-> [NVIDIA installer cannot continue
No NVIDIA is detected in your computer
This graphics driver could not find compatible graphics hardware.]
How to fix it
I followed all your instructions, but they didn't work for me. I'm running Windows 11 home, Python v 3.10.10, TF v2.12.0, and CUDA v12.1.0. I'm not sure what's wrong.
Tensorflow can't work wit CUDA - 12, Max version is 11.8
@@renatgaliev2137 Python v 3.10.11, TF v2.12.0, and CUDA v11.8.0, cUdnn 8.6 STILL NOT WORKING
Yo save me from a depression jajajajajaj Thanks a lot!!!
thanks dear . you tutorial work for 3080 nvidia gpu?
Yes, of course
do we need to have NVIDIA gpu to run cuda , cudNN
Thanks, Bhavesh for your great tutorial, I would really like to use Cuda but unfortunately, my pc does not have Nvidia which supports it instead it has Intel(R)Iris(R) Plus Graphics
Same here.. I am struggling to get the code running.. Please let me know what alternate method did you follow
The video is outdated, now the latest tensorflow GPU works with wsl2. But for older versions it seems to work, I think.
can you tell the latest method because i am still getting false
I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
I followed every step, but it is not working. Gives FALSE. Please help
why do we need validation? I mean what is the purpose, can we install without validation, will it work properly?
actually this is the first time that i found an informative video like this, really thank you
After months I was able to get my GPU to run with python 3.10 and tensorflow 2.10.1. I also uninstalled all my CUDA 12 and installed CUDA 11.6 instead (not sure if that helps). Here is my code.
conda create -y --name tf python=3.10
conda activate tf
pip install tensorflow==2.10.1
python
import tensorflow as tf
len(tf.config.list_physical_devices('GPU'))>0
Thanks to all the troubleshooting in the comments, hope everyone has a nice day.
Bro can pls tell me which version will be suitable for GTX 1650ti
what if in the end it show false as out put
i want to know, do i have to download and install all those individual component you selected? or only IDE is enought?
What you Actually need!
--> cuda version 11.2
--> cuDNN version compatible with any 11.x version will work.
--> python version 3.10.13
--> tensorflow version 2.10.1 will only work. (pip install tensorflow==2.10.1)
(Anaconda Any latest version will work)
cuda version 11.6 might not work but 11.2 does!
I can now see that TensorFlow is accessing the GPU of my machine. Thank you so much for the beautiful lesson.
Can Somebody Please tell that is it mandatory to download the VS Code C++?
mnononoon
i want to build a pc for testing ml model and i have decided to use ryzen 5600g with geforce 3060 . will i face any compatbility issues or not
why do you install visual studio C++ what's the reason
Thank you so much!!!!
You're welcome!
So this still works? I was worried that with the new version of tensorflow i need to use wsl2? this is what i saw on some other videos... but this tutorial looks more robust to me.
Yes it is still working, just make sure to download the exact same versions shown in the video and when you install tensorflow mention it's version since its updated.
Sir, why is it when i install the CUDA after clicking "Agree and continue" i got a warning that says "you already have a newer version of NVIDIA frameview sdk installed"? Can you provide me some solutions please?
solved! Just removed the frameview sdk on control panel
doesn't work in my. its rtx 3060
Yah mine too
If you’ve solved it tell me how
guys I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
mine is rtx 3060 as well, have you been able to solve?
@@CrewNDx are you getting an error?
i got false in the last part , what should i do now , to resolve it, i have a 3050 laptop gpu , windows 11 , and have installed cuda 12.2 , i dont know where the error is
how did you solved?
@@mini7fabero i tried installing , tensrflow-gpu by refering to the website and going line by line as said
note : make sure that if using anaconda prompt , it should be in c drive , rather than any other drive
i followed it but it is not working for me
I have installed cuda 11.8 and cudnn 8.1 and nothing works he is not seeing my GPU for some reason i don't know i tried everything please help
I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
Thx now I can play my favorite game 👍
Thank you for this video. It would have been great if you could have told us to refer the correct cudNN version according to tensorflow we had. I had to refer StackOverflow for that part. I could use my GPU in the end. Thanks a lot!
I'm having troubles with this part too. it automatically downloaded cuda 12.0.1 but I dont see a cuDNN that supports it
@@flowsolo same happen to me, did you find any solution?
@@akiladissanayaka5692 I unfortunately did not.. I went back to using my CPU :(
@@flowsolo Yes you have to install cuda 11.2
Didn't work for me. I think they changed it with Windows wsl.
Will this way work for geforce gtx 1650
Hi ; i want version tensorflow and keras appropriate to knime
As any version the knime is said not known
I do all in this Steps in properly but it will still show me false
I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
Is that visual studio part is essential pls tell anyone
Yes!
Bhai kahan tha ye video... itne din se try kar rha tha CUDA aur CuDNN install karne ka... finally it is working in my system
This also helps :)
thank you, but i do the same what u do in the video but in the last I have result =False
I did the same and got len(tf.config.list_physical_devices('GPU'))>0 =False as well ... did you figure out the problem? :(
@@bernadettmolnar6514 Hey even I am getting same problem did you figure out the solution.
guys I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
Total downloading and installation of vs code, c++ files, cuda, cudnn, etc - how much total disk space does it take?
Last time I tried installing when I realised that it's going to take 30GB+, mainly C++ files.
@@ankitmhaske3507 should be not more than 10gb
Thank you, it works for me!
Brrooooo i followed all the step also nvidia is there in my laptop still it's showing false😭😭😭😭😭😭😭
mine coming false :( need help
Well the vid was great upto the environment variable changes. Moved too fast and cant see what the end result should be. Even freezing video doesnt quite help. Maybe post the intended outcome please. Thanks
Bhai, can you please please make a similar video for WSL?
Yes, I would also like to see such a video.
Mine is showing false at the end
same here, is any further installation or setup needed?
guys I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
@@akashrai7102 ty bro , your way work for me
If still gpu is not showing do the following
In the newly created anaconda environment run:
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
The above code solved my issue
Hİ, i did all the operations but it gave a "ModuleNotFoundError: No module named 'tensorflow' " warning
good evening, were you able to solve the issue?
@@issafares7073 Yes, I finally solved the problem thanks
@@eminakamar6860 I'm currently facing the same problem. How did you solve it?
@@dragosstoica5921 try this(Note there are 2 underscores before and after "version"): print(tf.__version__)
@Dragos Stoica I have added CUDA file path repeatedly according to TensorFlow documentation
After following the video tutorial step by step when I get to the step of testing if tensorflow is using my gpu, the result I get is False. I got it to work by installing Python version 3.6 thanks to Akash Rai's comment. But I don't understand why it doesn't work. I did it installing the CUDA 11.8 and cuDNN 8.6 versions because they are the versions that it says in the tensorflow page that are compatible with tensorflow 2.12.0.
I was able to validate my gpu usage by installing python 3.10. What I did was that instead of using the command "pip install tensorflow" I used "pip install tensorflow==2.10.1". With that command you can install a specific version of tensorflow, in my case version 2.10.1 works for me.
I got a lil bit confused 😅. could you please elaborate what was the combination of CUDA, cuDNN, Python and TensorFlow versions that worked for you?
@@edwinj.rodriguezmarte2397 Yeah I am lost at what to do can you give the version of everything required
Why not choose installer type as exe(network)???
Thank you
You forgot to install tensorflow-gpu and instead used tensorflow (which is the CPU version)
In the latest version just installing tensorflow is enough, no need to mention tensorflow-gpu or -cpu
bro how to find CUDA compatible CUDNN Version for my laptop
en.wikipedia.org/wiki/CUDA
at last what i see is FALSE
I got the results after changing the python version to an old model like in my case I selected python=3.6 while creating a new environment
hi
I followed all the steps as in the video, but at the end I got this result @Bhavesh Bhatt
>>> import tensorflow as tf
>>> tf.__version__
'2.11.0'
>>> len(tf.config.list_physical_devices('GPU'))>0
False
Oh I did it..... By adding this line:
pip install tensorflow-gpu
@@mohsinfaurkh2646 where do i have to add this line?
@@tanzeelmohammed9157 After installing tensorflow. In the terminal/command prompt
@@mohsinfaurkh2646 i did the same but mine is showing errors
@@tanzeelmohammed9157 which error?
>>> len(tf.config.list_physical_devices('GPU'))>0
False
I am having this issue. Instead of returning "True" it's showing "False".
How to solve this anyone, please!
It Worked 😍🥹
Great!