{"id":1059,"date":"2020-01-17T01:08:25","date_gmt":"2020-01-16T16:08:25","guid":{"rendered":"https:\/\/ahnbk.com\/?p=1059"},"modified":"2020-01-21T14:43:03","modified_gmt":"2020-01-21T05:43:03","slug":"install-tensorflow-with-gpu-support","status":"publish","type":"post","link":"https:\/\/ahnbk.com\/?p=1059","title":{"rendered":"Install Tensorflow with GPU support"},"content":{"rendered":"\n<p>Reference: <a href=\"https:\/\/www.tensorflow.org\/install\/gpu\">https:\/\/www.tensorflow.org\/install\/gpu<\/a><\/p>\n\n\n\n<ul><li>Install CUDA 10.1 with GPU Driver<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/ubuntu1804\/x86_64\/cuda-repo-ubuntu1804_10.2.89-1_amd64.deb\n$ sudo dpkg -i cuda-repo-ubuntu1804_10.1.243-1_amd64.deb\n$ sudo apt-key adv --fetch-keys https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/ubuntu1804\/x86_64\/7fa2af80.pub\n$ sudo apt-get update\n$ wget http:\/\/developer.download.nvidia.com\/compute\/machine-learning\/repos\/ubuntu1804\/x86_64\/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb\n$ sudo apt install .\/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb\n$ sudo apt-get update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install cuda\n$ sudo apt install cuda-10-1<\/code><\/pre>\n\n\n\n<ul><li>Install cuDNN<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install libcudnn7-dev<\/code><\/pre>\n\n\n\n<ul><li>Install  TensorRT<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install libnvinfer-dev=6.0.1-1+cuda10.1 libnvinfer6=6.0.1-1+cuda10.1 libnvinfer-plugin6=6.0.1-1+cuda10.1<\/code><\/pre>\n\n\n\n<ul><li>Install python3-pip and update<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install python3-pip\n$ sudo pip3 install -U pip<\/code><\/pre>\n\n\n\n<ul><li>Install Tensorflow<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo pip3 install -U tensorflow-gpu\n$ sudo pip3 install -U launchpadlib<\/code><\/pre>\n\n\n\n<p>Check the installation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ python3\nPython 3.6.9 (default, Nov  7 2019, 10:44:02)                                                                                                                                                                                         \n[GCC 8.3.0] on linux                                                                                                                                                                                                                  \nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.                                                                                                                                                                \n>>> import tensorflow as tf                                                                                                                                                                                                           \n2020-01-17 00:54:07.956548: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libnvinfer.so.6                                                                                       \n2020-01-17 00:54:07.957808: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libnvinfer_plugin.so.6\n>>>\n>>> tf.config.list_physical_devices('GPU')\n2020-01-17 01:06:54.209819: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1\n2020-01-17 01:06:54.244560: I tensorflow\/stream_executor\/cuda\/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2020-01-17 01:06:54.244971: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1555] Found device 0 with properties: \npciBusID: 0000:68:00.0 name: GeForce RTX 2080 Ti computeCapability: 7.5\ncoreClock: 1.545GHz coreCount: 68 deviceMemorySize: 10.76GiB deviceMemoryBandwidth: 573.69GiB\/s\n2020-01-17 01:06:54.245001: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1\n2020-01-17 01:06:54.245027: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10\n2020-01-17 01:06:54.246771: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10\n2020-01-17 01:06:54.247101: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10\n2020-01-17 01:06:54.248591: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10\n2020-01-17 01:06:54.249448: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10\n2020-01-17 01:06:54.249496: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n2020-01-17 01:06:54.249579: I tensorflow\/stream_executor\/cuda\/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2020-01-17 01:06:54.249978: I tensorflow\/stream_executor\/cuda\/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2020-01-17 01:06:54.250314: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1697] Adding visible gpu devices: 0\n[PhysicalDevice(name='\/physical_device:GPU:0', device_type='GPU')]\n<\/code><\/pre>\n\n\n\n<p>Done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reference: https:\/\/www.tensorflow.org\/install\/gpu Install CUDA 10.1 with GPU Driver Install cuDNN Install TensorRT Install python3-pip and update Install Tensorflow Check the installation Done.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[258],"tags":[20,260,150,259],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXSW-h5","jetpack-related-posts":[],"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1059"}],"collection":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1059"}],"version-history":[{"count":2,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}