Jump to content

Unable to make Panfrost work on H6


NicoD

Recommended Posts

Hi, Armbian gurus.

 

I just try the latest kernel & modules(including /boot, /lib/modules/5.8.7-sunxi64 ) ripped out and put into my working panfrost(mostly)/DRM-Plane ready image.

Anything graphical including X window and Kodi become unbearably slow somehow.

I'm reading over the kernel configuration, but allow me to ask this at the same time:

 

Besides the kernel and module configuration, is there other factor might cause this?

Should I use the earlier DTB/DTS from my previous working version? Any chance to conflict with 5.8 kernel or other side effect?

 

Thank you.

 

Link to comment
Share on other sites

On 8/14/2020 at 8:54 AM, Chuck the Duck said:

Thanks to Werner, I have a stable desktop on my Orange Pi 3 running the Armbian_20.05.4_Orangepi3_focal_current_5.4.45_desktop.img.xz (stable release).  MOD can put this elsewhere if it belongs in tutorials and not bugs.

 

Here is how to step through his fix for anyone new to linux (like myself).

1. After flashing and setting root and user, the user will be logged into the graphical Xfce desktop environment (DE) and will freeze soon.

2. On the next reboot you can try to use one of the separate terminals instead of the DE.  This is done by holding CTRL+ALT and selecting F1-F6

3. Quickly log into root account and type the following "sudo systemctl set-default multi-user"  This will disable the DE next time you load.

4. The system may freeze as the DE is being loaded, so its best to reset and log into the bash shell with root again.

5. We have to setup a shell script that runs every boot, as the files that Werner overwrites get replaced every time. We will edit/etc/rc.local

6. Goto "cd /etc/ " and chose your favorite editor.  I used vim, so I type "vim rc.local" to start editing.

7.  Add the lines that Werner posted earlier to the rc.local file 


cd /sys/devices/platform/soc/1800000.gpu/devfreq/1800000.gpu/
echo userspace > governor
echo 756000000 > max_freq
echo 756000000 > min_freq

8. Save and exit to shell.

9. last step is to enable the DE again, type "systemctl set-default graphical"

10.  Reboot and enjoy a stable desktop.

 

It took me about a day to have this working, mainly because of me not understanding the the GPU clock values were getting reset and not knowing unix commands & file structure.  It reminded me as a kid messing with the autoexec.bat on a ms-dos machine.  I am hoping to use an SDR and make this into a HD Radio Decoder (already built the NRSC-5 & GUI) , have it stream to an android head unit in my car & control via VNC.

 

Could someone inform me if this is all that needs to be done? 
I'm back using the H6. I've updated my install script for panfrost with an H6 install with this code added to do the above :
 

function h6 {
cat <<EOT >> /etc/rc.local
cd /sys/devices/platform/soc/1800000.gpu/devfreq/1800000.gpu/
echo userspace > governor
echo 756000000 > max_freq
echo 756000000 > min_freq
EOT
}

Any more details about this I should know? Sorry, been a while...
If someone could try the script for me and inform if it works? Also updated meson version to meson_0.55.3-1.
Should I also include the oibaf repo? Or doesn't this work anymore?
I'll try it later, first need to do other tests. Cheers. 

Edit : Didn't work. Tried to write a simpler script, but got error:
python (3.x) mako module = 0.8.0 required to build mesa
 

#!/bin/bash
sudo apt -y install python3-setuptools ninja-build

wget http://ftp.de.debian.org/debian/pool/main/m/meson/meson_0.55.3-1_all.deb
dpkg -i meson_0.55.3-1_all.deb
cd ~
git clone https://gitlab.freedesktop.org/mesa/mesa -b master
cd ~/mesa
mkdir build && cd build
meson -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=lima,panfrost,kmsro -Dlibunwind=false -Dprefix=/usr
ninja install

I never have luck with the H6. Used PineH64 with Armbian_20.08.2_Pineh64-b_focal_current_5.8.6_desktop.img

