[BPI-R64] PCIe issues

Looks like you need to compile kernel with dma_buf support

https://elixir.bootlin.com/linux/latest/A/ident/dma_buf_detach

At least CONFIG_DMA_SHARED_BUFFER on a quick look this seems enough (all functions listed are inside dma-buf.c and i see no idefs around

Hi Do I need to recompile and reinstall the kernel or just recompile on the R64

Imho recompile to compile the gasket,but reinstall to use :slight_smile:

In command ‘./build.sh config’ which setting refers to dma_buf support. Alternatively is it possible to directly provide this setting via some file?

Press / in menuconfig (build.sh config) to search and search for CONFIG_DMA_SHARED_BUFFER then press 1 and space to set,exit with save

I am looking in include/config/auto.conf file. There is no ‘CONFIG_DMA_SHARED_BUFFER’ kernel configuration setting present.

It looks like is is a hidden option set by config_sync_file

https://elixir.bootlin.com/linux/latest/source/drivers/dma-buf/Kconfig#L7

On searching “CONFIG_DMA_SHARED_BUFFER” i am unable to highlight the menu option to set it.

see my posting before…search with / for CONFIG_SYNC_FILE

 .config - Linux/arm64 5.8.0-rc6 Kernel Configuration
 > Search (CONFIG_SYNC_FILE) ──────────────────────────────────────────────────
  ┌──────────────────────────── Search Results ─────────────────────────────┐
  │ Symbol: SYNC_FILE [=n]                                                  │  
  │ Type  : bool                                                            │  
  │ Defined at drivers/dma-buf/Kconfig:4                                    │  
  │   Prompt: Explicit Synchronization Framework                            │  
  │   Location:                                                             │  
  │     -> Device Drivers                                                   │  
  │ (1)   -> DMABUF options                                                 │  
  │ Selects: DMA_SHARED_BUFFER [=n]    <<<<<<<<<<<<<<

press 1

  ┌──────────────────────────── DMABUF options ─────────────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty │  
  │  submenus ----).  Highlighted letters are hotkeys.  Pressing <Y>        │  
  │  includes, <N> excludes, <M> modularizes features.  Press <Esc><Esc> to │  
  │  exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ]         │  
  │ ┌─────────────────────────────────────────────────────────────────────┐ │  
  │ │    [ ] Explicit Synchronization Framework <<<<<<<<

and select with space

[*] Explicit Synchronization Framework

if you now search again for DMA_SHARED_BUFFER ist is selected

Symbol: DMA_SHARED_BUFFER [=y]

have added it to defconfig…and updated 5.8-rc to rc7

Hi

Yes this setting worked. I have managed to compile the gasket driver on R64 successfully. Thanks

Remember, you need to boot kernel with this option or you get errors when loading the module

Have you tried booting+loading it? Does it work with hw-modifications?

I have managed to load the gasket drivers and can see the PCI Google coral in /dev/ as apex_0.

Now I am trying to load the tflite library on R64. For that I have already upgraded to Python 3.6.11.

While loading tflite for coral R64 also tries to install numpy and fails with the BPI5.8_tfliteLoading.txt (60.6 KB)

If you can suggest something to resolve this it will be of great help

It seems that specific libs like

mkl_rt,blis,openblas,…

Not found. Seems not kernel-related

Yes, its not related to kernel.

Just thought if you could help

Hi,

I have managed to resolve the issue. Now I am trying to run the Classification example.

When executing this I get the following error

root@bpi-iot-ros-ai:~/coral/tflite/python/examples/classification# python3 classify_image.py \
> --model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
> --labels models/inat_bird_labels.txt \
> --input images/parrot.jpg
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/tflite_runtime/interpreter_wrapper.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /usr/local/lib/python3.6/site-packages/tflite_runtime/_interpreter_wrapper.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "classify_image.py", line 36, in <module>
    import tflite_runtime.interpreter as tflite
  File "/usr/local/lib/python3.6/site-packages/tflite_runtime/interpreter.py", line 46, in <module>
    from tflite_runtime import interpreter_wrapper as _interpreter_wrapper
  File "/usr/local/lib/python3.6/site-packages/tflite_runtime/interpreter_wrapper.py", line 17, in <module>
    _interpreter_wrapper = swig_import_helper()
  File "/usr/local/lib/python3.6/site-packages/tflite_runtime/interpreter_wrapper.py", line 16, in swig_import_helper
    return importlib.import_module('_interpreter_wrapper')
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_interpreter_wrapper'

He I need to install the GLIBC_2.27 library. If you could help with this

as far as i see you use official image (e.g. debian jessie), i don’t think you can upgrade to a recent glibc here…

afair linux-kernel also compiles a libc-package as deb…maybe this helps else you could try with my debian buster

but please move this in new thread…it’s no PCIe Issue :wink:

Yes, sure, I can move this thread once I can confirm it.

As per the support team from Google Coral, they also suggest Debian Buster. Is this 5.8-r64 branch a debian buster.

Also additionally please suggest the commands to compile libc-package using the linux kernel

My repo is only kernel (and some tools).

My buster-image is on my gdrive

I see libc deb when using pack_debs option from build.sh

Hi,

Can you please share the buster image. Does it have the pcie related changes from mtk that is included in the 5.8-rc version I am using. Also while compiing the 5.8-rc image I had enable the CONFIG_DMA_SHARED_BUFFER.

Alternatively if I can recompile my 5.8-rc kernel for debian-buster what all I need to set up in the config and build.sh.

Also as per the build.sh following is the pack_debs

function pack_debs {
	get_version
	echo "pack linux-headers, linux-image, linux-libc-dev debs..."
    echo "LOCALVERSION=${gitbranch} board=$board ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE"
	LOCALVERSION="${gitbranch}" board="$board" make bindeb-pkg
	ls ../*.deb
}

Is there a way we can add a specific version like 2.27.

Link to gdrive is in first post of that thread. You have to replace kernel like you did it with your current image

Compiling with pack_debs creates a libc deb,but i don’t know if this enough. So i suggest using debian buster and install your currrent built kernel there