{"id":9709,"date":"2018-05-25T19:21:14","date_gmt":"2018-05-25T10:21:14","guid":{"rendered":"https:\/\/www.hardkernel.com\/?p=9709"},"modified":"2018-12-10T11:02:46","modified_gmt":"2018-12-10T02:02:46","slug":"mali-gpu-accelerated-qt5-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.hardkernel.com\/ko\/blog\/mali-gpu-accelerated-qt5-on-ubuntu-18-04\/","title":{"rendered":"Mali GPU accelerated Qt5 on Ubuntu 18.04"},"content":{"rendered":"<p><span style=\"font-family: arial;\">Ubuntu 18.04 Bionic comes with Qt 5.9.5 by default.<\/span><br \/>\n<span style=\"font-family: arial;\">But, Canonical has built it without considering the ARM Mali GPU detection and Qt5 didn&#8217;t work on Ubuntu 18.04 at all.<\/span><br \/>\n<span style=\"font-family: arial;\">So we have to build the Qt5 source code manually.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9648\" src=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251847459960.jpg\" alt=\"\" width=\"535\" height=\"410\" srcset=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251847459960.jpg 535w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251847459960-247x189.jpg 247w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251847459960-510x391.jpg 510w\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" \/><\/p>\n<div><\/div>\n<div><span style=\"font-family: arial;\">Here is a quick and dirty build guide. I tested on the latest XU4 Ubuntu 18.04 Bionic image.<br \/>\n<\/span><\/div>\n<div>Update.<\/div>\n<pre>sudo apt update &amp;&amp; sudo apt upgrade &amp;&amp; sudo apt dist-upgrade<\/i><\/pre>\n<div><\/div>\n<div>Install build-depends and source code.<\/div>\n<pre>sudo apt build-dep qt5-default\r\napt source qtbase5-dev\r\ncd qtbase-opensource-src-5.9.5+dfsg<\/pre>\n<div><\/div>\n<div>Edit a file for correct detecting the ARM&#8217;s Mali GPU.<br \/>\n<i>Line 86 : src\/platformsupport\/eglconvenience\/qxlibeglintegration.cpp<\/i><\/div>\n<div>to : <code><i>if (vendor &amp;&amp; (strstr(vendor, \"Vivante\") || strstr(vendor, \"ARM\"))) {<\/i><\/code><\/div>\n<div>from : <code><i>if (vendor &amp;&amp; strstr(vendor, \"Vivante\")) {<\/i><\/code><\/div>\n<div><\/div>\n<div>Another file should be edited to avoid a compile error. I wasted several hours to find this simple solution.<br \/>\n<i>src\/plugins\/platforms\/eglfs\/deviceintegration\/eglfs_kms_egldevice\/qeglfskmsegldevice.cpp<br \/>\nhttp:\/\/code.qt.io\/cgit\/qt\/qtbase.git\/commit\/?h=dev&amp;id=9a640e7bc67b0a1ff5c61c63703b669e6f24521e<\/i>Create two symlinks for proper OpenGL-ES detection. This fix will be included in the next update probably.<\/div>\n<pre>sudo rm \/usr\/lib\/arm-linux-gnueabihf\/libGLESv2.so.2.0.0\r\nsudo rm \/usr\/lib\/arm-linux-gnueabihf\/libEGL.so.1.0.0\r\nsudo ln -s \/usr\/lib\/arm-linux-gnueabihf\/mali-egl\/libmali.so \/usr\/lib\/arm-linux-gnueabihf\/libGLESv2.so.2.0.0<\/i>\r\nsudo ln -s \/usr\/lib\/arm-linux-gnueabihf\/mali-egl\/libmali.so \/usr\/lib\/arm-linux-gnueabihf\/libEGL.so.1.0.0<\/i><\/pre>\n<div><\/div>\n<div>Build Qt5<\/div>\n<pre>sudo dpkg-buildpackage -b<\/pre>\n<div><\/div>\n<div><\/div>\n<div>I met this error when I ran it on a SSH session.<br \/>\n<i>Project ERROR: QtDBus is enabled but session bus is not available. Please check the installation.<\/i><br \/>\nWhen I built it on the Mate desktop terminal instead of the remote ssh access, the build had no issue. It is still not understandable.After 2~3 hours of boring build time, the &#8220;debian packaging&#8221; failed due to a missing PGP key.<br \/>\nBut all the Qt5 libraries with examples were generated correctly and I could install them with\u00a0<i>sudo make install\u00a0<\/i>command.Qt-OpenGL example works beautifully now.<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9650\" src=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251902540571.jpg\" alt=\"\" width=\"800\" height=\"469\" srcset=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251902540571.jpg 800w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251902540571-768x450.jpg 768w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251902540571-247x145.jpg 247w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805251902540571-510x299.jpg 510w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div><span style=\"font-family: arial;\">We will test the stability and functionality for a couple of weeks.<\/span><\/div>\n<div><span style=\"font-family: arial;\">If there is no critical issue, we will release it officially.<\/span><\/div>\n<div><span style=\"font-family: arial;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial;\">Feel free to post your idea on the forum thread.<\/span><\/div>\n<div><span style=\"font-family: arial;\"><b><a href=\"https:\/\/forum.odroid.com\/viewtopic.php?f=95&amp;t=31070\" target=\"_blank\" rel=\"noopener\">https:\/\/forum.odroid.com\/viewtopic.php?f=95&amp;t=31070<\/a><\/b><\/span><\/div>\n<div><span style=\"font-family: arial;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial;\"><b>A few interesting Qt5 base applications for Linux users<br \/>\n<\/b><\/span><\/div>\n<div><span style=\"font-family: arial;\">\u00a0<\/span><\/div>\n<div><i style=\"font-family: arial; color: #555555;\"><b>OpenCV<\/b><\/i><span style=\"font-family: arial; color: #555555;\">\u00a0(Open Source Computer Vision Library) is an open source computer vision and machine learning software library.<\/span><\/div>\n<div>\n<div><span style=\"font-family: arial;\">Qt5 framework is used with OpenCV for image processing visualization as well as interactive user interface.<\/span><\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9652\" src=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260931283679.jpg\" alt=\"\" width=\"1298\" height=\"767\" srcset=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260931283679.jpg 1298w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260931283679-800x473.jpg 800w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260931283679-768x454.jpg 768w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260931283679-247x146.jpg 247w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260931283679-510x301.jpg 510w\" sizes=\"auto, (max-width: 1298px) 100vw, 1298px\" \/><\/p>\n<div><\/div>\n<div><span style=\"font-family: arial;\"><i><b>Calligra<\/b><\/i>\u00a0: It offers a comprehensive set of 8 applications which satisfies the office, graphics and management needs.<br \/>\nWord, Presentation, Spreadsheet and many more. Simply run &#8220;sudo apt install calligra-libs&#8221; command to play with it.<\/span><\/div>\n<p><span style=\"font-family: arial;\"><img decoding=\"async\" src=\"http:\/\/www.calligra.org\/wp-content\/uploads\/2012\/04\/calligra_2.4_tour_words3.jpg\" border=\"0\" \/><br \/>\n<\/span><\/p>\n<div><span style=\"font-family: arial;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial;\"><img decoding=\"async\" src=\"http:\/\/www.calligra.org\/wp-content\/uploads\/2012\/04\/calligra_2.4_tour_sheets3.jpg\" border=\"0\" \/><\/span><\/div>\n<div><span style=\"font-family: arial;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial;\"><i><b>Calibre<\/b><\/i>\u00a0: It is a powerful and easy to use e-book manager.<br \/>\nSimply run &#8220;sudo apt install calibre&#8221; command to read tons of great e-books.<\/span><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9655\" src=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260858380629.jpg\" alt=\"\" width=\"800\" height=\"555\" srcset=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260858380629.jpg 800w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260858380629-768x533.jpg 768w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260858380629-247x171.jpg 247w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260858380629-510x354.jpg 510w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><i><b>Stellarium<\/b><\/i>\u00a0is a free open source planetarium for your computer.<br \/>\nIt shows a realistic sky in 3D, just like what you see with the naked eye, binoculars or a telescope.<\/div>\n<p>Running &#8220;sudo apt install stellarium&#8221; is enough to enjoy the virtual sky on your ODROID-XU4.<\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9657\" src=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260946572448.jpg\" alt=\"\" width=\"670\" height=\"501\" srcset=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260946572448.jpg 670w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260946572448-247x185.jpg 247w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260946572448-510x381.jpg 510w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/p>\n<p>Krita is a professional and open source painting program. It is made by artists that want to see affordable art tools for everyone.<br \/>\nUnfortunately, Krita for ARM platform in Ubuntu 18.04 PPA was broken and it will be fixed by Canonical soon. It is available in Ubuntu 16.04 PPA only.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-9661\" src=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260911008113.jpg\" alt=\"\" width=\"800\" height=\"476\" srcset=\"https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260911008113.jpg 800w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260911008113-768x457.jpg 768w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260911008113-247x147.jpg 247w, https:\/\/www.hardkernel.com\/wp-content\/uploads\/2018\/11\/201805260911008113-510x303.jpg 510w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04 Bionic comes with Qt 5.9.5 by default. But, Canonical has built it without considering the ARM Mali GPU detection and Qt5 didn&#8217;t work on Ubuntu 18.04 at all. So we have to build the Qt5 source code manually. Here is a quick and dirty build guide. I tested on the latest XU4 Ubuntu [&#8230;]\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18463],"tags":[20878],"class_list":["post-9709","post","type-post","status-publish","format-standard","hentry","category-blog","tag-odroid-xu4"],"_links":{"self":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts\/9709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/comments?post=9709"}],"version-history":[{"count":3,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts\/9709\/revisions"}],"predecessor-version":[{"id":12095,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts\/9709\/revisions\/12095"}],"wp:attachment":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/media?parent=9709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/categories?post=9709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/tags?post=9709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}