installPanfrost.sh

Link to comment
Share on other sites

8 hours ago, NicoD said:

meson -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=lima,panfrost,kmsro -Dlibunwind=false -Dprefix=/usr

Not sure. I used the gived command from Freedesktop:

 

 meson .. . -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=panfrost,kmsro 

https://panfrost.freedesktop.org/building-panfrost-mesa.html

Link to comment
Share on other sites

8 hours ago, Werner said:

Not sure. I used the gived command from Freedesktop:

 


 meson .. . -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=panfrost,kmsro 

https://panfrost.freedesktop.org/building-panfrost-mesa.html

That doesn't change anything. That's why I tried the other command. It seems an issue with python3. I know nothing of python and its terrible configuration.

Link to comment
Share on other sites

5 hours ago, NicoD said:

It seems an issue with python3.

Never had any issues with python when playing with Panfrost AFAIR...

Try to install the module with pip3 install Mako

Maybe do a pip3 install --upgrade pip before to update the installer itself.

 

Depending on your OS the command might be different or not available at all. If necessary search apt for python3 pip and install it.

Link to comment
Share on other sites

23 hours ago, Werner said:

Try to install the module with pip3 install Mako

I tried this but still the same issue. I don't get it.

I do get a warning when installing pip.

nicod@arm-64:~/mesa/build$ pip3 install --upgrade pip
Collecting pip
  Downloading pip-20.2.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 2.6 MB/s 
Installing collected packages: pip
  WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/nicod/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.2.3

nicod@arm-64:~/mesa/build$ pip3 install mako
Requirement already satisfied: mako in /home/nicod/.local/lib/python3.8/site-packages (1.1.3)
Requirement already satisfied: MarkupSafe>=0.9.2 in /home/nicod/.local/lib/python3.8/site-packages (from mako) (1.1.1)
nicod@arm-64:~/mesa/build$ sudo meson .. . -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=panfrost,kmsro
The Meson build system
Version: 0.55.3
Source dir: /home/nicod/mesa
Build dir: /home/nicod/mesa/build
Build type: native build
Program python3 found: YES
Project name: mesa
Project version: 20.3.0-devel
C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-10ubuntu2) 9.3.0")
C linker for the host machine: cc ld.bfd 2.34
C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/usr/bin/python3)

../meson.build:869:2: ERROR: Problem encountered: Python (3.x) mako module >= 0.8.0 required to build mesa.

A full log can be found at /home/nicod/mesa/build/meson-logs/meson-log.txt

:wacko:
From meson-log.txt
 

import mako
assert StrictVersion(mako.__version__) > StrictVersion("0.8.0")
  
--- stdout ---

--- stderr ---
Traceback (most recent call last):
  File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'mako'



../meson.build:869:2: ERROR: Problem encountered: Python (3.x) mako module >= 0.8.0 required to build mesa.

 

Link to comment
Share on other sites

5 minutes ago, Werner said:

Try doing the python stuff as root.

Got me a step further :) Not there yet.
 

Spoiler

root@arm-64:~/mesa/build# pip3 install --upgrade pip
Collecting pip
  Downloading pip-20.2.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 784 kB/s 
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'pip'. No files were found to uninstall.
Successfully installed pip-20.2.3
root@arm-64:~/mesa/build# pip3 install mako
Collecting mako
  Downloading Mako-1.1.3-py2.py3-none-any.whl (75 kB)
     |████████████████████████████████| 75 kB 487 kB/s 
