{"id":316596,"date":"2021-01-19T15:00:26","date_gmt":"2021-01-19T15:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316596"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316596","title":{"rendered":"\u0415\u0441\u0442\u044c \u043b\u0438 \u0436\u0438\u0437\u043d\u044c \u0431\u0435\u0437 Nvidia? \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c TensorFlow \u043d\u0430 Radeon RX 580"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e1\/ad1\/a93\/3e1ad1a93378c391b660b3fd435de55d.png\" width=\"780\" height=\"440\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041d\u0430 \u043d\u043e\u0432\u043e\u043c \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u0435\u043d\u044f \u043f\u043e\u0441\u0430\u0434\u0438\u043b\u0438 \u0437\u0430 \u041f\u041a, \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c Ryzen 2600 \u0438 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u043e\u0439 Radeon RX 580. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u043e: \u0443\u0436 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0431\u044b\u043b \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432 \u044f \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u0445 Radeon: PlaidML \u0438 ROCm. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043e\u0431\u0430 \u0438 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438.<\/p>\n<h2>PlaidML: \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u043e \u0433\u043b\u0430\u0432\u0435 \u0443\u0433\u043b\u0430<\/h2>\n<p>TensorFlow \u0441\u043b\u0443\u0436\u0438\u0442 \u0431\u044d\u043a\u044d\u043d\u0434\u043e\u043c \u0434\u043b\u044f Keras, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u044f \u0435\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044f \u0435\u0433\u043e \u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0438\u043b\u0438 GPU. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 Nvidia CUDA.<\/p>\n<p>PlaidML &#8212; \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0431\u044d\u043a\u044d\u043d\u0434 \u0434\u043b\u044f Keras \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 OpenCL. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Keras \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 AMD. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Windows, Linux \u0438 Mac.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PlaidML \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c Python-\u043f\u0430\u043a\u0435\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0435:<\/p>\n<pre><code> pip install plaidml-keras &amp;&amp; plaidml-setup<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PlaidML \u043a\u0430\u043a \u0431\u044d\u043a\u044d\u043d\u0434\u0430:<\/p>\n<pre><code>os.environ[\"KERAS_BACKEND\"] = \"plaidml.keras.backend\"<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a:<\/p>\n<pre><code>plaidbench keras mobilenet<\/code><\/pre>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0435\u043e\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438. RX 580 \u0438 Ryzen 2600 \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u0437\u044f\u0442\u044b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<\/td>\n<td>\n<p>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p>\u0412\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>Radeon RX 580<\/p>\n<\/td>\n<td>\n<p>6.14s<\/p>\n<\/td>\n<td>\n<p>6.51s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>Radeon Vega Frontier Edition<\/p>\n<\/td>\n<td>\n<p>4.56s<\/p>\n<\/td>\n<td>\n<p>5.50s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>GeForce GTX 1080 TI<\/p>\n<\/td>\n<td>\n<p>2.52s<\/p>\n<\/td>\n<td>\n<p>4.83s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>Intel HD Graphics 5500<\/p>\n<\/td>\n<td>\n<p>36.64s<\/p>\n<\/td>\n<td>\n<p>755.23s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>AMD Ryzen 2600 (CPU)<\/p>\n<\/td>\n<td>\n<p>5.04s<\/p>\n<\/td>\n<td>\n<p>254.70s<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0438\u0434\u0435\u043e\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b AMD \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0435\u0431\u044f \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442 Nvidia. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0440\u0430\u0437\u0440\u044b\u0432 \u043c\u0435\u0436\u0434\u0443 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Intel HD Graphics: PlaidML \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442 Intel \u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<h2>ROCm: \u0421\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0440\u0430\u0442<\/h2>\n<p>\u0421\u043e \u0441\u0432\u043e\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 Radeon Open Compute Platform (ROCm), AMD  \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 GPU \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445. ROCm \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 NVIDIA CUDA. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 UNIX-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ROCm \u044f \u0432 \u0438\u0442\u043e\u0433\u0435 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f. \u041f\u043e \u043c\u043e\u0438\u043c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 ~2 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c PlaidML, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 PlaidML \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 Out Of Memory.<\/p>\n<p>\u042f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u0441\u0432\u0435\u0436\u0443\u044e Ubuntu 20.04 LTS. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 ROCm \u044f \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438: (\u043e\u043d\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0442.\u043a. \u043e\u043d\u0430 \u0443\u0441\u043f\u0435\u043b\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0442\u044c)<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043b \u043f\u0430\u043a\u0435\u0442\u044b:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt dist-upgrade &amp;&amp; sudo apt install libnuma-dev &amp;&amp; sudo reboot<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0430\u0442\u0438\u043b \u044f\u0434\u0440\u043e \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 5.8 \u0434\u043e 5.6. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0437\u0430\u0448\u0435\u043b \u043d\u0430 <a href=\"http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/\" rel=\"noopener noreferrer nofollow\">http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/<\/a> \u0438 \u0441\u043a\u0430\u0447\u0430\u043b \u0444\u0430\u0439\u043b\u044b: <\/p>\n<pre><code>linux-headers-VERSION-NUMBER_all.deb linux-headers-VERSION-NUMBER_amd64.deb linux-image-VERSION-NUMBER_amd64.deb linux-modules-VERSION-NUMBER_amd64.deb<\/code><\/pre>\n<\/li>\n<li>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b:<\/p>\n<pre><code>sudo dpkg -i *.deb<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u041f\u041a \u0441 \u044f\u0434\u0440\u043e\u043c 5.6, \u0432\u044b\u0431\u0440\u0430\u0432 \u0435\u0433\u043e \u0432 GRUB. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u043b \u044f\u0434\u0440\u043e 5.8:<\/p>\n<pre><code>sudo apt-get purge *5.8.0*<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u041f\u041a.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<pre><code>wget -q -O - https:\/\/repo.radeon.com\/rocm\/rocm.gpg.key | sudo apt-key add - echo 'deb [arch=amd64] https:\/\/repo.radeon.com\/rocm\/apt\/debian\/ xenial main' | sudo tee \/etc\/apt\/sources.list.d\/rocm.list<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b ROCm:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt install rocm-dkms &amp;&amp; sudo reboot<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043f\u0440\u0430\u0432\u0430:<\/p>\n<pre><code>sudo usermod -a -G video $LOGNAME sudo usermod -a -G render $LOGNAME<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043e\u0431\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0432\u044b\u0432\u0435\u0434\u0443\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 GPU:<\/p>\n<pre><code>\/opt\/rocm\/bin\/rocminfo \/opt\/rocm\/opencl\/bin\/clinfo<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b ROCm \u0432 PATH:<\/p>\n<pre><code>echo 'export PATH=$PATH:\/opt\/rocm\/bin:\/opt\/rocm\/rocprofiler\/bin:\/opt\/rocm\/opencl\/bin' | sudo tee -a \/etc\/profile.d\/rocm.sh<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>sudo apt install rocm-libs miopen-hip rccl<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b Pip \u0438 TensorFlow:<\/p>\n<pre><code>sudo apt install python3-pip pip3 install --user tensorflow-rocm<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e! \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e TensorFlow \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0439 GPU:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f0\/a90\/514\/4f0a905141529cc78a9c0bc65213332e.jpg\" width=\"1520\" height=\"1008\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438:<\/p>\n<pre><code>python3 .\/tf_cnn_benchmarks.py --num_gpus=1 --batch_size=64 --model=resnet50<\/code><\/pre>\n<p>RX 580 \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u0437\u044f\u0442\u044b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<\/td>\n<td>\n<p>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439\/\u0441\u0435\u043a (ResNet 50)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>AMD Radeon VII<\/p>\n<\/td>\n<td>\n<p>284<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>AMD Radeon RX Vega 56<\/p>\n<\/td>\n<td>\n<p>131<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>AMD Radeon RX 580<\/p>\n<\/td>\n<td>\n<p>92<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>Nvidia GeForce 2080 Ti<\/p>\n<\/td>\n<td>\n<p>293<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>Nvidia GeForce GTX 1070<\/p>\n<\/td>\n<td>\n<p>126<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>Nvidia GeForce RTX 3080 10GB<\/p>\n<\/td>\n<td>\n<p>396<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u0412 2021 \u0433\u043e\u0434\u0443 \u0432 \u0441\u0444\u0435\u0440\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u043c\u0435\u043d\u0435\u0435 \u0438 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a\u0430\u044f \u0443 \u0432\u0430\u0441 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430. \u0412\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b AMD \u0432\u0441\u0451 \u0435\u0449\u0451 \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u043e\u0442\u0441\u0442\u0430\u044e\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0435\u0432 \u0438\u0437 Nvidia, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438 \u0441\u0442\u043e\u044f\u0442 \u0434\u0435\u0448\u0435\u0432\u043b\u0435. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442 Radeon \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439, \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043b\u044f \u043d\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0434\u043e\u043b\u044c\u0448\u0435. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043e\u0442 AMD, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0451 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0443 Nvidia. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u0445 Radeon \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a ROCm. \u041e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c TensorFlow 2.2.0 \u0438 Keras. <\/p>\n<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/538138\/\"> https:\/\/habr.com\/ru\/post\/538138\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041d\u0430 \u043d\u043e\u0432\u043e\u043c \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u0435\u043d\u044f \u043f\u043e\u0441\u0430\u0434\u0438\u043b\u0438 \u0437\u0430 \u041f\u041a, \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c Ryzen 2600 \u0438 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u043e\u0439 Radeon RX 580. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u043e: \u0443\u0436 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0431\u044b\u043b \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432 \u044f \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u0445 Radeon: PlaidML \u0438 ROCm. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043e\u0431\u0430 \u0438 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438.<\/p>\n<h2>PlaidML: \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u043e \u0433\u043b\u0430\u0432\u0435 \u0443\u0433\u043b\u0430<\/h2>\n<p>TensorFlow \u0441\u043b\u0443\u0436\u0438\u0442 \u0431\u044d\u043a\u044d\u043d\u0434\u043e\u043c \u0434\u043b\u044f Keras, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u044f \u0435\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044f \u0435\u0433\u043e \u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0438\u043b\u0438 GPU. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 Nvidia CUDA.<\/p>\n<p>PlaidML &#8212; \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0431\u044d\u043a\u044d\u043d\u0434 \u0434\u043b\u044f Keras \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 OpenCL. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Keras \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 AMD. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Windows, Linux \u0438 Mac.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PlaidML \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c Python-\u043f\u0430\u043a\u0435\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0435:<\/p>\n<pre><code> pip install plaidml-keras &amp;&amp; plaidml-setup<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PlaidML \u043a\u0430\u043a \u0431\u044d\u043a\u044d\u043d\u0434\u0430:<\/p>\n<pre><code>os.environ[\"KERAS_BACKEND\"] = \"plaidml.keras.backend\"<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a:<\/p>\n<pre><code>plaidbench keras mobilenet<\/code><\/pre>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0435\u043e\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438. RX 580 \u0438 Ryzen 2600 \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u0437\u044f\u0442\u044b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<\/td>\n<td>\n<p>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p>\u0412\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>Radeon RX 580<\/p>\n<\/td>\n<td>\n<p>6.14s<\/p>\n<\/td>\n<td>\n<p>6.51s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>Radeon Vega Frontier Edition<\/p>\n<\/td>\n<td>\n<p>4.56s<\/p>\n<\/td>\n<td>\n<p>5.50s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>GeForce GTX 1080 TI<\/p>\n<\/td>\n<td>\n<p>2.52s<\/p>\n<\/td>\n<td>\n<p>4.83s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>Intel HD Graphics 5500<\/p>\n<\/td>\n<td>\n<p>36.64s<\/p>\n<\/td>\n<td>\n<p>755.23s<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"246\" width=\"246\">\n<p>AMD Ryzen 2600 (CPU)<\/p>\n<\/td>\n<td>\n<p>5.04s<\/p>\n<\/td>\n<td>\n<p>254.70s<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0438\u0434\u0435\u043e\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b AMD \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0435\u0431\u044f \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442 Nvidia. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0440\u0430\u0437\u0440\u044b\u0432 \u043c\u0435\u0436\u0434\u0443 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Intel HD Graphics: PlaidML \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442 Intel \u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<h2>ROCm: \u0421\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0440\u0430\u0442<\/h2>\n<p>\u0421\u043e \u0441\u0432\u043e\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 Radeon Open Compute Platform (ROCm), AMD  \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 GPU \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445. ROCm \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 NVIDIA CUDA. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 UNIX-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ROCm \u044f \u0432 \u0438\u0442\u043e\u0433\u0435 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f. \u041f\u043e \u043c\u043e\u0438\u043c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 ~2 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c PlaidML, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 PlaidML \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 Out Of Memory.<\/p>\n<p>\u042f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u0441\u0432\u0435\u0436\u0443\u044e Ubuntu 20.04 LTS. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 ROCm \u044f \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438: (\u043e\u043d\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0442.\u043a. \u043e\u043d\u0430 \u0443\u0441\u043f\u0435\u043b\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0442\u044c)<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043b \u043f\u0430\u043a\u0435\u0442\u044b:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt dist-upgrade &amp;&amp; sudo apt install libnuma-dev &amp;&amp; sudo reboot<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0430\u0442\u0438\u043b \u044f\u0434\u0440\u043e \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 5.8 \u0434\u043e 5.6. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0437\u0430\u0448\u0435\u043b \u043d\u0430 <a href=\"http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/\" rel=\"noopener noreferrer nofollow\">http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/<\/a> \u0438 \u0441\u043a\u0430\u0447\u0430\u043b \u0444\u0430\u0439\u043b\u044b: <\/p>\n<pre><code>linux-headers-VERSION-NUMBER_all.deb linux-headers-VERSION-NUMBER_amd64.deb linux-image-VERSION-NUMBER_amd64.deb linux-modules-VERSION-NUMBER_amd64.deb<\/code><\/pre>\n<\/li>\n<li>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b:<\/p>\n<pre><code>sudo dpkg -i *.deb<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u041f\u041a \u0441 \u044f\u0434\u0440\u043e\u043c 5.6, \u0432\u044b\u0431\u0440\u0430\u0432 \u0435\u0433\u043e \u0432 GRUB. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u043b \u044f\u0434\u0440\u043e 5.8:<\/p>\n<pre><code>sudo apt-get purge *5.8.0*<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u041f\u041a.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<pre><code>wget -q -O - https:\/\/repo.radeon.com\/rocm\/rocm.gpg.key | sudo apt-key add - echo 'deb [arch=amd64] https:\/\/repo.radeon.com\/rocm\/apt\/debian\/ xenial main' | sudo tee \/etc\/apt\/sources.list.d\/rocm.list<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b ROCm:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt install rocm-dkms &amp;&amp; sudo reboot<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043f\u0440\u0430\u0432\u0430:<\/p>\n<pre><code>sudo usermod -a -G video $LOGNAME sudo usermod -a -G render $LOGNAME<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043e\u0431\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0432\u044b\u0432\u0435\u0434\u0443\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 GPU:<\/p>\n<pre><code>\/opt\/rocm\/bin\/rocminfo \/opt\/rocm\/opencl\/bin\/clinfo<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b ROCm \u0432 PATH:<\/p>\n<pre><code>echo 'export PATH=$PATH:\/opt\/rocm\/bin:\/opt\/rocm\/rocprofiler\/bin:\/opt\/rocm\/opencl\/bin' | sudo tee -a \/etc\/profile.d\/rocm.sh<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>sudo apt install rocm-libs miopen-hip rccl<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b Pip \u0438 TensorFlow:<\/p>\n<pre><code>sudo apt install python3-pip pip3 install --user tensorflow-rocm<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e! \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e TensorFlow \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0439 GPU:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438:<\/p>\n<pre><code>python3 .\/tf_cnn_benchmarks.py --num_gpus=1 --batch_size=64 --model=resnet50<\/code><\/pre>\n<p>RX 580 \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u0437\u044f\u0442\u044b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<\/td>\n<td>\n<p>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439\/\u0441\u0435\u043a (ResNet 50)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>AMD Radeon VII<\/p>\n<\/td>\n<td>\n<p>284<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>AMD Radeon RX Vega 56<\/p>\n<\/td>\n<td>\n<p>131<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>AMD Radeon RX 580<\/p>\n<\/td>\n<td>\n<p>92<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>Nvidia GeForce 2080 Ti<\/p>\n<\/td>\n<td>\n<p>293<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>Nvidia GeForce GTX 1070<\/p>\n<\/td>\n<td>\n<p>126<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p>Nvidia GeForce RTX 3080 10GB<\/p>\n<\/td>\n<td>\n<p>396<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u0412 2021 \u0433\u043e\u0434\u0443 \u0432 \u0441\u0444\u0435\u0440\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u043c\u0435\u043d\u0435\u0435 \u0438 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a\u0430\u044f \u0443 \u0432\u0430\u0441 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430. \u0412\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b AMD \u0432\u0441\u0451 \u0435\u0449\u0451 \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u043e\u0442\u0441\u0442\u0430\u044e\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0435\u0432 \u0438\u0437 Nvidia, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438 \u0441\u0442\u043e\u044f\u0442 \u0434\u0435\u0448\u0435\u0432\u043b\u0435. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442 Radeon \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439, \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043b\u044f \u043d\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0434\u043e\u043b\u044c\u0448\u0435. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043e\u0442 AMD, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0451 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0443 Nvidia. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u0445 Radeon \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a ROCm. \u041e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c TensorFlow 2.2.0 \u0438 Keras. <\/p>\n<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/538138\/\"> https:\/\/habr.com\/ru\/post\/538138\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-316596","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316596"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316596\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}