<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anik Biswas on Medium]]></title>
        <description><![CDATA[Stories by Anik Biswas on Medium]]></description>
        <link>https://medium.com/@aniklogu?source=rss-fa2849bea7b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7-qQVzHNQYQbwQNIv6XBsQ.png</url>
            <title>Stories by Anik Biswas on Medium</title>
            <link>https://medium.com/@aniklogu?source=rss-fa2849bea7b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:53:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aniklogu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Complete guide to setup TensorFlow GPU in Ubuntu 22.04/21.10]]></title>
            <link>https://medium.com/@aniklogu/complete-guide-to-setup-tensorflow-gpu-in-ubuntu-21-10-266000edf65e?source=rss-fa2849bea7b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/266000edf65e</guid>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ubuntu-21-10]]></category>
            <category><![CDATA[cuda]]></category>
            <dc:creator><![CDATA[Anik Biswas]]></dc:creator>
            <pubDate>Tue, 08 Mar 2022 10:23:15 GMT</pubDate>
            <atom:updated>2022-04-23T11:13:35.423Z</atom:updated>
            <content:encoded><![CDATA[<h3>Complete guide to setup TensorFlow GPU in Ubuntu 22.04/21.10 with CUDA Toolkit, cuDNN and Anaconda installation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GW35cJ_QGzBSBXBNiPRW-Q.png" /></figure><p>Recently, I upgraded to Ubuntu 22.04 from Ubuntu 21.10 as my base OS.The steps written in this article were performed in Ubuntu 21.10 but the same should work on Ubuntu 22.04 as well. Although, of late I am primarily using Colab for most of my DL training works, I wanted to make my Nvidia GTX 1050 Ti GPU usable for TensorFlow trainings ,to be performed in the local machine. However, while setting up TensorFlow GPU in the Ubuntu 21.10 environment, I found that it can get quite tricky and error-prone if the correct sequence of instructions are not followed. Therefore, I made a compilation of instructions in this article which , if followed in correct order should make the process of tensorflow setup hassle-free.</p><p><strong>Remove existing Packages</strong></p><p>Uninstall /Remove existing versions of Anaconda, Nvidia Drivers and CUDA. Also delete the folders containing any files related to these packages. I assume Python is already installed in the system. It’s advisable to use Python 3.9 since it is latest and compatible in the Anaconda platform.</p><p><strong>Install Nvidia Drivers via Ubuntu Additional Drivers</strong></p><p>Install Nvidia Driver using GUI feature from Ubuntu. Go to ‘<strong>Software and Updates</strong>’ from Application Menu and each ‘<strong>Additional Drivers’</strong>. If present, relevant Nvidia GPU Driver would show up. I used Nvidia Driver 510 which was the recommended driver for my system. Click on ‘<strong>Apply Changes</strong>’. Restart the system for the changes to take effect. Once installed, we will be able to verify installation with the following command:</p><p>nvidia-smi</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*n34hHVaGB1oYSEWyiRt-SQ.png" /></figure><p><strong>Install the CUDA Toolkit 11.6</strong></p><p>The CUDA 11.6 Toolkit installation run file can be downloaded from the Nvidia offcial link <a href="https://developer.nvidia.com/cuda-downloads">here</a>.</p><p>Run the installer file in a local terminal:</p><p><em>./cuda_11.6.1_510.47.03_linux.run</em></p><p>Accept the license agreement and in the installer prompt select all the options except the Nvidia Driver (510.47.03 in my case).</p><p>CUDA should be installed in the local path usr/local by this time. Add the following lines in the ~/.bashrc file :</p><p><em>export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}}</em></p><p><em>export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH</em></p><p><em>export LD_LIBRARY_PATH=/usr/local/cuda-11.6/include:$LD_LIBRARY_PATH</em></p><p>Source the bashrc file with the command</p><p><em>source ~/.bashrc</em></p><p><em>You can verify the CUDA toolkit installation with the following commands:</em></p><p>nvcc -version</p><p><em>If everything is installed properly, we would see an output like this :</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*xaczMagMf4MaF-tZ-dUpGg.png" /></figure><p><strong>Install CUDNN 8.3</strong></p><p>Before proceeding with cuDNN, install zlib library for data compression :</p><pre><em>sudo apt-get install zlib1g</em></pre><p>Download the cuDNN 8.3 from <a href="https://developer.nvidia.com/rdp/cudnn-download">here</a>. In order to download, you need to have one Nvidia developers account.</p><p>Unzip the cuDNN package</p><p><em>tar -xvf cudnn-linux-x86_64–8.3.2.44_cuda11.5-archive.tar.xz</em></p><p>From the extracted folder copy the following files into the installed CUDA folder:</p><pre>$ sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda/include <br><br>$ sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda/lib64 <br><br>$ sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*</pre><p><strong>Install Anaconda</strong></p><p>Download the Anaconda Individual edition from this <a href="https://www.anaconda.com/products/individual">link</a>.</p><p>Open a local terminal from the download location.In recent Ubuntu releases, /bin/sh is actually dash, which doesn&#39;t support the [[ bash-ism. Running the shell gave me some errors in installation. For this reason, we will install zsh which is bash-compatible.</p><p><em>sudo apt install zsh</em></p><p><em>zsh Anaconda3–2021.11-Linux-x86_64.sh</em></p><p>Follow the interactive installation guide to finish the installation.</p><p><strong>Install TensorFlow GPU</strong></p><p>Create a TensorFlow GPU in conda environment.</p><p><em>conda create -n tf-gpu tensorflow-gpu</em></p><p>Activate the GPU</p><p><em>conda activate tf-gpu</em></p><p><strong>Import TensorFlow and verify GPU detection</strong></p><p>Go to python :</p><p><em>python</em></p><p>&gt;&gt;import Tensorflow</p><p>&gt;&gt;import tensorflow as tf</p><p>Check GPU status</p><pre><em>&gt;&gt;&gt; print(&quot;Num GPUs Available: &quot;, len(tf.config.list_physical_devices(&#39;GPU&#39;)))</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*w6EUYI1zrOKbQQ3SYzxAoQ.png" /></figure><p>You can connect with me through <a href="http://www.linkedin.com/in/anik26">linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=266000edf65e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>