Collecting MarkupSafe>=0.9.2
  Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Building wheels for collected packages: MarkupSafe
  Building wheel for MarkupSafe (setup.py) ... done
  Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-py3-none-any.whl size=12629 sha256=54e67e88cdbe6a7c53cd83905b578d66c777964a928682dbc4b5ff3630ae598b
  Stored in directory: /root/.cache/pip/wheels/0c/61/d6/4db4f4c28254856e82305fdb1f752ed7f8482e54c384d8cb0e
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, mako
Successfully installed MarkupSafe-1.1.1 mako-1.1.3
root@arm-64:~/mesa/build# meson .. . -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=panfrost,kmsro
The Meson build system
Version: 0.55.3
Source dir: /root/mesa
Build dir: /root/mesa/build
Build type: native build
Program python3 found: YES
Project name: mesa
Project version: 20.3.0-devel
C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-10ubuntu2) 9.3.0")
C linker for the host machine: cc ld.bfd 2.34
C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/usr/bin/python3)
Fetching value of define "ETIME" : 62 
Checking for function "bswap32" : YES 
Checking for function "bswap64" : YES 
Checking for function "clz" : YES 
Checking for function "clzll" : YES 
Checking for function "ctz" : YES 
Checking for function "expect" : YES 
Checking for function "ffs" : YES 
Checking for function "ffsll" : YES 
Checking for function "popcount" : YES 
Checking for function "popcountll" : YES 
Checking for function "unreachable" : YES 
Compiler for C supports function attribute const: YES 
Compiler for C supports function attribute flatten: YES 
Compiler for C supports function attribute malloc: YES 
Compiler for C supports function attribute pure: YES 
Compiler for C supports function attribute unused: YES 
Compiler for C supports function attribute warn_unused_result: YES 
Compiler for C supports function attribute weak: YES 
Compiler for C supports function attribute format: YES 
Compiler for C supports function attribute packed: YES 
Compiler for C supports function attribute returns_nonnull: YES 
Compiler for C supports function attribute alias: YES 
Compiler for C supports function attribute noreturn: YES 
Compiler for C supports function attribute visibility:hidden: YES 
Checking if "__uint128_t" compiles: YES 
Compiler for C supports arguments -Werror=implicit-function-declaration: YES 
Compiler for C supports arguments -Werror=missing-prototypes: YES 
Compiler for C supports arguments -Werror=return-type: YES 
Compiler for C supports arguments -Werror=empty-body: YES 
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES 
Compiler for C supports arguments -Werror=int-conversion: YES 
Compiler for C supports arguments -Wimplicit-fallthrough: YES 
Compiler for C supports arguments -Wno-missing-field-initializers -Wmissing-field-initializers: YES 
Compiler for C supports arguments -Wno-format-truncation -Wformat-truncation: YES 
Compiler for C supports arguments -fno-math-errno: YES 
Compiler for C supports arguments -fno-trapping-math: YES 
Compiler for C supports arguments -Qunused-arguments: NO 
Compiler for C supports arguments -fno-common: YES 
Compiler for C supports arguments -Werror=format: YES 
Compiler for C supports arguments -Wformat-security: YES 
Compiler for C++ supports arguments -Werror=return-type: YES 
Compiler for C++ supports arguments -Werror=empty-body: YES 
Compiler for C++ supports arguments -Wno-non-virtual-dtor -Wnon-virtual-dtor: YES 
Compiler for C++ supports arguments -Wno-missing-field-initializers -Wmissing-field-initializers: YES 
Compiler for C++ supports arguments -Wno-format-truncation -Wformat-truncation: YES 
Compiler for C++ supports arguments -fno-math-errno: YES 
Compiler for C++ supports arguments -fno-trapping-math: YES 
Compiler for C++ supports arguments -Qunused-arguments: NO 
Compiler for C++ supports arguments -flifetime-dse=1: YES 
Compiler for C++ supports arguments -Werror=format: YES 
Compiler for C++ supports arguments -Wformat-security: YES 
Compiler for C supports arguments -Wno-override-init -Woverride-init: YES 
Compiler for C supports arguments -Wno-initializer-overrides -Winitializer-overrides: NO 
Compiler for C supports arguments -Werror=pointer-arith: YES 
Compiler for C++ supports arguments -Werror=pointer-arith: YES 
Compiler for C supports arguments -Werror=vla: YES 
Compiler for C++ supports arguments -Werror=vla: YES 
Compiler for C supports arguments -Werror=gnu-empty-initializer: NO 
Compiler for C++ supports arguments -Werror=gnu-empty-initializer: NO 
Checking if "GCC atomic builtins" compiles: YES 
Checking if "GCC atomic builtins required -latomic" links: YES 
Checking if "GCC 64bit atomics" with dependency not-found links: YES 
Library ws2_32 found: NO
Header <sys/sysmacros.h> has symbol "major" : YES 
Header <sys/sysmacros.h> has symbol "minor" : YES 
Header <sys/sysmacros.h> has symbol "makedev" : YES 
Header <sys/mkdev.h> has symbol "major" : NO 
Check usable header "xlocale.h" : NO 
Check usable header "linux/futex.h" : YES 
Check usable header "endian.h" : YES 
Check usable header "dlfcn.h" : YES 
Check usable header "execinfo.h" : YES 
Check usable header "sys/shm.h" : YES 
Check usable header "cet.h" : NO 
Check usable header "pthread_np.h" : NO 
Checking for function "strtof" : YES 
Checking for function "mkostemp" : YES 
Checking for function "timespec_get" : YES 
Checking for function "memfd_create" : YES 
Checking for function "random_r" : YES 
Checking for function "flock" : YES 
Checking for function "strtok_r" : YES 
Checking for function "getrandom" : YES 
Header <errno.h> has symbol "program_invocation_name" : YES 
Checking for function "posix_memalign" : YES 
Checking whether type "struct dirent" has member "d_type" : YES 
Checking if "strtod has locale support" links: YES 
Checking if "Bsymbolic" links: YES 
Checking if "gc-sections" links: YES 
Checking if "version-script" links: YES 
Checking if "dynamic-list" links: YES 
Compiler for C supports link arguments -Wl,--build-id=sha1: YES 
Checking for function "dlopen" : NO 
Library dl found: YES
Checking for function "dladdr" with dependency -ldl: YES 
Checking for function "dl_iterate_phdr" : YES 
Checking for function "clock_gettime" : YES 
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency zlib found: YES 1.2.11
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency libzstd found: NO (tried pkgconfig and cmake)
Run-time dependency threads found: YES
Checking for function "pthread_setaffinity_np" with dependency threads: YES 
Run-time dependency expat found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency expat
Downloading expat source from https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2
Download size: 510868
Downloading: ..........
Downloading expat patch from https://github.com/mesonbuild/expat/releases/download/2.2.5-4/expat.zip
Download size: 3837
Downloading: ..........

