<jupyter_start><jupyter_text>My CUDA installing instructions for Windows In this notebook I will show how I have managed to get CUDA working on my device ( you might need to download different version of the packages based on the GPU you have) I already had the latest version of [Anaconda](https://www.anaconda.com/products/individual) installed, so I am not going to go through that, but if you are installing it make sure you **check the option to add Anaconda to the PATH environment variable** and run the **conda init** into your terminal with the right option accorindg to your type of terminal [bash, powershell, command prompt]  CUDA Before installing CUDA is highly recommended/essential to install [Visual Studio Community Edition](https://visualstudio.microsoft.com/downloads/) (Not Visual Studio Code). It is not required to install any other additional workload/packages if you are not planning to use Visual Studio as your main IDE. My GPU is an Nvidia RTX 3090 and this enabled me to install the latest version of [CUDA toolkit 11.3](https://developer.nvidia.com/cuda-downloads), however, as mentioned before, you need to check the architecture your GPU is based on and download the CUDA toolkit version acording to that. You can find here in the [CUDA Toolkit Archive](https://developer.nvidia.com/cuda-toolkit-archive) all the CUDA relsease After installing CUDA, we need to install cuDNN>NVIDIA CUDA Deep Neural Network (cuDNN) is a GPU-accelerated library of primitives for deep neural networks. It provides highly tuned implementations of routines arising frequently in DNN applications.Annoyingly, you have to create an Nvidia account if you want to download it from the [official website](https://developer.nvidia.com/rdp/cudnn-download)Moving forward, after the cuDNN is downloaded, we can extract the files and folders from the archive so that we can have a folder called `tools` and add all the extracted files in there so the bin folder would have the next path```C:\tools\cuda\bin``` Then, we have to add this `C:\tools\cuda\bin` to the System PATH environment variable in windows.Follow this steps if you have not added the path to the bin folder to the environment.- Hit windows Key- Search for `Environment variables` then click Environment Variables on the window that have openend- In the System Variables find the PATH variable and Hit Edit- Then hit new in the new window that have openend and paste the path to the bin folder `C:\tools\cuda\bin` Now you will have to reboot your PC, and hopefully all going to work just fine  Tensorflow Now we can create a new environment for tensorflow and pip install tensorflow ```bashconda create --name tf2 python=3.8conda activate tf2pip install tf-nightly-gpu``` Then for the testing purpose<jupyter_code>import tensorflow as tf
print(tf.test.is_built_with_cuda())
assert tf.test.is_built_with_cuda()
with tf.device('/GPU:0'):
    a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
    b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
    c = tf.matmul(a, b)
c
sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True))
tf.test.gpu_device_name()<jupyter_output><empty_output><jupyter_text>Pytorch ```bashconda create --name ptorch python=3.8conda activate ptorchconda install pytorch -c conda-forge -c pytorch``` Again let's test it<jupyter_code>import torch
torch.cuda.is_available()
torch.cuda.get_device_name(device=None)
torch.cuda.current_device()
torch.cuda.device_count()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0789769533445756, 'fraction_numerical': 0.012366498032602586, 'mean_word_length': 5.011824324324325, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '54420', 'license': 'RSA-MD', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1001, 'n_words': 469, 'path': 'notebooks/2021-04-17-CUDA-Install-Commands.ipynb', 'repo_name': 'cristianexer/trainings-and-tutorials', 'size': '3558'}