Tutorial 33- Installing Cuda Toolkit And cuDNN For Deep Learning

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
no.1 my name is Krishna ham welcome to my youtube channel so guys as I told you that I recently bought a laptop which has you know GT x165 0 GD u so I wanted to show you how we can actually quickly install CUDA and couldn't see QD n n that is Nvidia CUDA deep neural network library and this is pretty much important because if you want to use that particular GPU that is GD x165 0 and actually you know run some of the deep learning programs in this definitely this will be helpful so that particular processor I tell you that how you should go ahead installing CUDA and see you DNA okay so this deep neural network library first of all understand that in media of GT x165 0 is basically of Nvidia right and if you only utilize that this CUDA libraries have been created for that you know so that and this all and C++ binding C++ code or usual for which will actually require so the first step that we should actually do is that download CUDA you know good our toolkit and there are various versions of CUDA toolkit like that they are something like version 9 and recent one is 10.2 I started trying with the CUDA toolkit 9 I explored in the internet which is compatible to 1 6 5 0 and when I did with khun danai it did not work out because it was not compatible ok so you have to actually check which Buddha toolkit is actually compatible then after that I went and saw for CUDA will get 9 now put a toolkit 9 sorry CUDA to get 10 the next version that I actually checked was CUDA build it there so I try to check with data nodes it started working you know first of all if you have 1 6 5 0 okay then you can go ahead with Buddha toolkit 10.0 if not you can also work with Buddhahood tip 9 ok if you don't have 1 6 5 0 if you have the below version of that particular GPU so first of all you go and download CUDA toolkit so here I've actually rated Buddha toolkit 10 download so this is the recent one and point two and you get click on Buddha toolkit 10.0 you'll be able to get this kind of page ok and first of all Adams just going to show you with respect to tensorflow and then I also show you an option how to download this CUDA toolkit with the help of my torch also in pythons it is pretty much easy you don't have to do much but in for tents applause and chaos you need to work a little bit harder than okay so first of all I'll just select the operating system this is my c64 I'll just click on this and you just download this Exe local ok so once you download this Exe local it will get installed in the local it I mean in the in your download the download folder itself so once this get installed you know when when you're doing this particular installation there is like to put in 1 GB file ok if you have a faster internet just download this particular file over here and once you the that particular file is actually downloaded you will be able to see that particular file like this ok so here is the particular file that you have so this is the first thing that you have to do or download this particular version so I've just written as download CUDA to it ok so I've done that already now the next thing is that we have to go and download see you did the nvidia cuda deep deep neural network library now what this is this is a GPU accelerated library of opportunities for deep learning deep neural networks it provides high highly tuned implementation of standard routine such as forward and backward backward composition rule in normalization and activation layer now this the most interesting thing is that this works is various framework like cafe cafe - china garage matte black man's net pencil oh my gosh so lot of libraries it actually works with so what you have to do is that just go over here since you are downloaded CUDA toolkit 10 you just click on this CUDA download CD nn we also need to have an account ok you also need to have enough um I'm just going to login into this particular account so you can log in log in with your own account you can create an account for this so I'll just go and click on create an account and quickly create this particular account and start downloading it ok um okay so I'm just going logging in to this particular current it will just take an two minutes okay so then I click on I agree okay once the login is done what you have to do next thing is that since you are downloaded CUDA toolkit 10.0 just click on Co DNN for CUDA 10.0 then you select for windows you select this if you have Windows 7 you select this and if you have open to o exits you can actually select this I had actually windows I I am going to select in your I'll select this itself so after selecting again in the download section this will get installed we will be getting a zip file ok so this is the zip file that you will be getting ok now after getting this zip file what you do is that you extract it over here so this is the extracted library all you do is that you just copy this ok just copy this go to your C Drive ok and just paste it over here the reason why we are doing this is that we have to set this particular path in our environment variable so because of this I have to actually I'm just pasting this inside my C Drive so here I've pasted over here you can see my three folders I have been include lip and all this particular folders are here the next thing that you have to do is that you have to go to your environment variable and just show you or you have the first of all goal in your environment variable ok now in the environment variable what you have to do go into the system variables over here inside the system variables you will be able to see something on a spot ok so click on this particular path see after installing tool get automatically this particular bin folder will get added the only thing that you have to do is that this Co DNN whatever zip file you have downloaded how many folders are actually present inside this all this particular folder Parton's should be put on my way so here you can see I have put down first of my bin path this is my route path and library x64 path ok so here all this particular folders path I am actually given the path itself over there so that it can actually access this particular library ok so this is done this is all steps are done one final thing that you have to do is that install visual studio community version ok so what you have to do is there just go and select for we usual studio 2007 in community okay so Visual Studio is actually required with us from this we will be taking all the C++ basic libraries that are required okay so once you are just just click over here you'll be able to see the different different versions for 2017 also so okay here 2017 is not coming let's see okay we need to search for it again so 2017 here we go sofie's Visual Studio 2017 you have to download it or I'll just give you the path also is possible for older downloads for fish not still want an older version so you select or 2017 click on downloads you'll automatically get that Exe file again the exe file will look something like this you can see that I have downloaded this 2017 okay you'll be then just to go and install this so again remember this as I told you the first step is actually download the toolkit and the version I will be writing it out who here has to 10.0 and install it okay after installing download the download then see you DNN library for the same version or the same version okay the first step what we are going to do is that quickly okay the third step what we are actually going to do is that set the path is measurement variable set the path in the environment variable okay and the fourth step that we are going to do is that download Visual Studio community 2015 okay and from there you just have to select all the c++ libraries and just show you how all you have to go ahead with so just double click this you will be getting like this just click on continue it will just such a files now after clicking the visual studio Exe two to three minutes you'll be able to see this kind of window so make sure that everything related to C++ needs to be downloaded for Windows okay so game development + C + its you can select you can also select if you want this to mobile development phone it for game development also mobile development you have to select you have to select desktop application with C++ because these are the basic C++ libraries that are required so if you select this you will be able to do you know all the dependencies that are required it can be done and again guys this will take time we do not happen that fast because the total space that is required is 14 point 7 g7 2 GB ok so it's a huge file all together installing will probably take at least half an hour like that so you do the installation process I have already done it so I'm just going to close it now after installing Visual Studio which I have again written over here download everything related to C++ what I am going to do the first step you know and I'm going to you know first of all I hope you have the Hannah ponder environment that is compulsory over there you need to have Eisen over there it says normally try to create an environment so create an environment ok first will try to create an environment and then install the tensorflow GPU so this particular library will try to install and then we'll try to test whether the GPU has been initialized or not whether my code is being able to reach that particular GPU or not and then I will try to also run a sample code and show it to you how it is actually that now first of all I'll just go and open my anaconda ground ok so what I'm going to do is that under from so we will just search for the environment over here so we'll search that how to create a fight in a pond a create new environment so I'll just write it as on down and create new environment python 3.6 and make sure that days you will select python 3.6 because that is where the tensorflow is quite stable ok so make sure that you create three-punch its environment itself so I'm just going to select this one decree 8 - n my env Python 3.6 so I'm going to go over here paste it over here right and I'm just going to give my environment name okay something like GPU test okay so that I will be able to test this thing now I'll just press Enter the installation - should take place very quickly okay for creating the new environment I think it will be taking not take much time then what I have to do is that every right corner activate you know or corn activate GPU test okay so once I do it it is inside GPU test now after that I'll clear the screen now after clearing the screen guys one thing that you have to make sure is that we have to install click install tensorflow tensorflow - GPU and you can also suggest the path like to point zero point two to zero I will be installing this you also have something like one-point 1.4 1.1 4.0 so two versions you have both will be working I'm going to take just the recent version and try to install it okay it says that invalid requirement uh-oh I have to just basically use double equal to yep make sure that you use double equal to and automatically the installation will happen you'll be able to see that well while the installation is a actually taking place you know although all the information that we have put in the system environment variables it will be reading from there itself so this probably is true for 85.3 m b so anyhow we'll wait for some time and this installation will take place okay now the installation has taken place you can see that all the installation are there now how to actually check whether the installation has happened or not just go and execute this particular command and see whether you are able to import tensorflow or not so what I'm going to do is that I am just going to write it as Phi v go inside this and I'm going to say import tensorflow right and I'm going to press shift enter now you will be able to see that whether the initialization is being happening with respect to the GPUs or not through this particular command and will be able verifying whether our tensorflow library that is our GPS basically book so if you get this kind of message where it says successfully open dynamic library cuda heart 64 in the SKU 100.0 because this is the dll which we are actually trying to run over here um I just show it to you in the C Drive so here you can see that this is the this is the file this is the dealer that we will be running which will be actually you know communicating with the CUDA with the GTX 165 zero so that is what it actually says and so once we have done this what we'll do is that will quickly try to run the command run our program and see whether it is running or not and if you really want to see whether the GPU is getting initialization or not what you do is that just try to execute these three commands together instead of a cert no you just write it as print okay what I'm going to do is that over here and we're going to write it as print print this and here all I'm just going to write a spring okay so once this is done and just copy this I just write it as Python over here and just paste it so CUDA library is done you can see that when I did print TF dot dash dot is underscore GP one is available it is seeing all this particular information you can see that your CPU supports the instruction that is transitory voice was compiled to use a BX true in media and CUDA or DLL you can see your information of the GPUs over here let me just make it more bigger you can see that Geoforce JT x165 zero major this is the clock read/write created tensorflow device physical device this and finally whether it is built with CUDA or not you are getting approval ok so this basically confirms that the installation has happened very correctly now one thing what I am going to do is then I'm going to also show the ISO have written CNN which is actually training 8000 images so I'll just show you that and then we can actually proceed and see that how big it happens ok guys so now we try to run a sample CNN program where I have over here my data set actually has somewhere around 8,000 cat dogs images so first of all I am going to go to this particular working directory and this particular program actually use chaos so what we are going to do is that quickly install chaos so and say it has pip install chaos and remember this chaos will all gain me interacting with tensorflow - GPU so the GPU that we have the library the poodle address that we are actually installed so it will be communicating to this I did take some time yes the installation has happened perfectly and correctly now the next thing that I'm going to do is that I'm just going to write Python or CN n dot py this is the file that will be right doing it you know and this will probably take some amount of time to execute but see the execution will be quite faster ok one more error that we are getting about below so again I'm going to say 5th install below to be installed below we are going to say and this is also get installed you just again going to clear the screen and quickly run the CNN not be one now you can see away all the information CUDA libraries food or dll's is been hinting this and you can see how fast the execution is actually happening so what we will do is that and probably this is because I have in my code you can see that I have made it as 8000 in box and printer sorry 8000 steps for a box and there 2425 a box like that to get a better accuracy so this is the code altogether you can write any any combination you know network code it'll be working fine okay so probably this will take around 30 to 40 minutes because they are 8,000 minutes and again GPUs this is not super fast GPUs like T 5000 be 4000 like that or Titan versions of GPUs but it is a this GTX there lot of you know a voice coming from a laptop right now because it is processing very quickly you can see that how steps for epochs are being calculated quickly and how the loss and accuracy is basically dipping increased what I am going to do is that I am just going to fast forward it to 30 to 45 minutes and wait till this particular execution is done and will try to show it to you how the accuracy I have actually got okay so yes we'll continue the session now you can see over you guys it probably you know it ran till here we were able to get a 99% of accuracy and the overall time it took was somewhere around you know 42 minutes exactly um and again guys this did not just had 8,000 images these not 10,000 images okay so I feel that because the same thing if you try to execute into your Mac um it probably took once 2 hours so for me to execute it but now I can see the difference the execution is quite fast and yes this was a sample thing ok so what I have done is that create an installer environment install tensorflow GPU then you can work this with curraghs install chaos and on ok so in shorty we were able to quickly do all this particular stuff and you know this is how this CUDA toolkit and Cu DNA library are actually installed always the main problem that I faced was the compatibility issue with respect to the GTS then this total odd when I was starting installing it you know it took me somewhere on one and a half hours to understand how the things work I've already done this kind of work so it was pretty much easy for me for you it may you may face kind of problems but I hope you'll be able to do it okay so yes this was all about this particular video I hope you liked it please do subscribe the channel if you're not already subscribe I'll see you in the next video have a great day thank you one and all bye bye
Info
Channel: Krish Naik
Views: 161,591
Rating: undefined out of 5
Keywords: cuda toolkit, machine learning, deep learning, cuDNN library, tensorflow gpu
Id: StH5YNrY0mE
Channel Id: undefined
Length: 19min 30sec (1170 seconds)
Published: Sun Mar 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.