|Executing subproject expat method meson 
|
|Project name: expat
|Project version: 2.2.5
|C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-10ubuntu2) 9.3.0")
|C linker for the host machine: cc ld.bfd 2.34
|Checking for function "arc4random_buf" : NO 
|Checking for function "arc4random" : NO 
|Has header "dlfcn.h" : YES 
|Has header "fcntl.h" : YES 
|Has header "inttypes.h" : YES 
|Has header "memory.h" : YES 
|Has header "stdint.h" : YES 
|Has header "stdlib.h" : YES 
|Has header "strings.h" : YES 
|Has header "string.h" : YES 
|Has header "sys/stat.h" : YES 
|Has header "sys/types.h" : YES 
|Has header "unistd.h" : YES 
|Checking for function "getpagesize" : YES 
|Checking for function "memmove" : YES 
|Checking for function "bcopy" : YES 
|Checking for function "mmap" : YES 
|Checking for function "getrandom" : YES (cached)
|Header <sys/types.h> has symbol "off_t" : YES 
|Header <sys/types.h> has symbol "size_t" : YES 
|Checking if "SYS_getrandom" compiles: YES 
|Configuring expat_config.h using configuration
|Compiler for C supports arguments -fno-strict-aliasing: YES 
|Build targets in project: 1
|Subproject expat finished.

