{"id":336221,"date":"2022-07-27T03:00:13","date_gmt":"2022-07-27T03:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336221"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336221","title":{"rendered":"<span>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Java ML \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 Spring, Docker, Spark, Rapids, CUDA<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GPU nVidia \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 CUDA \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445. \u0426\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Big Data Tool Apache Spark \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0430\u043a\u0441\u0435\u043b\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c GPU \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 Rapids \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 nVidia CUDA, \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a DJL, Spark ML, XGBoost, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Spring Boot \u043d\u0430 Java 8 (\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 Rapids), \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u041e\u0421 Windows 10 Pro \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0422\u0435 \u0436\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Kubernetes.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f &#8212; \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u041e\u0421 Windows 10 Pro. \u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WSL2 (Linux Subsystem for Windows), \u043d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 &#8212; <a href=\"https:\/\/github.com\/rapidsai\/cudf\/issues\/9427\" rel=\"noopener noreferrer nofollow\">\u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Rapids \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Pascal<\/a>, \u0442.\u0435. \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432 \u0441\u0440\u0435\u0434\u0435 Windows \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 nVidia \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Turing (\u0441\u0435\u0440\u0438\u0438 1600, 2000) \u0438 \u0432\u044b\u0448\u0435. \u041f\u043e\u0434 OC Linux \u043a\u0430\u0440\u0442\u044b \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Pascal \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0443\u0442, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435 \u043d\u0430 Ubuntu 20.04 (\u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430, Debian 10 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c), \u043d\u043e \u043d\u0435 \u0432\u044b\u0448\u0435 &#8212; <a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/download.html\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 Rapids<\/a>.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 Java. \u0412 \u043c\u0438\u0440\u0435 Spark (\u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e Spark ML) \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Scala. Scala \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u0438 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u0442, \u0430 \u0432\u043e\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c Spark \u0438 ML \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430 \u0437\u0430\u0434\u0430\u0447 \u0438\u043c\u0435\u0435\u0442\u0441\u044f. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e Scala \u0438 Java \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b \u0432 \u0441\u0440\u0435\u0434\u0435 Spark, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 Python, \u0438 \u0447\u0442\u043e \u043d\u0430 Java \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u044f\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a ML, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441\u043e Spark, \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0441\u0435\u0431\u044f \u0436\u0434\u0430\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u043d\u0430 Windows 10 Pro, GeForce RTX 2060 \u0438 1080 Ti (\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430 Windows \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e), \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 \u043a\u0430\u0440\u0442\u043e\u0439 GeForce 1650. \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u044f\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0432\u0441\u0435 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 Ubuntu 20.04, \u043e\u0442\u0432\u0435\u0447\u0430\u044e: \u0430) \u0442\u0430\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442, \u0432\u044b \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435; \u0431) \u043d\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (Cloud \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 GPU).<\/p>\n<p>\u0426\u0435\u043b\u0435\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/941\/aaa\/a0c\/941aaaa0cd251cf631bc5ae36c410571.png\" width=\"1044\" height=\"957\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/941\/aaa\/a0c\/941aaaa0cd251cf631bc5ae36c410571.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422.\u0435. \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0432\u0443\u0445 \u0434\u043e n \u043d\u043e\u0434, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442 1 \u0434\u043e m GPU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, docker runtime \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c Spark worker, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b GPU.<\/p>\n<p>Hardware \u0438 software \u0441\u043b\u043e\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0445\u0435\u043c\u043e\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9a1\/80a\/a4b\/9a180aa4bfd5d1cab3c486c339b807e1.png\" width=\"1020\" height=\"969\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a1\/80a\/a4b\/9a180aa4bfd5d1cab3c486c339b807e1.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e\u043a\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ac\/0c7\/e91\/6ac0c7e919b9438c05f5d9c69bf51082.png\" width=\"1124\" height=\"849\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ac\/0c7\/e91\/6ac0c7e919b9438c05f5d9c69bf51082.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 ML \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 Apache Spark: \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Apache Spark \u0441 \u043e\u0434\u043d\u0438\u043c Master \u0443\u0437\u043b\u043e\u043c, \u0434\u0432\u0443\u043c\u044f Worker \u0443\u0437\u043b\u0430\u043c\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445, \u0438 Spring Boot Java 8 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a DJL, Spark ML \u0438 XGBoost \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440 &#8212; \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043d\u0435 \u0432\u0441\u0435, \u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 Linux).<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Embedded \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 nVidia \u0434\u043b\u044f IoT-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a49\/bc9\/17c\/a49bc917c440911f34fd79739c19910f.png\" width=\"568\" height=\"500\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a49\/bc9\/17c\/a49bc917c440911f34fd79739c19910f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0435\u0441\u044c \u043d\u0438\u0436\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/gitlab.com\/AlexPit\/java-ml-spark-example\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitLab<\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0412\u0441\u0435 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 Windows 10 Pro. \u0412\u0430\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043d\u0438\u0436\u0435 Pro, \u0438 \u0441\u0431\u043e\u0440\u043a\u0435 Windows 10 Build 19043.1263 (21H1).<\/p>\n<p>WSL, Docker \u0438 CUDA \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f WSL 5.10.16.3+;<\/p>\n<p>Docker 19.03+.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Windows Terminal \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430: PowerShell, cmd, Ubuntu.<\/p>\n<h3>nVidia driver, CUDA<\/h3>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f nVidia CUDA \u043d\u0435 \u043d\u0438\u0436\u0435 11.7. \u0414\u0440\u0430\u0439\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043c\u0435\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u044e 516.40. <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 CUDA \u043c\u043e\u0436\u043d\u043e, \u043e\u0442\u043a\u0440\u044b\u0432 Powershell (\u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <\/p>\n<pre><code class=\"bash\">nvidia-smi<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/618\/480\/bbb\/618480bbb1f9dfebef368a524baba970.png\" width=\"734\" height=\"258\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/618\/480\/bbb\/618480bbb1f9dfebef368a524baba970.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>WSL &#8212; Windows Subsystem for Linux<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPU \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u041f\u041e \u043e\u0442 nVidia (\u0441\u043c \u043d\u0438\u0436\u0435), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 WSL2.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u041f\u041a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f WSL \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"bash\">wsl --install<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 WSL \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Ubuntu, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c 2.<\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f Ubuntu \u0434\u043b\u044f Windows \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u043d\u0435<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b6\/759\/5e2\/8b67595e212c7191823329b5938b8403.png\" width=\"818\" height=\"638\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b6\/759\/5e2\/8b67595e212c7191823329b5938b8403.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e WSL \u0432 Powershell <\/p>\n<pre><code class=\"bash\">wsl -l -v<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d8\/9ca\/993\/9d89ca993d270aae13f3db60fc81d878.png\" width=\"335\" height=\"64\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d8\/9ca\/993\/9d89ca993d270aae13f3db60fc81d878.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u0435\u0440\u0441\u0438\u044f Ubuntu 1, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c<\/p>\n<pre><code class=\"bash\">wsl --set-version Ubuntu-20.04 2<\/code><\/pre>\n<h3>Docker Desktop<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Docker Desktop, \u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0435\u0437 Docker Desktop, \u043c\u043e\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3ad\/1e6\/fe4\/3ad1e6fe4320b9440bf12c3908b94c86.png\" width=\"376\" height=\"158\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3ad\/1e6\/fe4\/3ad1e6fe4320b9440bf12c3908b94c86.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043e\u0431\u0430 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \u201cUse WSL 2 based engine\u201d \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0d8\/faa\/75c\/0d8faa75c6568c9a3579c5bdd2cb7159.png\" width=\"723\" height=\"262\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d8\/faa\/75c\/0d8faa75c6568c9a3579c5bdd2cb7159.png\"\/><figcaption><\/figcaption><\/figure>\n<p>Apply &amp; Restart.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 wsl \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/932\/437\/c61\/932437c61209582d9860977d2776c52c.png\" width=\"446\" height=\"98\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/932\/437\/c61\/932437c61209582d9860977d2776c52c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 Docker \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<\/p>\n<pre><code class=\"bash\">docker run -d -p 5000:5000 --restart=always --name registry registry:2<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 docker registry, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.  <\/p>\n<pre><code class=\"bash\">docker ps CONTAINER ID   IMAGE        COMMAND                  CREATED         STATUS         PORTS                    NAMES 745b50d66906   registry:2   \"\/entrypoint.sh \/etc\u2026\"   2 minutes ago   Up 2 minutes   0.0.0.0:5000->5000\/tcp   registry<\/code><\/pre>\n<h3>CUDA Support for WSL 2<\/h3>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b CUDA \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 nVidia \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>. <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u0432 PowerShell \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"powershell\">wsl sudo -i apt-key del 7fa2af80 wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/wsl-ubuntu\/x86_64\/cuda-wsl-ubuntu.pin mv cuda-wsl-ubuntu.pin \/etc\/apt\/preferences.d\/cuda-repository-pin-600 wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/11.7.0\/local_installers\/cuda-repo-wsl-ubuntu-11-7-local_11.7.0-1_amd64.deb # see the output of the previosly command cp \/var\/cuda-repo-wsl-ubuntu-11-7-local\/cuda-B81839D3-keyring.gpg \/usr\/share\/keyrings\/ apt-get update apt-get -y install cuda<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u043d\u0435 PowerShell \u0440\u0430\u0431\u043e\u0442\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 nVidia \u0441 \u0444\u043b\u0430\u0433\u043e\u043c benchmark:<\/p>\n<pre><code class=\"bash\">docker run --gpus all nvcr.io\/nvidia\/k8s\/cuda-sample:nbody nbody -gpu -benchmark<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u0432\u0441\u0435 \u0448\u0430\u0433\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eb6\/db3\/3bf\/eb6db33bf9e4629095f28b032d7e56c1.png\" width=\"1000\" height=\"726\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eb6\/db3\/3bf\/eb6db33bf9e4629095f28b032d7e56c1.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043c\u0435\u043b\u0438 \u043c\u0435\u0441\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 nVidia <a href=\"https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c <\/a>\u0438 <a href=\"https:\/\/forums.developer.nvidia.com\/t\/guide-to-run-cuda-wsl-docker-with-latest-versions-21382-windows-build-470-14-nvidia\/178365\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0434\u043b\u044f \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/h2>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Rapids \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Java 8, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u043f\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 Docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0438 \u0441\u0430\u043c\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 Spark Workers<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437. \u041d\u0438\u0436\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 Dockerfile.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Ubuntu 20.04 \u0441 CUDA 11.7.0 \u0438\u0437 <a href=\"https:\/\/catalog.ngc.nvidia.com\/orgs\/nvidia\/containers\/cuda\/tags\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 nVidia<\/a>. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441 Ubuntu \u0432\u0435\u0440\u0441\u0438\u0438 22.04 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u041f\u041e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u041f\u041e.<\/p>\n<pre><code>FROM nvcr.io\/nvidia\/cuda:11.7.0-devel-ubuntu20.04  ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'  ARG DEBIAN_FRONTEND=noninteractive  RUN apt-get update &amp;&amp; apt install -y bash tini libc6 libpam-modules libnss3 procps nano iputils-ping net-tools  RUN apt-get update &amp;&amp; \\ apt-get install -y openjdk-8-jdk &amp;&amp; \\ apt-get install -y ant &amp;&amp; \\ apt-get clean &amp;&amp; \\ rm -rf \/var\/lib\/apt\/lists\/* &amp;&amp; \\ rm -rf \/var\/cache\/oracle-jdk8-installer;  # Fix certificate issues RUN apt-get update &amp;&amp; \\ apt-get install -y ca-certificates-java &amp;&amp; \\ apt-get clean &amp;&amp; \\ update-ca-certificates -f &amp;&amp; \\ rm -rf \/var\/lib\/apt\/lists\/* &amp;&amp; \\ rm -rf \/var\/cache\/oracle-jdk8-installer;  # Setup JAVA_HOME, this is useful for docker commandline ENV JAVA_HOME \/usr\/lib\/jvm\/java-8-openjdk-amd64\/ RUN export JAVA_HOME  CMD [\"tail\", \"-f\", \"\/dev\/null\"] <\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0432 \u043e\u0431\u0440\u0430\u0437\u0435 JDK \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f openjdk8, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c Rapids \u0438 \u043d\u0435 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435\u043c Oracle JDK. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043e\u0431\u0440\u0430\u0437 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0434\u0435\u0431\u0430\u0433\u0430.<\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f CMD \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430, \u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 nVidia \u0441 \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439 \u201cdevel\u201d &#8212; \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/786\/b77\/7ed\/786b777eda1f592538cca2364e91bb63.png\" width=\"1005\" height=\"117\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/786\/b77\/7ed\/786b777eda1f592538cca2364e91bb63.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0437:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/98b\/751\/362\/98b751362e02d9bbfd449544143ab841.png\" width=\"991\" height=\"116\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98b\/751\/362\/98b751362e02d9bbfd449544143ab841.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 devel &#8212; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u201cnvcc\u201d. <\/p>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">docker build -f Dockerfile-cuda-java8 -t localhost:5000\/cuda-jdk8:v1 .<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, \u043c\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c Kubernetes \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u0437 localhost:5000, \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0445, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.  <\/p>\n<\/blockquote>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">docker run --gpus all --name=cuda-jdk8 -it -d localhost:5000\/cuda-jdk8:v1<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0432\u0430\u0436\u043d\u044b\u043c \u0444\u043b\u0430\u0433\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u201c&#8212;gpus\u201d, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u201call\u201d &#8212; \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u043b\u0430\u0433\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b gpu \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<pre><code class=\"bash\">$ nvidia-smi Sun Jul 10 13:58:20 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.48.07    Driver Version: 516.40       CUDA Version: 11.7     | |-------------------------------+----------------------+----------------------+ | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC | | Fan  Temp  Perf  Pwr:Usage\/Cap|         Memory-Usage | GPU-Util  Compute M. | |                               |                      |               MIG M. | |===============================+======================+======================| |   0  NVIDIA GeForce ...  On   | 00000000:0B:00.0  On |                  N\/A | |  0%   42C    P8    20W \/ 250W |   1241MiB \/ 11264MiB |      4%      Default | |                               |                      |                  N\/A | +-------------------------------+----------------------+----------------------+  +-----------------------------------------------------------------------------+ | Processes:                                                                  | |  GPU   GI   CI        PID   Type   Process name                  GPU Memory | |        ID   ID                                                   Usage      | |=============================================================================| |  No running processes found                                                 | +-----------------------------------------------------------------------------+   $ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Tue_May__3_18:49:52_PDT_2022 Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7\/compiler.31294372_0<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u201cruntime\u201d <code>nvcc --version<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u0430\u043a \u043a\u0430\u043a nvcc \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0437\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0448\u0430\u0433\u043e\u0432.<\/p>\n<h3>\u041e\u0431\u0440\u0430\u0437 Spark Worker<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 &#8212; \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 Spark Worker.<\/p>\n<blockquote>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Spark \u043a\u0430\u043a Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0431\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. Spark Master \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 (\u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0438\u043c\u0435\u043b\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b Spark \u0441 Cassandra \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f), \u0438 \u043a \u043d\u0435\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f Spark Worker \u0432 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e:<\/p>\n<p>\u0430) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c GPU-\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445;<\/p>\n<p>\u0431) \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 Docker-\u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f Kubernetes \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0437 Spark \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 Spark Master.<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Spark, \u043a\u0430\u043a \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0438 standalone \u0440\u0435\u0436\u0438\u043c\u0430\u0445, \u0442\u0430\u043a \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kubernetes, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"https:\/\/stackoverflow.com\/questions\/31806188\/standalone-manager-vs-yarn-vs-mesos\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u0430 \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 Yarn \u0438 Mesos \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"http:\/\/www.quora.com\/How-does-YARN-compare-to-Mesos\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u0438\u043b\u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<\/blockquote>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u0441\u043e Spark \u0441 <a href=\"https:\/\/spark.apache.org\/downloads.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/a>. \u0412\u0432\u0438\u0434\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043c\u043e\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e 3.2.1, \u0445\u043e\u0442\u044f, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438) \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 3.3.0.<\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e spark (\u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f spark \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a1c\/255\/9b5\/a1c2559b5a8547b7cfee6311c994b9ae.png\" width=\"242\" height=\"361\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1c\/255\/9b5\/a1c2559b5a8547b7cfee6311c994b9ae.png\"\/><figcaption><\/figcaption><\/figure>\n<h4>Rapids resources<\/h4>\n<p>\u0417\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 rapids. \u0415\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u043d\u0435\u0435 \u0444\u0430\u0439\u043b\u044b *.jar \u0441 <a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/download.html\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0430 Rapids<\/a>. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0440\u0435\u043b\u0438\u0437 22.06.0, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0432\u043c\u0435\u0449\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0444\u0430\u0439\u043b\u0430. \u041d\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u0435\u0436\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0431\u044b\u043b\u0430 22.04.0. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e\u0434\u043d\u0430\u043a\u043e, \u043a\u043e\u0433\u0434\u0430 \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b Spring \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0440\u0435\u0434 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 1080 Ti, \u044f \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 22.06.0. \u041d\u0430 1080 Ti \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0432\u0435\u043b\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0435\u0431\u0430\u0433\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u044f \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Rapids \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 Pascal \u0438 WSL2 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0427\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445, \u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f 22.06.0.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <a href=\"https:\/\/github.com\/apache\/spark\/blob\/master\/examples\/src\/main\/scripts\/getGpusResources.sh\" rel=\"noopener noreferrer nofollow\">getGpusResources.sh<\/a> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f GPU \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements.  See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the \"License\"); you may not use this file except in compliance with # the License.  You may obtain a copy of the License at # #    http:\/\/www.apache.org\/licenses\/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an \"AS IS\" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #  # This script is a basic example script to get resource information about NVIDIA GPUs. # It assumes the drivers are properly installed and the nvidia-smi command is available. # It is not guaranteed to work on all setups so please test and customize as needed # for your environment. It can be passed into SPARK via the config # spark.{driver\/executor}.resource.gpu.discoveryScript to allow the driver or executor to discover # the GPUs it was allocated. It assumes you are running within an isolated container where the # GPUs are allocated exclusively to that driver or executor. # It outputs a JSON formatted string that is expected by the # spark.{driver\/executor}.resource.gpu.discoveryScript config. # # Example output: {\"name\": \"gpu\", \"addresses\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\"]}  ADDRS=`nvidia-smi --query-gpu=index --format=csv,noheader | sed -e ':a' -e 'N' -e'$!ba' -e 's\/\\n\/\",\"\/g'` echo {\\\"name\\\": \\\"gpu\\\", \\\"addresses\\\":[\\\"$ADDRS\\\"]}<\/code><\/pre>\n<h4>Datasets<\/h4>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f &#8212; datasets. \u0412 \u043d\u0435\u0439 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b *.csv \u0438 *.parquet, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043a\u0430\u043a \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0438 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b. \u0412\u0437\u044f\u0442\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/NVIDIA\/spark-rapids-examples\/blob\/branch-22.06\/datasets\/taxi-small.tar.gz\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4>Spark config files<\/h4>\n<p>\u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<h4>\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f conf<\/h4>\n<p>\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432. \u0417\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0442\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432 \u0442\u0443 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u201c.template\u201d \u0432 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b <strong>spark-defaults.conf<\/strong>:<\/p>\n<pre><code>spark.master                     spark:\/\/192.168.5.129:7077 spark.executor.memory            2g spark.executor.cores             4  spark.worker.resource.gpu.amount 1 spark.worker.resource.gpu.discoveryScript \/opt\/sparkRapidsPlugin\/getGpusResources.sh  spark.executorEnv.NCCL_DEBUG     INFO<\/code><\/pre>\n<p><strong>spark-env.sh<\/strong>:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  # Options for the daemons used in the standalone deploy mode SPARK_MASTER_HOST=\"192.168.5.129\" SPARK_MASTER_PORT=\"7077\" SPARK_WORKER_OPTS=\"-Dspark.worker.resource.gpu.amount=1 -Dspark.worker.resource.gpu.discoveryScript=\/opt\/sparkRapidsPlugin\/getGpusResources.sh -Dspark.rapids.memory.pinnedPool.size=2G -Dspark.executor.resource.gpu.amount=1 -Dspark.executorEnv.NCCL_DEBUG=INFO\"\" <\/code><\/pre>\n<h4>Docker<\/h4>\n<p>\u0421\u043b\u0435\u0434\u0443\u044f <a href=\"https:\/\/spark.apache.org\/docs\/latest\/running-on-kubernetes.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Spark<\/a>, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Docker-\u043e\u0431\u0440\u0430\u0437\u043e\u0432:<\/p>\n<pre><code class=\"bash\">$ .\/bin\/docker-image-tool.sh -r &lt;repo> -t my-tag build<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Dockerfile \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre><code>ARG java_image_tag=11-jre-slim  # \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 docker-build FROM ${java_image_tag}   ARG spark_uid=1001 ARG UID_GID=1001 ENV UID=${UID_GID} ENV GID=${UID_GID}  ENV SPARK_RAPIDS_DIR=\/opt\/sparkRapidsPlugin ENV SPARK_RAPIDS_PLUGIN_JAR=${SPARK_RAPIDS_DIR}\/rapids-4-spark_2.12-22.06.0.jar # old #ENV SPARK_CUDF_JAR=${SPARK_RAPIDS_DIR}\/cudf-22.04.0-cuda11.jar #ENV SPARK_RAPIDS_PLUGIN_JAR=${SPARK_RAPIDS_DIR}\/rapids-4-spark_2.12-22.04.0.jar  RUN set -ex &amp;&amp; \\     sed -i 's\/http:\\\/\\\/deb.\\(.*\\)\/https:\\\/\\\/deb.\\1\/g' \/etc\/apt\/sources.list &amp;&amp; \\     apt-get update &amp;&amp; \\     ln -s \/lib \/lib64 &amp;&amp; \\     apt install -y bash tini libc6 libpam-modules libnss3 procps nano iputils-ping net-tools iptables sudo \\     wget software-properties-common build-essential libnss3-dev zlib1g-dev libgdbm-dev libncurses5-dev \\     libssl-dev libffi-dev libreadline-dev libsqlite3-dev libbz2-dev python3 &amp;&amp; \\     mkdir -p \/opt\/spark &amp;&amp; \\     mkdir -p \/opt\/spark\/examples &amp;&amp; \\     mkdir -p \/opt\/spark\/conf &amp;&amp; \\     mkdir -p \/opt\/spark\/work-dir &amp;&amp; \\     mkdir -p \/opt\/sparkRapidsPlugin &amp;&amp; \\     touch \/opt\/spark\/RELEASE &amp;&amp; \\     rm \/bin\/sh &amp;&amp; \\     ln -sv \/bin\/bash \/bin\/sh &amp;&amp; \\     echo \"auth required pam_wheel.so use_uid\" >> \/etc\/pam.d\/su &amp;&amp; \\     chgrp root \/etc\/passwd &amp;&amp; chmod ug+rw \/etc\/passwd RUN apt-get install libnccl2 libnccl-dev -y --allow-change-held-packages &amp;&amp; rm -rf \/var\/cache\/apt\/*  COPY jars \/opt\/spark\/jars COPY rapidsNew \/opt\/sparkRapidsPlugin # old #COPY rapids \/opt\/sparkRapidsPlugin COPY bin \/opt\/spark\/bin COPY sbin \/opt\/spark\/sbin COPY conf \/opt\/spark\/conf COPY kubernetes\/dockerfiles\/spark\/entrypoint.sh \/opt\/ COPY kubernetes\/dockerfiles\/spark\/decom.sh \/opt\/ COPY kubernetes\/tests \/opt\/spark\/tests COPY data \/opt\/spark\/data COPY datasets \/opt\/spark\/  ENV SPARK_HOME \/opt\/spark  WORKDIR \/opt\/spark\/work-dir RUN chmod g+w \/opt\/spark\/work-dir RUN chmod a+x \/opt\/decom.sh  # USER RUN groupadd --gid $UID appuser &amp;&amp; useradd --uid $UID --gid appuser --shell \/bin\/bash --create-home appuser RUN mkdir \/var\/logs &amp;&amp; chown -R appuser:appuser \/var\/logs RUN mkdir \/opt\/spark\/logs &amp;&amp; chown -R appuser:appuser \/opt\/spark\/ RUN chown -R appuser:appuser \/tmp  RUN ls -lah \/home\/appuser RUN touch \/home\/appuser\/.bashrc  RUN echo -e '\\ export SPARK_HOME=\/opt\/spark\\n\\ export PATH=$PATH:$SPARK_HOME\/bin:$SPARK_HOME\/sbin\\ ' > \/home\/appuser\/.bashrc  RUN chown -R appuser:appuser \/home\/appuser  # Specify the User that the actual main process will run as USER ${spark_uid}  EXPOSE 4040 EXPOSE 8081  ENTRYPOINT [ \"\/opt\/entrypoint.sh\" ] <\/code><\/pre>\n<p>entrypoint.sh:<\/p>\n<pre><code>#!\/bin\/bash  SPARK_DRIVER_BIND_ADDRESS=192.168.5.129:7077 # spark master address NCCL_DEBUG=INFO  source ~\/.bashrc  start-worker.sh spark:\/\/$SPARK_DRIVER_BIND_ADDRESS tail -f \/dev\/null<\/code><\/pre>\n<p><code>SPARK_DRIVER_BIND_ADDRESS<\/code> &#8212; \u0430\u0434\u0440\u0435\u0441 Spark Master, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0414\u043b\u044f \u0434\u0435\u0431\u0430\u0433\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043d\u0435\u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0445\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 nccl \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u0435\u0431\u0430\u0433\u0430 INFO. \u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>start-worker.sh spark:\/\/$SPARK_DRIVER_BIND_ADDRESS<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0440\u043a\u0435\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044f\u0441\u044c \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 kubernetes\/dockerfiles\/Dockerfile \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">cd spark docker build -f kubernetes\/dockerfiles\/spark\/Dockerfile --build-arg java_image_tag=localhost:5000\/cuda-jdk8:v1 -t localhost:5000\/cuda-jdk8-spark:v1 . docker run --memory=\"6g\" --cpus=\"4\" --gpus all --name=cuda-jdk8-spark -p 8081:8081 -it -d localhost:5000\/cuda-jdk8-spark:v1<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432 \u043e\u0431\u0440\u0430\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 nccl \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u044d\u043a\u0437\u0435\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 Spark Worker \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<pre><code class=\"bash\">$ dpkg -l | grep nccl ii  libnccl-dev                     2.12.12-1+cuda11.7                amd64        NVIDIA Collective Communication Library (NCCL) Development Files ii  libnccl2                        2.12.12-1+cuda11.7                amd64        NVIDIA Collective Communication Library (NCCL) Runtime<\/code><\/pre>\n<p>\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>2.12.12-1+cuda11.7<\/code>. \u0412 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043d\u0438\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0437\u0430\u0434\u0430\u0447 XGBoost, \u0442.\u043a. nccl \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043e\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c. <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0440\u043a\u0435\u0440\u0430, \u043f\u0443\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0435\u0433\u043e WEB GUI \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 localhost:8081 (\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 docker run \u0432\u044b\u0448\u0435):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c33\/8d4\/4dc\/c338d44dc8521c40052c907b6ee4e1d9.png\" width=\"524\" height=\"286\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c33\/8d4\/4dc\/c338d44dc8521c40052c907b6ee4e1d9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e Cores \u0438 Memory, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0440\u0435\u0441\u0443\u0440\u0441 Resources: gpu. \u041d\u0430 \u043c\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043e\u0434\u043d\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0438 \u0435\u0433\u043e id \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043a\u0430\u043a \u201c0\u201d.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c WEB GUI \u043c\u0430\u0441\u0442\u0435\u0440\u0430 (\u0430\u0434\u0440\u0435\u0441 \u043c\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b <a href=\"http:\/\/192.168.5.129:8080\/\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.5.129:8080\/<\/a>):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/209\/c06\/967\/209c069674b131c516ffb44ee2ad5391.png\" width=\"1804\" height=\"533\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/209\/c06\/967\/209c069674b131c516ffb44ee2ad5391.png\"\/><figcaption><\/figcaption><\/figure>\n<p>Spark Worker, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 Workers. \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<h2>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u043c\u0441\u044f \u0442\u0430\u043a \u0436\u0435 Spark Driver. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c 3 HTTP Endpoint\u2019a, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a: DJL, Spark ML, XGBoost. <\/p>\n<h3>\u041a\u0430\u0440\u043a\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0412 \u0432\u0438\u0434\u0435 \u043a\u0430\u0440\u043a\u0430\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Spring Boot \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c spring-boot-starter-web, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 JDK &#8212; OpenJDK 8 (\u0434\u0435\u0440\u0436\u0438\u043c \u0432 \u0443\u043c\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 Rapids). \u042f \u0441\u043e\u0437\u0434\u0430\u044e \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0438\u0448\u0443 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/380\/af3\/6f5\/380af36f522d3a4e9253f51a00a5c0d9.png\" width=\"775\" height=\"462\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/380\/af3\/6f5\/380af36f522d3a4e9253f51a00a5c0d9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d8a\/060\/6f7\/d8a0606f79b0c64580d211297da25732.PNG\" width=\"322\" height=\"802\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0424\u0430\u0439\u043b pom.xml \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u0432\u0430\u0436\u043d\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b XGBoost \u043d\u0430 Windows \u0441 WSL2 \u0432 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 <a href=\"https:\/\/github.com\/dmlc\/xgboost\/issues\/7994\" rel=\"noopener noreferrer nofollow\">GitHub Issue<\/a>.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 XGBoost, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Maven central \u043e\u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 pom.xml \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 SNAPSHOT:<\/p>\n<pre><code class=\"xml\">&lt;distributionManagement>     &lt;repository>         &lt;id>XGBoost4J Snapshot Repo&lt;\/id>         &lt;name>XGBoost4J Snapshot Repo&lt;\/name>         &lt;url>https:\/\/s3-us-west-2.amazonaws.com\/xgboost-maven-repo\/snapshot\/&lt;\/url>     &lt;\/repository> &lt;\/distributionManagement><\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. \u0414\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 \u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u0438 \u041a\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043d\u0441\u043a\u0438\u0445 IP (\u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c) \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u043f\u043e \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435\u0442. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b: \u043b\u0438\u0431\u043e VPN, \u043b\u0438\u0431\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0436\u0430\u0440\u043d\u0438\u043a\u0438 xgboost4j-gpu_2.12-2.0.0-SNAPSHOT.jar \u0438 xgboost4j-spark-gpu_2.12-2.0.0-SNAPSHOT.jar \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 m2 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a81\/3f8\/e38\/a813f8e38f6c78b97b7cca26b2c45c93.png\" width=\"476\" height=\"234\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a81\/3f8\/e38\/a813f8e38f6c78b97b7cca26b2c45c93.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f19\/fd9\/508\/f19fd9508f177c10e333b224f27be997.png\" width=\"563\" height=\"105\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f19\/fd9\/508\/f19fd9508f177c10e333b224f27be997.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/367\/34a\/168\/36734a168f4a2ca534b66741da6eefab.png\" width=\"662\" height=\"98\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/367\/34a\/168\/36734a168f4a2ca534b66741da6eefab.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u0438 \u0434\u0436\u0430\u0440\u043d\u0438\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e jars \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0441\u043c. \u0441\u043a\u0440\u0438\u043d \u0432\u044b\u0448\u0435). \u0414\u0430\u043d\u043d\u044b\u0435 *.jar \u0444\u0430\u0439\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0432 Spark Executor \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u0434\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0430\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>SparkConfiguration<\/code>:  <\/p>\n<pre><code class=\"java\">package com.mlwebservice.config;  import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.sql.SparkSession; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;  import java.net.InetAddress; import java.net.UnknownHostException;  @Configuration public class SparkConfiguration {     @Value(\"${spring.application.name}\")     private String appName;     @Value(\"${spark.masterHost}\")     private String masterHost;      @Bean     public JavaSparkContext javaSparkContext() throws UnknownHostException {         String host = InetAddress.getLocalHost().getHostAddress();         SparkConf sparkConf = new SparkConf(true)                 .setAppName(appName)                 .setMaster(\"spark:\/\/\" + masterHost)                 .setJars(new String[]{                         \"service.jar\",                         \"jars\/config-1.4.1.jar\",                         \"jars\/rapids-4-spark_2.12-22.06.0.jar\",                         \"jars\/spark-nlp_2.12-3.4.1.jar\",                         \"jars\/xgboost4j-gpu_2.12-2.0.0-SNAPSHOT.jar\",                         \"jars\/xgboost4j-spark-gpu_2.12-2.0.0-SNAPSHOT.jar\"})                 \/\/ Spark settings                 .set(\"spark.worker.cleanup.enabled\", \"true\")                 \/\/ executors                 .set(\"spark.executor.cores\", \"4\")                 .set(\"spark.executor.memory\", \"2g\")                 .set(\"spark.executor.resource.gpu.amount\", \"1\")                 .set(\"spark.executorEnv.NCCL_DEBUG\", \"INFO\")                 .set(\"spark.task.resource.gpu.amount\", \"1\")                 \/\/ driver                 .set(\"spark.ui.enabled\", \"true\")                 .set(\"spark.ui.port\", \"4040\")                 .set(\"spark.driver.host\", host)                 .set(\"spark.driver.bindAddress\", host)                 .set(\"spark.driver.blockManager.port\", \"45029\")                 .set(\"spark.driver.port\", \"33139\")                 .set(\"spark.port.maxRetries\", \"16\")                 .set(\"spark.driver.maxResultSize\", \"2g\")                 .set(\"spark.executor.heartbeatInterval\", \"200000\")                 .set(\"spark.network.timeout\", \"300000\")                 \/\/ rapids                 .set(\"spark.rapids.memory.gpu.pooling.enabled\", \"false\")                 .set(\"spark.rapids.memory.gpu.minAllocFraction\", \"0.0001\")                 .set(\"spark.rapids.memory.gpu.reserve\", \"2\")                 .set(\"spark.rapids.sql.enabled\", \"true\")                 .set(\"spark.sql.adaptive.enabled\", \"false\")                 .set(\"spark.rapids.sql.explain\", \"ALL\")                 .set(\"spark.rapids.sql.hasNans\", \"false\")                 .set(\"spark.rapids.sql.csv.read.float.enabled\", \"true\")                 .set(\"spark.rapids.sql.castFloatToString.enabled\", \"true\")                 .set(\"spark.rapids.sql.csv.read.double.enabled\", \"true\")                 .set(\"spark.rapids.sql.castDoubleToString.enabled\", \"true\")                 .set(\"spark.rapids.sql.exec.CollectLimitExec\", \"true\")                 .set(\"spark.locality.wait\", \"0s\")                 .set(\"spark.sql.files.maxPartitionBytes\", \"512m\")                 .set(\"spark.plugins\", \"com.nvidia.spark.SQLPlugin\")                 .set(\"spark.driver.extraClassPath\", \"\/opt\/sparkRapidsPlugin\/rapids-4-spark_2.12-22.06.0.jar\");         return new JavaSparkContext(sparkConf);     }      @Bean     public SparkSession sparkSession(JavaSparkContext context) {         return SparkSession.builder()                 .master(\"spark:\/\/\" + masterHost)                 .appName(appName)                 .config(context.getConf())                 .config(\"spark.executorEnv.NCCL_DEBUG\", \"INFO\")                 .getOrCreate();     } } <\/code><\/pre>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Spark \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/spark.apache.org\/docs\/latest\/configuration.html\" rel=\"noopener noreferrer nofollow\">Configuration &#8212; Spark 3.3.0 Documentation<\/a> .<\/p>\n<p>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043f\u043e 1-2 \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u0432 \u0443\u0433\u043e\u0434\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0441\u0430\u043c\u043e\u043c\u0443 \u0444\u0430\u043a\u0442\u0443, \u0447\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Spring, \u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0440\u0443\u0433\u0438\u0435 HTTP \u0433\u043b\u0430\u0433\u043e\u043b\u044b, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0435 DTO, \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0431\u0440\u043e\u043a\u0435\u0440\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u0449\u0438\u043d\u044b, \u0432\u0435\u0431\u0441\u043e\u043a\u0435\u0442\u044b \u0438 \u0432\u043e\u0442 \u044d\u0442\u043e \u0432\u043e\u0442 \u0432\u0441\u0435.<\/p>\n<pre><code class=\"java\">package com.mlwebservice.controller;  import ai.djl.translate.TranslateException; import com.mlwebservice.service.DJLService; import com.mlwebservice.service.RapidsService; import com.mlwebservice.service.SparkMLService; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;  import java.io.IOException;  @RestController @RequestMapping(\"\/\") @RequiredArgsConstructor public class MLController {     private final DJLService djlService;     private final SparkMLService sparkMLService;     private final RapidsService rapidsService;      @GetMapping(\"\/djl\")     public ResponseEntity&lt;?> djl() {         try {             djlService.mlWork();         } catch (TranslateException | IOException e) {             return ResponseEntity.status(500).body(e.getMessage());         }         return ResponseEntity.ok().build();     }      @GetMapping(\"\/forest\")     public ResponseEntity&lt;?> sparkML() {         sparkMLService.randomForestTest();         return ResponseEntity.ok().build();     }      @GetMapping(\"\/gpu_test\")     public ResponseEntity&lt;?> rapidsGpuTest() {         rapidsService.testRapids();         return ResponseEntity.ok().build();     }      @GetMapping(\"\/xgboost\")     public ResponseEntity&lt;?> rapidsXGBoost() {         rapidsService.xgBoost();         return ResponseEntity.ok().build();     } } <\/code><\/pre>\n<h3>Deep Java Library &#8212; DJL<\/h3>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 &#8212; <a href=\"https:\/\/djl.ai\/\" rel=\"noopener noreferrer nofollow\">DJL<\/a>. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Java, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043e\u043e\u043f\u0430\u0440\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (Model Zoo), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0422\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u0432\u0438\u0434\u0443 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e, \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0432\u0438\u0436\u043a\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a PyTorch. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spark \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u043e\u0441\u044c, \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0430\u043c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Spark \u0432 \u043f\u0430\u0440\u0435 \u0441 DJL \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0437 Model Zoo, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/towardsdatascience.com\/deep-learning-with-spark-in-deep-java-library-in-10-minutes-923a73704094\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a>.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 <a href=\"https:\/\/d2l.djl.ai\/chapter_linear-networks\/linear-regression-scratch.html\" rel=\"noopener noreferrer nofollow\">3.2. Linear Regression Implementation from Scratch \u2014 Dive into Deep Learning 0.1.0 documentation<\/a>  \u0438 <a href=\"https:\/\/d2l.djl.ai\/chapter_linear-networks\/linear-regression-djl.html\" rel=\"noopener noreferrer nofollow\">3.3. Concise Implementation of Linear Regression \u2014 Dive into Deep Learning 0.1.0 documentation<\/a> \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 <code>DJLService<\/code>.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u044f\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0432 main \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u043e\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0432\u0435\u0441\u0442\u0438\u0441\u044c \u043b\u043e\u0433 \u0432\u0438\u0434\u0430:<\/p>\n<pre><code>2022-07-18 19:38:45.346  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : Initializing DJL lib... 2022-07-18 19:38:45.349  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : CPU: cpu() 2022-07-18 19:38:45.349  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : GPU: gpu(0) 2022-07-18 19:38:45.439  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : CUDA available: true 2022-07-18 19:38:45.440  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : CUDA GPU count: 1 OpenJDK 64-Bit Server VM warning: You have loaded library \/root\/.djl.ai\/pytorch\/1.11.0-20220510-cu113-linux-x86_64\/libtorch_cpu.so which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c &lt;libfile>', or link it with '-z noexecstack'. 2022-07-18 19:38:45.739  INFO 1 --- [           main] ai.djl.pytorch.engine.PtEngine           : Number of inter-op threads is 8 2022-07-18 19:38:45.740  INFO 1 --- [           main] ai.djl.pytorch.engine.PtEngine           : Number of intra-op threads is 8 2022-07-18 19:38:45.740  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : GPU count: 1 2022-07-18 19:38:45.741  INFO 1 --- [           main] c.mlwebservice.MLWebServiceApplication   : Engine: PyTorch:1.11.0, capabilities: [ CUDA, CUDNN, OPENMP, MKL, MKLDNN, ] PyTorch Library: \/root\/.djl.ai\/pytorch\/1.11.0-20220510-cu113-linux-x86_64<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430:  <\/p>\n<pre><code class=\"java\">package com.mlwebservice.service;  import ai.djl.Model; import ai.djl.metric.Metrics; import ai.djl.ndarray.NDArray; import ai.djl.ndarray.NDManager; import ai.djl.ndarray.types.Shape; import ai.djl.nn.Block; import ai.djl.nn.ParameterList; import ai.djl.nn.SequentialBlock; import ai.djl.nn.core.Linear; import ai.djl.training.DefaultTrainingConfig; import ai.djl.training.EasyTrain; import ai.djl.training.Trainer; import ai.djl.training.dataset.ArrayDataset; import ai.djl.training.dataset.Batch; import ai.djl.training.listener.TrainingListener; import ai.djl.training.loss.Loss; import ai.djl.training.optimizer.Optimizer; import ai.djl.training.tracker.Tracker; import ai.djl.translate.TranslateException; import com.mlwebservice.model.DataPoints; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service;  import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays;  @Slf4j @Service public class DJLService {      public void mlWork() throws TranslateException, IOException {         \/\/ Generating the Dataset         NDManager manager = NDManager.newBaseManager();          NDArray trueW = manager.create(new float[]{2, -3.4f});         float trueB = 4.2f;          DataPoints dp = DataPoints.syntheticData(manager, trueW, trueB, 1000);         NDArray features = dp.getX();         NDArray labels = dp.getY();          \/\/ Reading dataset         int batchSize = 10;         ArrayDataset dataset = loadArray(features, labels, batchSize, false);          \/\/ mini test         Batch testBatch = dataset.getData(manager).iterator().next();         NDArray X = testBatch.getData().head();         NDArray y = testBatch.getLabels().head();         log.info(\"X = {}\", X);         log.info(\"y = {}\", y);         testBatch.close();          \/\/ Defining the model         Model model = Model.newInstance(\"lin-reg\");          SequentialBlock net = new SequentialBlock();         Linear linearBlock = Linear.builder().optBias(true).setUnits(1).build();         net.add(linearBlock);          model.setBlock(net);          \/\/ Defining the Loss function         Loss l2loss = Loss.l2Loss();          \/\/ Defining the Optimization Algorithm         Tracker lrt = Tracker.fixed(0.03f);         Optimizer sgd = Optimizer.sgd().setLearningRateTracker(lrt).build();          \/\/ Instantiate Configuration and Trainer         DefaultTrainingConfig config = new DefaultTrainingConfig(l2loss)                 .optOptimizer(sgd) \/\/ Optimizer (loss function)                 .optDevices(manager.getEngine().getDevices(1)) \/\/ single GPU \/\/                .addTrainingListeners(TrainingListener.Defaults.logging()); \/\/ Logging                 .addTrainingListeners(TrainingListener.Defaults.basic()); \/\/ Without logging for increase speed          Trainer trainer = model.newTrainer(config);         log.info(\"Trainer devices: {}\", Arrays.toString(trainer.getDevices()));          \/\/ Initializing Model Parameters         \/\/ First axis is batch size - won't impact parameter initialization         \/\/ Second axis is the input size         trainer.initialize(new Shape(batchSize, 2));          \/\/ Metrics         Metrics metrics = new Metrics();         trainer.setMetrics(metrics);          \/\/ Training         int numEpochs = 30;          long startTime = System.currentTimeMillis();          for (int epoch = 1; epoch &lt;= numEpochs; epoch++) {             \/\/ Iterate over dataset             for (Batch batch : trainer.iterateDataset(dataset)) {                 \/\/ Update loss and evaulator                 EasyTrain.trainBatch(trainer, batch);                  \/\/ Update parameters                 trainer.step();                  batch.close();             }             \/\/ reset training and validation evaluators at end of epoch             trainer.notifyListeners(listener -> listener.onEpoch(trainer));         }          Block layer = model.getBlock();         ParameterList params = layer.getParameters();         NDArray wParam = params.valueAt(0).getArray();         NDArray bParam = params.valueAt(1).getArray();          long endTime = System.currentTimeMillis();          float[] w = trueW.sub(wParam.reshape(trueW.getShape())).toFloatArray();         log.info(\"Error in estimating w: [{} {}]\", w[0], w[1]);         log.info(\"Error in estimating b: {}\", trueB - bParam.getFloat());          log.info(\"Training time: \" + (endTime - startTime) + \" ms\");          \/\/ Save the model         Path modelDir = Paths.get(\"models\/lin-reg\");         Path savedDir = Files.createDirectories(modelDir);         model.setProperty(\"Epoch\", Integer.toString(numEpochs)); \/\/ save epochs trained as metadata         model.save(modelDir, \"lin-reg\");        log.info(\"Model saved in \" + savedDir.toAbsolutePath());     }      \/\/ Save in the file for later use     public ArrayDataset loadArray(NDArray features, NDArray labels, int batchSize, boolean shuffle) {         return new ArrayDataset.Builder()                 .setData(features) \/\/ set the features                 .optLabels(labels) \/\/ set the labels                 .setSampling(batchSize, shuffle) \/\/ set the batch size and random sampling                 .build();     } } <\/code><\/pre>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c DataPoints:<\/p>\n<pre><code class=\"java\">package com.mlwebservice.model;  import ai.djl.ndarray.NDArray; import ai.djl.ndarray.NDManager; import ai.djl.ndarray.types.DataType; import ai.djl.ndarray.types.Shape;  public class DataPoints {     private final NDArray x;     private final NDArray y;      public DataPoints(NDArray x, NDArray y) {         this.x = x;         this.y = y;     }      public NDArray getX() {         return x;     }      public NDArray getY() {         return y;     }      \/\/ Generate y = X w + b + noise     public static DataPoints syntheticData(NDManager manager, NDArray w, float b, int numExamples) {         NDArray x = manager.randomNormal(new Shape(numExamples, w.size()));         NDArray y = x.matMul(w).add(b);         \/\/ Add noise         y = y.add(manager.randomNormal(0, 0.01f, y.getShape(), DataType.FLOAT32));         return new DataPoints(x, y);     } } <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>2022-07-18 20:29:27.461  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : X = ND: (10, 2) gpu(0) float32 [[ 0.7017, -0.7652],  [ 2.495 , -0.3341],  [-2.175 , -0.452 ],  [ 1.1075,  0.8347],  [-1.8369, -0.7469],  [ 0.5647,  2.1323],  [-0.2754,  0.3807],  [ 0.2902,  1.5136],  [-0.5902,  0.6777],  [ 0.4059, -1.0304], ] 2022-07-18 20:29:27.473  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : y = ND: (10) gpu(0) float32 [ 8.1976, 10.324 ,  1.3922,  3.5564,  3.0556, -1.9248,  2.3501, -0.361 ,  0.7023,  8.4904] 2022-07-18 20:29:27.491  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : Trainer devices: [gpu(0)] 2022-07-18 20:29:34.665  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : Error in estimating w: [-4.7445297E-5 -1.2493134E-4] 2022-07-18 20:29:34.670  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : Error in estimating b: 1.9073486E-4 2022-07-18 20:29:34.670  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : Training time: 7112 ms 2022-07-18 20:29:34.676  INFO 1 --- [nio-9090-exec-1] com.mlwebservice.service.DJLService      : Model saved in \/usr\/src\/app\/models\/lin-reg<\/code><\/pre>\n<h3>Spark ML<\/h3>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/predictive-analytics-spark-machine-learning\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 nVidia<\/a> \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e Spark ML \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 Random Forest. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u0431\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u043b\u0438\u0431\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/ods\/blog\/324402\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a>, \u0432 <a href=\"https:\/\/spark.apache.org\/docs\/latest\/ml-classification-regression.html#random-forests\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Spark<\/a>, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 Spark ML \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/spark.apache.org\/docs\/latest\/mllib-ensembles.html#random-forests\" rel=\"noopener noreferrer nofollow\">\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b \u0434\u043b\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/NVIDIA\/spark-rapids-examples\/blob\/branch-22.06\/datasets\/taxi-small.tar.gz\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>, \u043b\u0438\u0431\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0434\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041e\u0442\u043c\u0435\u0447\u0443, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/predictive-analytics-spark-machine-learning\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438 nVidia \u043f\u043e Spark ML<\/a>, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 <a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/tutorial-gpu-accelerated-xgboost\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438 nVidia \u043f\u043e XGBoost<\/a>, \u043d\u043e \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c Random Forest \u0438\u0437 Spark ML. \u0414\u0430\u0442\u0430\u0441\u0435\u0442\u044b \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 Dockerfile, \u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u043f\u0443\u0442\u0438 \u043a \u043d\u0438\u043c \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u044f\u0442\u0441\u044f (\u043f\u0440\u0438\u043c\u0435\u0440 \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u0435\u0431\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c).<\/p>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e Spark ML \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e XGBoost \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 GPU-\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0432 Spark ML. \u0412\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430 (\u043a\u0430\u043a \u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 Issue \u043d\u0430 GitHub) \u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 <a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/additional-functionality\/ml-integration.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Rapids<\/a> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0435\u0449\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c <a href=\"https:\/\/github.com\/NVIDIA\/spark-rapids-examples\/tree\/branch-22.06\/examples\/ML+DL-Examples\/Spark-cuML\/pca\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c<\/a> \u0434\u043b\u044f <a href=\"https:\/\/spark.apache.org\/docs\/latest\/mllib-dimensionality-reduction#principal-component-analysis-pca\" rel=\"noopener noreferrer nofollow\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 Principal component analysis (PCA)<\/a>.<\/p>\n<p>\u041a\u043e\u0434 \u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<pre><code class=\"java\">package com.mlwebservice.service;  import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.spark.ml.Pipeline; import org.apache.spark.ml.PipelineStage; import org.apache.spark.ml.evaluation.RegressionEvaluator; import org.apache.spark.ml.feature.StandardScaler; import org.apache.spark.ml.feature.VectorAssembler; import org.apache.spark.ml.param.ParamMap; import org.apache.spark.ml.regression.RandomForestRegressor; import org.apache.spark.ml.tuning.CrossValidator; import org.apache.spark.ml.tuning.CrossValidatorModel; import org.apache.spark.ml.tuning.ParamGridBuilder; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import org.apache.spark.sql.SparkSession; import org.springframework.stereotype.Service;  import static org.apache.spark.sql.functions.col;  @Slf4j @Service @RequiredArgsConstructor public class SparkMLService {     private final SparkSession session;      public void randomForestTest() {         String trainPath = \"\/opt\/spark\/train\/train.parquet\";         \/\/test         String evalPath = \"\/opt\/spark\/eval\/eval.parquet\";          Dataset&lt;Row> tdf = session.read().parquet(trainPath);         Dataset&lt;Row> edf = session.read().parquet(evalPath);          String labelName = \"fare_amount\";         String[] featureColumns = {\"passenger_count\", \"trip_distance\", \"pickup_longitude\", \"pickup_latitude\", \"rate_code\",                 \"dropoff_longitude\", \"dropoff_latitude\", \"hour\", \"day_of_week\", \"is_weekend\", \"h_distance\"};          VectorAssembler assembler = new VectorAssembler()                 .setInputCols(featureColumns)                 .setOutputCol(\"rawfeatures\");          StandardScaler standardScaler = new StandardScaler()                 .setInputCol(\"rawfeatures\")                 .setOutputCol(\"features\")                 .setWithStd(true);          RandomForestRegressor regressor = new RandomForestRegressor()                 .setLabelCol(labelName)                 .setFeaturesCol(\"features\");          Pipeline pipeline = new Pipeline().setStages(new PipelineStage[]{assembler, standardScaler, regressor});          ParamMap[] paramGrid = new ParamGridBuilder()                 .addGrid(regressor.maxBins(), new int[]{100, 200})                 .addGrid(regressor.maxDepth(), new int[]{2, 7, 10})                 .addGrid(regressor.numTrees(), new int[]{5, 20})                 .build();          RegressionEvaluator evaluator = new RegressionEvaluator()                 .setLabelCol(labelName)                 .setPredictionCol(\"prediction\")                 .setMetricName(\"rmse\");          CrossValidator crossvalidator = new CrossValidator()                 .setEstimator(pipeline)                 .setEvaluator(evaluator)                 .setEstimatorParamMaps(paramGrid)                 .setNumFolds(3);          CrossValidatorModel pipelineModel = crossvalidator.fit(tdf);          ParamMap[] bestEstimatorParamMap = pipelineModel.getEstimatorParamMaps();          log.info(\"best params map {}\", bestEstimatorParamMap);          Dataset&lt;Row> predictions = pipelineModel.transform(edf);         Dataset&lt;Row> result = predictions.withColumn(\"error\", col(\"prediction\").minus(col(labelName)));         result.select(labelName, \"prediction\", \"error\").show();         result.describe(labelName, \"prediction\", \"error\").show();          RegressionEvaluator maevaluator = new RegressionEvaluator()                 .setLabelCol(labelName)                 .setMetricName(\"mae\");         log.info(\"mae evaluation: {}\", maevaluator.evaluate(predictions));          RegressionEvaluator rmsevaluator = new RegressionEvaluator()                 .setLabelCol(labelName)                 .setMetricName(\"rmse\");         log.info(\"rmse evaluation: {}\", rmsevaluator.evaluate(predictions));     } } <\/code><\/pre>\n<h3>Rapids \u0438 XGBoost<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0437 <a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/tutorial-gpu-accelerated-xgboost\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438 nVidia \u043f\u043e XGBoost<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438 Spark, \u0438 Rapids \u0432\u043c\u0435\u0441\u0442\u0435. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u043e Spark ML Random Forest. <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 <a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/get-started\/getting-started-on-prem.html#example-join-operation\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Rapids \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c<\/a> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f Join \u0434\u0432\u0443\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0438\u0437 10 \u043c\u043b\u043d \u0447\u0438\u0441\u0435\u043b. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <code>RapidsService<\/code>:<\/p>\n<pre><code class=\"java\">@Slf4j @Service @RequiredArgsConstructor public class RapidsService {     private final SparkSession session;      public void testRapids() {         int capacity = 1000000;         List&lt;LongValue> list = new ArrayList&lt;>(capacity);         for (long i = 1; i &lt; (capacity + 1); i++) {             list.add(new LongValue(i));         }          Dataset&lt;Row> df = session.createDataFrame(list, LongValue.class);         Dataset&lt;Row> df2 = session.createDataFrame(list, LongValue.class);          long result = df.select(col(\"value\").as(\"a\"))                 .join(df2.select(col(\"value\").as(\"b\")), col(\"a\").equalTo(col(\"b\"))).count();          log.info(\"count result {}\", result);     } }  @Data @AllArgsConstructor public class LongValue implements Serializable {     private static final long serialVersionUID = 1L;      private Long value; } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043d\u0430 Scala, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 GPU. DAG \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/387\/ba4\/f16\/387ba4f165eb3d9720ca2f3d5fc205a3.png\" width=\"781\" height=\"681\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/387\/ba4\/f16\/387ba4f165eb3d9720ca2f3d5fc205a3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f XGBoost, \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u044f\u0442 \u0438\u0437 <a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/tutorial-gpu-accelerated-xgboost\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438 nVidia<\/a>, \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b <a href=\"https:\/\/github.com\/NVIDIA\/spark-rapids-examples\/blob\/branch-22.06\/datasets\/taxi-small.tar.gz\" rel=\"noopener noreferrer nofollow\">\u0442\u0435 \u0436\u0435<\/a>, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f Random Forest Spark ML, \u043f\u0440\u043e \u0441\u0430\u043c XGBoost \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Gradient_boosting\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c <\/a>\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/ods\/blog\/645887\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f XGBoost regressor:<\/p>\n<pre><code class=\"java\">package com.mlwebservice.service;  import com.mlwebservice.model.LongValue; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import ml.dmlc.xgboost4j.scala.spark.XGBoostRegressionModel; import ml.dmlc.xgboost4j.scala.spark.XGBoostRegressor; import org.apache.spark.ml.PredictionModel; import org.apache.spark.ml.linalg.Vector; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import org.apache.spark.sql.SparkSession; import org.springframework.stereotype.Service; import scala.collection.immutable.HashMap; import scala.collection.immutable.Map;  import java.util.ArrayList; import java.util.List;  import static org.apache.spark.sql.functions.col;  @Slf4j @Service @RequiredArgsConstructor public class RapidsService {     private final SparkSession session;      public void xgBoost() {         String trainPath = \"\/opt\/spark\/train\/train.parquet\";         \/\/test         String evalPath = \"\/opt\/spark\/eval\/eval.parquet\";          Dataset&lt;Row> tdf = session.read().parquet(trainPath);         Dataset&lt;Row> edf = session.read().parquet(evalPath);          String labelName = \"fare_amount\";         String[] featureColumns = {\"passenger_count\", \"trip_distance\", \"pickup_longitude\", \"pickup_latitude\", \"rate_code\",                 \"dropoff_longitude\", \"dropoff_latitude\", \"hour\", \"day_of_week\", \"is_weekend\", \"h_distance\"};          Map&lt;String, Object> map = new HashMap&lt;>();         map = map.updated(\"learning_rate\", 0.05);         map = map.updated(\"max_depth\", 8);         map = map.updated(\"subsample\", 0.8);         map = map.updated(\"gamma\", 1);         map = map.updated(\"num_round\", 500);         map = map.updated(\"tree_method\", \"gpu_hist\");         map = map.updated(\"num_workers\", 1);          XGBoostRegressor regressor = new XGBoostRegressor(map);         regressor.setLabelCol(labelName);         regressor.setFeaturesCol(featureColumns);          PredictionModel&lt;Vector, XGBoostRegressionModel> model = regressor.fit(tdf);         Dataset&lt;Row> predictions = model.transform(edf);          Dataset&lt;Row> result = predictions.withColumn(\"error\", col(\"prediction\").minus(col(labelName)));         result.select(labelName, \"prediction\", \"error\").show();         result.describe(labelName, \"prediction\", \"error\").show();     } } <\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a<\/h3>\n<p>\u041f\u043e\u0440\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c Docker-\u043e\u0431\u0440\u0430\u0437, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c Dockerfile:<\/p>\n<pre><code>#FROM adoptopenjdk\/openjdk8:ubuntu-jre-nightly FROM localhost:5000\/cuda-jdk8:v1  WORKDIR \/usr\/src\/app ARG JAR_FILE ARG UID_GID=1001 ENV UID=${UID_GID} ENV GID=${UID_GID}  RUN mkdir -p jars COPY jars jars  ENV PYTHONUNBUFFERED=1  RUN apt-get update &amp;&amp; apt install -y python-is-python3 wget curl ca-certificates bash libgomp1 &amp;&amp; \\     rm -rf \/var\/cache\/apt\/*  RUN mkdir -p \/opt\/spark\/ COPY spark \/opt\/spark  COPY ${JAR_FILE} service.jar  RUN groupadd --gid $UID appuser &amp;&amp; useradd --uid $UID --gid appuser --shell \/bin\/bash --create-home appuser RUN chown -R appuser:appuser \/home\/appuser &amp;&amp; chown -R appuser:appuser \/usr\/src\/app  EXPOSE 4040 EXPOSE 9090 USER $UID CMD [\"java\", \"-jar\", \"service.jar\"] <\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0438 \u0432\u0442\u043e\u0440\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0438. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 DJL, \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f Spark. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u041f\u041e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 nVidia. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0434\u0432\u0438\u0436\u043e\u043a (PyTorch, MXNet, etc), \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u043e\u043c \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0415\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c volume \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 COPY \u0432 Dockerfile \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u0430 \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u0440\u0430\u0437.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 DJL \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435, \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u201c\u0442\u044f\u0436\u0435\u043b\u043e\u0433\u043e\u201d \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430, \u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u201c\u043b\u0435\u0433\u043a\u0438\u043c\u201d \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 JRE8, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e\u0442, \u0447\u0442\u043e \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 build.sh:<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash mvn clean install -DskipTests=true docker rmi localhost:5000\/ml:1 docker build -f Dockerfile --build-arg JAR_FILE=target\/service.jar -t localhost:5000\/ml:1 . docker run --gpus all -p 9090:9090 -p 4040:4040 -p 33139-33155:33139-33155 -p 45029-45045:45029-45045 --name=ML -it -d localhost:5000\/ml:1 <\/code><\/pre>\n<p>\u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f, \u0434\u0432\u0438\u0436\u043a\u0438 \u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f DJL \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u0432 Web UI Spark Master \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aa9\/828\/f9f\/aa9828f9f74b227dee506ae22af5d55e.png\" width=\"1849\" height=\"519\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa9\/828\/f9f\/aa9828f9f74b227dee506ae22af5d55e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 Web UI Spark Worker \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f Executor \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/104\/3cf\/19a\/1043cf19a83aa24d7948667bf891543e.png\" width=\"1777\" height=\"412\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/104\/3cf\/19a\/1043cf19a83aa24d7948667bf891543e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>Web UI \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0442\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1f8\/f83\/7b5\/1f8f837b5a0c72bea525a97ce3adcce9.png\" width=\"1365\" height=\"552\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1f8\/f83\/7b5\/1f8f837b5a0c72bea525a97ce3adcce9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443, \u0438\u043c\u0435\u0435\u0442\u0441\u044f 4 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 GET-\u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p><a href=\"http:\/\/localhost:9090\/djl\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:9090\/djl<\/a><\/p>\n<p><a href=\"http:\/\/localhost:9090\/forest\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:9090\/forest<\/a><\/p>\n<p><a href=\"http:\/\/localhost:9090\/gpu_test\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:9090\/gpu_test<\/a><\/p>\n<p><a href=\"http:\/\/localhost:9090\/xgboost\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:9090\/xgboost<\/a><\/p>\n<p>\u041b\u043e\u0433 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f DJL \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0432\u044b\u0448\u0435, \u043e\u043d \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d, \u043d\u0435\u0436\u0435\u043b\u0438 Spark Jobs.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u043e\u0433\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 Spark, \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0445 &#8212; \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u201c\u043f\u0440\u043e\u0433\u0440\u0435\u0432\u0430\u201d executor&#8217;\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 gpu_test.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9f4\/8b7\/2a1\/9f48b72a1f7b1c2759bf83af459f2c62.png\" width=\"1845\" height=\"951\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f4\/8b7\/2a1\/9f48b72a1f7b1c2759bf83af459f2c62.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0434\u0436\u043e\u0431\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 8\u0438 \u0441\u0435\u043a\u0443\u043d\u0434, \u0447\u0442\u043e, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u043e. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 (\u043a\u0440\u043e\u043c\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e &#8212; \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0432\u0435\u043b vmmem, \u0432\u044b\u0434\u0435\u043b\u0438\u0432 \u043f\u043e\u0434 WSL 25\u0413\u0431 \u041e\u0417\u0423):  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f3\/92a\/dcb\/3f392adcb557f8a84406334fb9d2ec3e.png\" width=\"1905\" height=\"377\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f3\/92a\/dcb\/3f392adcb557f8a84406334fb9d2ec3e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code>2022-07-19 14:05:13.856  INFO 1 --- [nio-9090-exec-4] o.a.spark.ml.tree.impl.RandomForest      :   init: 1.62514E-4   total: 3.192210057   findBestSplits: 3.17661902   chooseSplits: 3.166410779    2022-07-19 14:05:13.864  INFO 1 --- [nio-9090-exec-4] com.mlwebservice.service.SparkMLService  : best params map { rfr_dc03cc8c5712-maxBins: 100, rfr_dc03cc8c5712-maxDepth: 2, rfr_dc03cc8c5712-numTrees: 5 }  +------------------+------------------+--------------------+ |       fare_amount|        prediction|               error| +------------------+------------------+--------------------+ |              11.4|12.422369509009028|  1.0223695090090281| |               7.4| 7.289954038707909|-0.11004596129209165| |               5.0| 4.601351052403492| -0.3986489475965076| |               8.5| 8.773609129887804| 0.27360912988780406| |               7.4| 7.351427584678662|-0.04857241532133827| |               3.8| 4.509977888929194|  0.7099778889291946| |               5.4|6.1300686499042305|  0.7300686499042301| |               7.4| 5.310782694363023| -2.0892173056369776| |               5.3| 6.281121521712063|  0.9811215217120628| |               4.1| 4.320442646467865| 0.22044264646786527| |               4.2| 4.358399833924078| 0.15839983392407753| |              23.0| 21.84539235607258| -1.1546076439274202| |               6.2| 4.800643228448342| -1.3993567715516582| |              12.6|13.513431604134931|  0.9134316041349315| |               7.8| 7.289324492912175|  -0.510675507087825| |              11.0| 12.14859211003076|  1.1485921100307603| |              24.2| 19.82343367802233|   -4.37656632197767| |              10.6|  9.87204611828728|   -0.72795388171272| |              18.6|19.290663393934967|  0.6906633939349653| |11.800000000000002|12.322340133504676|  0.5223401335046738| +------------------+------------------+--------------------+ only showing top 20 rows  +-------+-----------------+------------------+--------------------+ |summary|      fare_amount|        prediction|               error| +-------+-----------------+------------------+--------------------+ |  count|             3000|              3000|                3000| |   mean|9.536166666666665| 9.535967764479922|-1.98902186749770...| | stddev|6.952558857268078|6.4554477337337675|  1.9208959387344227| |    min|              2.5|3.9593080769885773|  -69.80275612138105| |    max|            110.0|53.803333333333356|  12.055956289978678| +-------+-----------------+------------------+--------------------+  mae evaluation: 0.8626064049871519 rmse evaluation: 1.9205757730272761<\/code><\/pre>\n<p>Random forest \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e Spark Jobs, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0441 14:04:02 \u0434\u043e 14:05:15 (73 \u0441\u0435\u043a\u0443\u043d\u0434\u044b). <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ae\/5a5\/b4c\/1ae5a5b4cb5aea26e3474787b07f859f.png\" width=\"1813\" height=\"649\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ae\/5a5\/b4c\/1ae5a5b4cb5aea26e3474787b07f859f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>XGBoost \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 433-436 Spark Jobs, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 ~16 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/886\/422\/2f3\/8864222f3c00a23eafa823176f5f7b26.png\" width=\"1878\" height=\"470\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/886\/422\/2f3\/8864222f3c00a23eafa823176f5f7b26.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code>+------------------+------------------+--------------------+ |       fare_amount|        prediction|               error| +------------------+------------------+--------------------+ |              11.4|11.298457145690918|-0.10154285430908239| |               7.4| 7.516303539276123| 0.11630353927612269| |               5.0|  5.16908597946167| 0.16908597946166992| |               8.5| 9.045893669128418|   0.545893669128418| |               7.4| 7.355461597442627| -0.0445384025573734| |               3.8| 4.012299060821533| 0.21229906082153338| |               5.4|  5.95053768157959|  0.5505376815795895| |               7.4|       5.841796875| -1.5582031250000004| |               5.3| 6.106812000274658|  0.8068120002746584| |               4.1| 4.191019058227539| 0.09101905822753942| |               4.2|3.9211881160736084| -0.2788118839263918| |              23.0| 22.72040557861328|-0.27959442138671875| |               6.2| 4.528580665588379| -1.6714193344116213| |              12.6|  13.0178804397583| 0.41788043975830114| |               7.8| 7.767493724822998|-0.03250627517700...| |              11.0|11.349909782409668| 0.34990978240966797| |              24.2| 23.78424072265625| -0.4157592773437493| |              10.6|10.418869972229004|-0.18113002777099574| |              18.6| 19.02918243408203| 0.42918243408202983| |11.800000000000002|11.934724807739258| 0.13472480773925533| +------------------+------------------+--------------------+  +-------+-----------------+------------------+-------------------+ |summary|      fare_amount|        prediction|              error| +-------+-----------------+------------------+-------------------+ |  count|             3000|              3000|               3000| |   mean|9.536166666666665| 9.538236152251562|0.00206948558489451| | stddev|6.952558857268078|6.8646934667359885| 0.6205967386209823| |    min|              2.5|1.9244213104248047| -4.911700439453128| |    max|            110.0|106.85425567626953|  2.949781894683838| +-------+-----------------+------------------+-------------------+<\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e XGBoost \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043b\u0443\u0447\u0448\u0435, \u0441\u0443\u0434\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<h2>\u0413\u043b\u0430\u0434\u043a\u043e \u0431\u044b\u043b\u043e \u043d\u0430 \u0431\u0443\u043c\u0430\u0433\u0435\u2026<\/h2>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044f \u0441\u043f\u043e\u0439\u043b\u0435\u0440 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u0441\u0435. \u041d\u0430 \u0434\u0432\u0443\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0441 Docker Desktop \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0432\u0443\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. Network=host \u043d\u0435 \u0434\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0440\u043e\u0443\u0442\u044b \u0438 nginx proxy \u0442\u043e\u0436\u0435, \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b iptables \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 &#8212; \u0431\u0435\u0437\u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c Docker Swarm, \u043d\u043e \u0432\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u0430 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0430 \u0441 \u041e\u0421 Linux, \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0435\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0435, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0440\u043e\u0443\u0442\u044b \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0442\u0440\u0430\u0444\u0438\u043a \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043d\u043e\u0434\u044b \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u043f\u0435\u0440\u0432\u043e\u0439, \u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0440\u043e\u0443\u0442 \u0441 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0443, \u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043e\u0442 \u043c\u0430\u0441\u0442\u0435\u0440\u0430, \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043a\u0430\u0442\u0430\u0442\u044c Kubernetes, \u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a:<\/p>\n<p>\u0430) Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440 Spark \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 &#8212; \u043f\u043e \u0441\u0443\u0442\u0438 \u0431\u0440\u0435\u0434 \u0438 \u0430\u043f\u0440\u0438\u043e\u0440\u0438 overhead, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0443\u0442\u044c Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043c\u0430\u043b\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u043e\u0434 \u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Docker \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0438 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0447\u0438\u0441\u0442\u0443\u044e \u041e\u0421;<\/p>\n<p>\u0431) \u0415\u0441\u043b\u0438 Kubernetes, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0445 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u043a, \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0438 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Kubernetes Operator &#8212; \u0432\u043e\u0442 \u0432 \u044d\u0442\u043e\u043c \u043e\u043f\u044b\u0442\u0430 \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435\u0442, \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044d\u0442\u043e \u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438;<\/p>\n<p>\u0432) \u201c\u0412\u0441\u0435, \u0441\u0442\u043e\u043f, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u0431\u0435\u0440 \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0440\u0430\u0441\u043a\u0430\u0442\u0430\u0442\u044c, \u0445\u0432\u0430\u0442\u0438\u0442 \u0441\u0442\u0440\u0430\u0434\u0430\u0442\u044c \u0444\u0438\u0433\u043d\u0435\u0439\u201d &#8212; \u0440\u0430\u0437\u0434\u0430\u043b\u043e\u0441\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435, \u0438 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \ud83d\ude42<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0435\u043d\u044f \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0431\u0440\u0430\u0434\u043e\u0432\u0430\u043b &#8212; \u0440\u0430\u0431\u043e\u0442\u0430 XGBoost \u0432\u0441\u0442\u0430\u043b\u0430 \u043d\u0430 \u0448\u0430\u0433\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0447\u0442\u043e \u0443\u0441\u043f\u0435\u043b \u0437\u0430\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u0442\u044c \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/62a\/eab\/94a\/62aeab94aad7b6b1f56f3c6c274611c8.png\" width=\"1892\" height=\"962\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/62a\/eab\/94a\/62aeab94aad7b6b1f56f3c6c274611c8.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u0447\u0438\u0442\u0430\u044e \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u043e\u0439. \u0412\u0441\u0435 \u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u043c\u0438, \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Java, \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u0430\u043a Spring Web Service, \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 GPU \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c? \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e:<\/p>\n<ol>\n<li>\n<p>\u0422\u044e\u043d\u0438\u043d\u0433 Spark. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Kryo serializer. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Rapids 22.06.0 \u0443 \u043c\u0435\u043d\u044f \u043e\u043d \u0442\u0430\u043a \u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u041a\u0440\u043e\u043c\u0435 Kryo \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e Spark, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a Spark Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 bare metal \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c Ubuntu 20.04.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 Kubernetes \u0432 \u043f\u0430\u0440\u0435 \u0441 Spark Kubernetes Operator. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0433\u0430\u0439\u0434 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0442\u0435\u043c\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 R&amp;D \u0432 ML \u0438 Spark.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h2>\n<details class=\"spoiler\">\n<summary>\u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<h3>Common interesting articles<\/h3>\n<p><a href=\"https:\/\/developer.nvidia.com\/blog\/accelerating-spark-3-0-and-xgboost-end-to-end-training-and-hyperparameter-tuning\/\" rel=\"noopener noreferrer nofollow\">Accelerating Spark 3.0 and XGBoost End-to-End Training and Hyperparameter Tuning<\/a><\/p>\n<p><a href=\"https:\/\/www.infoq.com\/articles\/deep-learning-apache-spark-nvidia-gpu\/\" rel=\"noopener noreferrer nofollow\">Accelerating Deep Learning on the JVM with Apache Spark and NVIDIA GPUs<\/a><\/p>\n<p><a href=\"https:\/\/medium.com\/p\/3c58dd5fb5f8\/edit\" rel=\"noopener noreferrer nofollow\">How Amazon retail systems run machine learning predictions with Apache Spark using Deep Java Library<\/a><\/p>\n<p><a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/opensource\/how-netflix-uses-deep-java-library-djl-for-distributed-deep-learning-inference-in-real-time\/\" rel=\"noopener noreferrer nofollow\">How Netflix uses Deep Java Library (DJL) for distributed deep learning inference in real-time<\/a><\/p>\n<p><a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/opensource\/adopting-machine-learning-in-your-microservices-with-djl-deep-java-library-and-spring-boot\/\" rel=\"noopener noreferrer nofollow\">Adopting machine learning in your microservices with DJL (Deep Java Library) and Spring Boot<\/a><\/p>\n<p><a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/get-started\/getting-started-on-prem.html\" rel=\"noopener noreferrer nofollow\">Getting Started with RAPIDS Accelerator with on premise cluster or local mode<\/a><\/p>\n<p><a href=\"https:\/\/developer.nvidia.com\/blog\/accelerating-apache-spark-3-0-with-gpus-and-rapids\/\" rel=\"noopener noreferrer nofollow\">Accelerating Apache Spark 3.0 with GPUs and RAPIDS<\/a><\/p>\n<p><a href=\"https:\/\/aws.amazon.com\/blogs\/opensource\/leverage-deep-learning-in-scala-with-gpu-on-spark-3-0\/\" rel=\"noopener noreferrer nofollow\">Leverage deep learning in Scala with GPU on Spark 3.0<\/a><\/p>\n<p><a href=\"https:\/\/www.infoq.com\/articles\/deep-learning-apache-spark-nvidia-gpu\/\" rel=\"noopener noreferrer nofollow\">Accelerating Deep Learning on the JVM with Apache Spark and NVIDIA GPUs<\/a><\/p>\n<h3>nVidia documentation<\/h3>\n<p><a href=\"https:\/\/docs.nvidia.com\/deeplearning\/frameworks\/user-guide\/index.html\" rel=\"noopener noreferrer nofollow\">nVidia docker containers documentation<\/a><\/p>\n<p><a href=\"https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html\" rel=\"noopener noreferrer nofollow\">CUDA on WSL User Guide<\/a><\/p>\n<p><a href=\"https:\/\/www.performatune.com\/en\/how-to-install-cuda-toolkit-on-ubuntu-18-04-lts\/#:~:text=The%20public%20CUDA%20GPG%20key,%2D1%2Dlocal%2D10.1.\" rel=\"noopener noreferrer nofollow\">How to install CUDA Toolkit on Ubuntu 18.04 LTS\u200a\u2014\u200aPerformatune<\/a><\/p>\n<p><a href=\"https:\/\/www.docker.com\/blog\/wsl-2-gpu-support-for-docker-desktop-on-nvidia-gpus\/\" rel=\"noopener noreferrer nofollow\">WSL 2 GPU Support for Docker Desktop on NVIDIA GPUs\u200a\u2014\u200aDocker<\/a><\/p>\n<p><a href=\"https:\/\/catalog.ngc.nvidia.com\/orgs\/nvidia\/containers\/cuda\/tags\" rel=\"noopener noreferrer nofollow\">nVidia Docker images<\/a><\/p>\n<h3>nVidia Rapids documentation<\/h3>\n<p><a href=\"https:\/\/docs.rapids.ai\/start\" rel=\"noopener noreferrer nofollow\">Get Started\u200a\u2014\u200aRAPIDS Docs<\/a><\/p>\n<p><a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/get-started\/getting-started-on-prem.html\" rel=\"noopener noreferrer nofollow\">On-Prem<\/a><\/p>\n<p><a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/get-started\/getting-started-on-prem.html#example-join-operation\" rel=\"noopener noreferrer nofollow\">On-Prem\u200a\u2014\u200aExample Join Operation<\/a><\/p>\n<h3>nVidia ML documentation<\/h3>\n<p><a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/predictive-analytics-spark-machine-learning\/\" rel=\"noopener noreferrer nofollow\">Predictive Analytics Tutorial with Spark ML | NVIDIA<\/a><\/p>\n<p><a href=\"https:\/\/www.nvidia.com\/en-us\/ai-data-science\/spark-ebook\/tutorial-gpu-accelerated-xgboost\/\" rel=\"noopener noreferrer nofollow\">What\u2019s New in Deep Learning &amp; Artificial Intelligence from NVIDIA<\/a><\/p>\n<p>Spark ML library documentation:<\/p>\n<p><a href=\"https:\/\/spark.apache.org\/docs\/latest\/ml-classification-regression.html#random-forests\" rel=\"noopener noreferrer nofollow\">Classification and regression\u200a\u2014\u200aSpark 3.3.0 Documentation<\/a><\/p>\n<p><a href=\"https:\/\/spark.apache.org\/docs\/latest\/mllib-ensembles.html#random-forests\" rel=\"noopener noreferrer nofollow\">Ensembles\u200a\u2014\u200aRDD-based API\u200a\u2014\u200aSpark 3.3.0 Documentation<\/a><\/p>\n<h3>DJL<\/h3>\n<p><a href=\"https:\/\/docs.djl.ai\/\" rel=\"noopener noreferrer nofollow\">Main\u200a\u2014\u200aDeep Java Library<\/a><\/p>\n<p><a href=\"http:\/\/djl.ai\/examples\/\" rel=\"noopener noreferrer nofollow\">Examples<\/a><\/p>\n<p><a href=\"http:\/\/docs.djl.ai\/docs\/development\/troubleshooting.html#troubleshooting\" rel=\"noopener noreferrer nofollow\">Troubleshooting\u200a\u2014\u200aDeep Java Library<\/a><\/p>\n<p><a href=\"https:\/\/towardsdatascience.com\/deep-learning-with-spark-in-deep-java-library-in-10-minutes-923a73704094\" rel=\"noopener noreferrer nofollow\">Deep Learning with Spark in Deep Java Library in 10 minutes<\/a><\/p>\n<p><a href=\"https:\/\/towardsdatascience.com\/deep-java-library-djl-a-deep-learning-toolkit-for-java-developers-55d5a45bca7e\" rel=\"noopener noreferrer nofollow\">Deep Java Library(DJL)\u200a\u2014\u200aa Deep Learning Toolkit for Java Developers<\/a><\/p>\n<p><a href=\"https:\/\/d2l.djl.ai\/chapter_deep-learning-computation\/use-gpu.html\" rel=\"noopener noreferrer nofollow\">5.5. GPUs\u200a\u2014\u200aDive into Deep Learning 0.1.0 documentation<\/a><\/p>\n<p><a href=\"https:\/\/docs.djl.ai\/docs\/development\/dependency_management.html\" rel=\"noopener noreferrer nofollow\">DJL dependency management\u200a\u2014\u200aDeep Java Library<\/a><\/p>\n<p><a href=\"https:\/\/d2l.djl.ai\/chapter_linear-networks\/linear-regression-scratch.html\" rel=\"noopener noreferrer nofollow\">3.2. Linear Regression Implementation from Scratch\u200a\u2014\u200aDive into Deep Learning 0.1.0 documentation<\/a><\/p>\n<p><a href=\"https:\/\/d2l.djl.ai\/chapter_linear-networks\/linear-regression-djl.html\" rel=\"noopener noreferrer nofollow\">3.3. Concise Implementation of Linear Regression<\/a><\/p>\n<h3>XGBoost Java\u00a0library<\/h3>\n<p><a href=\"https:\/\/github.com\/dmlc\/xgboost\" rel=\"noopener noreferrer nofollow\">GitHub\u200a\u2014\u200admlc\/xgboost: Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/dmlc\/xgboost\/tree\/master\/jvm-packages\/xgboost4j-example\" rel=\"noopener noreferrer nofollow\">xgboost\/jvm-packages\/xgboost4j-example at master \u00b7 dmlc\/xgboost<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/dmlc\/xgboost\/blob\/master\/jvm-packages\/xgboost4j-example\/src\/main\/scala\/ml\/dmlc\/xgboost4j\/scala\/example\/spark\/SparkMLlibPipeline.scala\" rel=\"noopener noreferrer nofollow\">xgboost\/SparkMLlibPipeline.scala at master \u00b7 dmlc\/xgboost<\/a><\/p>\n<p><a href=\"https:\/\/xgboost.ai\/2016\/10\/26\/a-full-integration-of-xgboost-and-spark.html\" rel=\"noopener noreferrer nofollow\">A Full Integration of XGBoost and Apache Spark<\/a><\/p>\n<p><a href=\"https:\/\/xgboost.readthedocs.io\/en\/latest\/jvm\/xgboost4j_spark_gpu_tutorial.html\" rel=\"noopener noreferrer nofollow\">XGBoost4J-Spark-GPU Tutorial (version 1.6.1+)\u200a\u2014\u200axgboost 2.0.0-dev documentation<\/a><\/p>\n<p><a href=\"https:\/\/xgboost.readthedocs.io\/en\/stable\/jvm\/xgboost4j_spark_gpu_tutorial.html#prediction\" rel=\"noopener noreferrer nofollow\">XGBoost4J-Spark-GPU Tutorial (version 1.6.1+)\u200a\u2014\u200axgboost 1.6.1 documentation<\/a><\/p>\n<p><a href=\"https:\/\/xgboost.readthedocs.io\/en\/stable\/jvm\/javadocs\/index.html\" rel=\"noopener noreferrer nofollow\">xgboost4j_2.12 1.6.1 API<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/NVIDIA\/spark-rapids-examples\/blob\/branch-22.06\/docs\/get-started\/xgboost-examples\/on-prem-cluster\/kubernetes-scala.md\" rel=\"noopener noreferrer nofollow\">spark-rapids-examples\/kubernetes-scala.md at branch-22.06 \u00b7 NVIDIA\/spark-rapids-examples<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/NVIDIA\/spark-rapids-examples\/blob\/branch-22.06\/examples\/XGBoost-Examples\/taxi\/scala\/src\/com\/nvidia\/spark\/examples\/taxi\/Taxi.scala\" rel=\"noopener noreferrer nofollow\">spark-rapids-examples\/Taxi.scala at branch-22.06 \u00b7 NVIDIA\/spark-rapids-examples<\/a><\/p>\n<h3>For debugging<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/31749593\/how-to-extract-best-parameters-from-a-crossvalidatormodel\" rel=\"noopener noreferrer nofollow\">How to extract best parameters from a CrossValidatorModel<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/70243938\/use-shared-library-that-uses-glibc-on-alpinelinux\" rel=\"noopener noreferrer nofollow\">Use shared library that uses glibc on AlpineLinux<\/a><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/679248\/\"> https:\/\/habr.com\/ru\/post\/679248\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GPU nVidia \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 CUDA \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445. \u0426\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Big Data Tool Apache Spark \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0430\u043a\u0441\u0435\u043b\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c GPU \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 Rapids \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 nVidia CUDA, \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a DJL, Spark ML, XGBoost, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Spring Boot \u043d\u0430 Java 8 (\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 Rapids), \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u041e\u0421 Windows 10 Pro \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0422\u0435 \u0436\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Kubernetes.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f &#8212; \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u041e\u0421 Windows 10 Pro. \u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WSL2 (Linux Subsystem for Windows), \u043d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 &#8212; <a href=\"https:\/\/github.com\/rapidsai\/cudf\/issues\/9427\" rel=\"noopener noreferrer nofollow\">\u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Rapids \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Pascal<\/a>, \u0442.\u0435. \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432 \u0441\u0440\u0435\u0434\u0435 Windows \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 nVidia \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Turing (\u0441\u0435\u0440\u0438\u0438 1600, 2000) \u0438 \u0432\u044b\u0448\u0435. \u041f\u043e\u0434 OC Linux \u043a\u0430\u0440\u0442\u044b \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Pascal \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0443\u0442, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435 \u043d\u0430 Ubuntu 20.04 (\u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430, Debian 10 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c), \u043d\u043e \u043d\u0435 \u0432\u044b\u0448\u0435 &#8212; <a href=\"https:\/\/nvidia.github.io\/spark-rapids\/docs\/download.html\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 Rapids<\/a>.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 Java. \u0412 \u043c\u0438\u0440\u0435 Spark (\u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e Spark ML) \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Scala. Scala \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u0438 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u0442, \u0430 \u0432\u043e\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c Spark \u0438 ML \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430 \u0437\u0430\u0434\u0430\u0447 \u0438\u043c\u0435\u0435\u0442\u0441\u044f. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e Scala \u0438 Java \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b \u0432 \u0441\u0440\u0435\u0434\u0435 Spark, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 Python, \u0438 \u0447\u0442\u043e \u043d\u0430 Java \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u044f\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a ML, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441\u043e Spark, \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0441\u0435\u0431\u044f \u0436\u0434\u0430\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u043d\u0430 Windows 10 Pro, GeForce RTX 2060 \u0438 1080 Ti (\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430 Windows \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e), \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 \u043a\u0430\u0440\u0442\u043e\u0439 GeForce 1650. \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u044f\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0432\u0441\u0435 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 Ubuntu 20.04, \u043e\u0442\u0432\u0435\u0447\u0430\u044e: \u0430) \u0442\u0430\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442, \u0432\u044b \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435; \u0431) \u043d\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (Cloud \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 GPU).<\/p>\n<p>\u0426\u0435\u043b\u0435\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422.\u0435. \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0432\u0443\u0445 \u0434\u043e n \u043d\u043e\u0434, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442 1 \u0434\u043e m GPU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, docker runtime \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c Spark worker, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b GPU.<\/p>\n<p>Hardware \u0438 software \u0441\u043b\u043e\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0445\u0435\u043c\u043e\u0439:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e\u043a\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 ML \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 Apache Spark: \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Standalone \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Apache Spark \u0441 \u043e\u0434\u043d\u0438\u043c Master \u0443\u0437\u043b\u043e\u043c, \u0434\u0432\u0443\u043c\u044f Worker \u0443\u0437\u043b\u0430\u043c\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445, \u0438 Spring Boot Java 8 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a DJL, Spark ML \u0438 XGBoost \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440 &#8212; \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043d\u0435 \u0432\u0441\u0435, \u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 Linux).<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Embedded \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 nVidia \u0434\u043b\u044f IoT-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0435\u0441\u044c \u043d\u0438\u0436\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/gitlab.com\/AlexPit\/java-ml-spark-example\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitLab<\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0412\u0441\u0435 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 Windows 10 Pro. \u0412\u0430\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043d\u0438\u0436\u0435 Pro, \u0438 \u0441\u0431\u043e\u0440\u043a\u0435 Windows 10 Build 19043.1263 (21H1).<\/p>\n<p>WSL, Docker \u0438 CUDA \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f WSL 5.10.16.3+;<\/p>\n<p>Docker 19.03+.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Windows Terminal \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430: PowerShell, cmd, Ubuntu.<\/p>\n<h3>nVidia driver, CUDA<\/h3>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f nVidia CUDA \u043d\u0435 \u043d\u0438\u0436\u0435 11.7. \u0414\u0440\u0430\u0439\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043c\u0435\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u044e 516.40. <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 CUDA \u043c\u043e\u0436\u043d\u043e, \u043e\u0442\u043a\u0440\u044b\u0432 Powershell (\u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <\/p>\n<pre><code class=\"bash\">nvidia-smi<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>WSL &#8212; Windows Subsystem for Linux<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPU \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u041f\u041e \u043e\u0442 nVidia (\u0441\u043c \u043d\u0438\u0436\u0435), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 WSL2.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u041f\u041a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f WSL \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"bash\">wsl --install<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 WSL \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Ubuntu, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c 2.<\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f Ubuntu \u0434\u043b\u044f Windows \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u043d\u0435<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e WSL \u0432 Powershell <\/p>\n<pre><code class=\"bash\">wsl -l -v<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u0435\u0440\u0441\u0438\u044f Ubuntu 1, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c<\/p>\n<pre><code class=\"bash\">wsl --set-version Ubuntu-20.04 2<\/code><\/pre>\n<h3>Docker Desktop<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Docker Desktop, \u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0435\u0437 Docker Desktop, \u043c\u043e\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u042f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043e\u0431\u0430 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \u201cUse WSL 2 based engine\u201d \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>Apply &amp; Restart.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 wsl \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 Docker \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<\/p>\n<pre><code class=\"bash\">docker run -d -p 5000:5000 --restart=always --name registry registry:2<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 docker registry, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.  <\/p>\n<pre><code class=\"bash\">docker ps CONTAINER ID   IMAGE        COMMAND                  CREATED         STATUS         PORTS                    NAMES 745b50d66906   registry:2   \"\/entrypoint.sh \/etc\u2026\"   2 minutes ago   Up 2 minutes   0.0.0.0:5000->5000\/tcp   registry<\/code><\/pre>\n<h3>CUDA Support for WSL 2<\/h3>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b CUDA \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 nVidia \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>. <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u0432 PowerShell \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"powershell\">wsl sudo -i apt-key del 7fa2af80 wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/wsl-ubuntu\/x86_64\/cuda-wsl-ubuntu.pin mv cuda-wsl-ubuntu.pin \/etc\/apt\/preferences.d\/cuda-repository-pin-600 wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/11.7.0\/local_installers\/cuda-repo-wsl-ubuntu-11-7-local_11.7.0-1_amd64.deb # see the output of the previosly command cp \/var\/cuda-repo-wsl-ubuntu-11-7-local\/cuda-B81839D3-keyring.gpg \/usr\/share\/keyrings\/ apt-get update apt-get -y install cuda<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u043d\u0435 PowerShell \u0440\u0430\u0431\u043e\u0442\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 nVidia \u0441 \u0444\u043b\u0430\u0433\u043e\u043c benchmark:<\/p>\n<pre><code class=\"bash\">docker run --gpus all nvcr.io\/nvidia\/k8s\/cuda-sample:nbody nbody -gpu -benchmark<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u0432\u0441\u0435 \u0448\u0430\u0433\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043c\u0435\u043b\u0438 \u043c\u0435\u0441\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 nVidia <a href=\"https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c <\/a>\u0438 <a href=\"https:\/\/forums.developer.nvidia.com\/t\/guide-to-run-cuda-wsl-docker-with-latest-versions-21382-windows-build-470-14-nvidia\/178365\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0434\u043b\u044f \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/h2>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Rapids \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Java 8, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u043f\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 Docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0438 \u0441\u0430\u043c\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 Spark Workers<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437. \u041d\u0438\u0436\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 Dockerfile.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Ubuntu 20.04 \u0441 CUDA 11.7.0 \u0438\u0437 <a href=\"https:\/\/catalog.ngc.nvidia.com\/orgs\/nvidia\/containers\/cuda\/tags\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 nVidia<\/a>. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441 Ubuntu \u0432\u0435\u0440\u0441\u0438\u0438 22.04 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u041f\u041e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u041f\u041e.<\/p>\n<pre><code>FROM nvcr.io\/nvidia\/cuda:11.7.0-devel-ubuntu20.04  ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'  ARG DEBIAN_FRONTEND=noninteractive  RUN apt-get update &amp;&amp; apt install -y bash tini libc6 libpam-modules libnss3 procps nano iputils-ping net-tools  RUN apt-get update &amp;&amp; \\ apt-get install -y openjdk-8-jdk &amp;&amp; \\ apt-get install -y ant &amp;&amp; \\ apt-get clean &amp;&amp; \\ rm -rf \/var\/lib\/apt\/lists\/* &amp;&amp; \\ rm -rf \/var\/cache\/oracle-jdk8-installer;  # Fix certificate issues RUN apt-get update &amp;&amp; \\ apt-get install -y ca-certificates-java &amp;&amp; \\ apt-get clean &amp;&amp; \\ update-ca-certificates -f &amp;&amp; \\ rm -rf \/var\/lib\/apt\/lists\/* &amp;&amp; \\ rm -rf \/var\/cache\/oracle-jdk8-installer;  # Setup JAVA_HOME, this is useful for docker commandline ENV JAVA_HOME \/usr\/lib\/jvm\/java-8-openjdk-amd64\/ RUN export JAVA_HOME  CMD [\"tail\", \"-f\", \"\/dev\/null\"] <\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0432 \u043e\u0431\u0440\u0430\u0437\u0435 JDK \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f openjdk8, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c Rapids \u0438 \u043d\u0435 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435\u043c Oracle JDK. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043e\u0431\u0440\u0430\u0437 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0434\u0435\u0431\u0430\u0433\u0430.<\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f CMD \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430, \u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 nVidia \u0441 \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439 \u201cdevel\u201d &#8212; \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0437:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 devel &#8212; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u201cnvcc\u201d. <\/p>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">docker build -f Dockerfile-cuda-java8 -t localhost:5000\/cuda-jdk8:v1 .<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, \u043c\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c Kubernetes \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u0437 localhost:5000, \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0445, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.  <\/p>\n<\/blockquote>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">docker run --gpus all --name=cuda-jdk8 -it -d localhost:5000\/cuda-jdk8:v1<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0432\u0430\u0436\u043d\u044b\u043c \u0444\u043b\u0430\u0433\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u201c&#8212;gpus\u201d, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u201call\u201d &#8212; \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u043b\u0430\u0433\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b gpu \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<pre><code class=\"bash\">$ nvidia-smi Sun Jul 10 13:58:20 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.48.07    Driver Version: 516.40       CUDA Version: 11.7     | |-------------------------------+----------------------+----------------------+ | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC | | Fan  Temp  Perf  Pwr:Usage\/Cap|         Memory-Usage | GPU-Util  Compute M. | |                               |                      |               MIG M. | |===============================+======================+======================| |   0  NVIDIA GeForce ...  On   | 00000000:0B:00.0  On |                  N\/A | |  0%   42C    P8    20W \/ 250W |   1241MiB \/ 11264MiB |      4%      Default | |                               |                      |                  N\/A |<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-336221","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336221","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=336221"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336221\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}