Dependency expat from subproject subprojects/expat found: YES 2.2.5
Library m found: YES
Run-time dependency libdrm found: NO (tried pkgconfig)

../meson.build:1417:0: ERROR: Dependency "libdrm" not found, tried pkgconfig

A full log can be found at /root/mesa/build/meson-logs/meson-log.txt

 

root@arm-64:~/mesa/build# apt install libdr
libdri2                     libdrm-exynos1
libdri2-1                   libdrm-freedreno1
libdri2-dbg                 libdrm-nouveau2
libdri2-dev                 libdrm-omap1
libdrilbo                   libdrm-radeon1
libdrilbo-common            libdrm-tegra0
libdrilbo-dev               libdrm-tests
libdrm                      libdropwizard-metrics-java
libdrm2                     libdr-sundown-perl
libdrmaa1.0-java            libdrumstick
libdrmaa1.0-java-doc        libdrumstick-alsa1
libdrmaa1.0-ruby            libdrumstick-dev
libdrm-amdgpu1              libdrumstick-file1
libdrm-common               libdrumstick-rt1
libdrm-dev                  libdrumstick-rt-backends
libdrm-etnaviv1             
root@arm-64:~/mesa/build# apt install libdrm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libdrm

Hahaha :) It's killing me.

Link to comment
Share on other sites

39 minutes ago, Werner said:

Fun fact: When I played around with panfrost I took the pain in the butt and collected all necessary dependencies by hand because I did not know :lol:

Just found out what broke my buildscript. python-pip can't be installed from the repo. Unable to locate package python-pip.
What made the whole list of other dependencies not install. Also meson 0.55 seems to have a bug and 0.49 must be used.

That was why I had included it in my script originally. But dumb me removed the original script and thought using latest meson would work. I often forget why I did things a particular way.

I think it's now installing, I'll cross my fingers :thumbup:

Link to comment
Share on other sites

On 9/20/2020 at 4:13 AM, NicoD said:

Could someone inform me if this is all that needs to be done? 
I'm back using the H6. I've updated my install script for panfrost with an H6 install with this code added to do the above :

 

Hi, NicoD

 

I actually enjoy your video @ youtube a lot. Thank you first.

 

According my current 5.6 kernel: Yes, the GPU clockrate is required to imposed. Or it will get really unstable if you enable panfrost.

If you have a newer kernel, you might try it without setting clockrate first. If thing went bad for you, just remember to try this.
 

I use the kernel ripped from libreELEC at https://gitlab.com/FuyuriSeiji/linux-5.6-le

I made changes into build system config to use this kernel

For the root, I use Gentoo's and emerge mesa with VIDEO_CARDS="panfrost."

And the patched of ffmpeg at https://gitlab.com/FuyuriSeiji/ffmpeg 

These enable my setup to have hardware decoding with DRMPRIME kodi. 

 

If you have ever bumped any problem, you might consider what I list here as alternative approach.

Good luck

 

 

Link to comment
Share on other sites

Best to build Mesa version 20.1.8 for stable gles 2 or 20.2. 0-rc4 for primary gles 3 support, I've tried mesa master 20.3 but is instable.  Official desktop package Mesa 20.0.X is working fine too but outdated.  To fix stability with clock I've commented out all but one of the operating points of the gpu table and rebuild the DTB

Link to comment
Share on other sites

H6 doesn't support GPU devfreq yet - this feature is mysteriously  elusive - all attempts to add this feature ended with GPU lock up. It's possible, because BSP can do that. Currently it runs with default rate, but you can adjust that with some DT magic, like I did that for A64. Note that you probably need to increase GPU power supply voltage too.

Link to comment
Share on other sites

2 hours ago, kprasadvnsi said:

just tried compiling mesa from source and it does compile and installed but I am unable to switch to Panfrost from llvmpipe. I am using latest Armbian xfce desktop on OrangePi 3.


what is your X11 config?

Link to comment
Share on other sites

  • Igor unpinned this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines