From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05BFA4319C; Wed, 18 Oct 2023 20:34:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E146940272; Wed, 18 Oct 2023 20:34:39 +0200 (CEST) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mails.dpdk.org (Postfix) with ESMTP id EAE6E40271 for ; Wed, 18 Oct 2023 20:34:38 +0200 (CEST) Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-41983b83e53so48023761cf.2 for ; Wed, 18 Oct 2023 11:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697654078; x=1698258878; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3EkxCRRPpi0RhnAZCQVvg6lqc8deIpn+RjbNKFssp0U=; b=b4nG7LeNB1ENPvZSl+wfLE92DJtD2jyzdfXUaMaTgyyqEybEHN427JxyrDxzQHg2oc 7RLo8HaOS6V7BInea369lkXfoZnYj2XaFlsIiKPuNJ4n3mc3V2/Yn6ABuKmj8XPhVDh3 Akf/hiV1o3mbtHxVqW5T55WNNHEFwtiq4Wmhg//sEH7DfUCQa7+Cw7oVapTQLmWcsQDY xojDCFiVDp0UGEEDbZfPGz130yyWxHdjqRQx0PuT0QkCc3KDkxvrdTMX2Gy6L7SEpd8W AH2hxQMjMBcdVLzcd6dW70jkbbqmTSpKXptLOHHy81cuMRaqHJkigYgzimDjv6KUf61A OZWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697654078; x=1698258878; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3EkxCRRPpi0RhnAZCQVvg6lqc8deIpn+RjbNKFssp0U=; b=M2QlKn3yTFlad4zvyiTnAq84kzFVOduASAsORVgE8PbxqG4tt4jltE49+8PTxXUofP A2CG8JiGz3YAS1G+KfjyeB/jBGszCZi06BqMn0pm+VVXSgjM1xmW9rrAJY/0flU7sb0E RWvSF6mePAx0QeZQRso6+klUXdoRwxEvNZxsxsUnnMYh/kkRpDSYRzD+XzoMYaiXXsNU /PwMztgyKFxJWjpcY34zLuIqQ5eOx4Wd1djwaIcoHAvxgrvxgMv5+V4242sZwkMrwzur pfv9hXHPpM2Gv5ZCmDI660i2sCqtau7iGEshf4t1nAJMZcyPK3NXzH/Me5uKdo7aDR+r ScMA== X-Gm-Message-State: AOJu0YwsYgaHuYCVKuvXYYvSSwUDMlCGe652JighFNJdifXASr0It8Ig yqAVJOLJ6gXk0ikdbkJcRJn6zdCO48UPNDLrDtOVp51U+ns= X-Google-Smtp-Source: AGHT+IFu9ehCygB8SRPo/XLRkNRd6kS+4H1XTIHLO1V4DfTNxOoPajHGGKoaJKOvzvjXSOIIcbSzqjC1vXsQPm8dXT0= X-Received: by 2002:a05:622a:c6:b0:413:825:8f36 with SMTP id p6-20020a05622a00c600b0041308258f36mr128769qtw.26.1697654078218; Wed, 18 Oct 2023 11:34:38 -0700 (PDT) MIME-Version: 1.0 References: <20230830155927.3566-1-syalavarthi@marvell.com> <20231018135423.14111-1-syalavarthi@marvell.com> <20231018135423.14111-19-syalavarthi@marvell.com> In-Reply-To: <20231018135423.14111-19-syalavarthi@marvell.com> From: Jerin Jacob Date: Thu, 19 Oct 2023 00:04:11 +0530 Message-ID: Subject: Re: [PATCH v6 18/34] ml/cnxk: support config and close of tvmdp library To: Srikanth Yalavarthi Cc: dev@dpdk.org, sshankarnara@marvell.com, aprabhu@marvell.com, ptakkar@marvell.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Oct 18, 2023 at 7:52=E2=80=AFPM Srikanth Yalavarthi wrote: > > Added support to configure and close TVMDP library based > on ML device configuration options. > > Updated meson build to enable Jansson, TVM runtime, TVMDP > library as build dependencies. > > Signed-off-by: Srikanth Yalavarthi > --- > > +Compilation Prerequisites > +------------------------- > + > +This driver requires external libraries to optionally enable support for > +models compiled using Apache TVM framework. The following dependencies a= re > +not part of DPDK and must be installed separately: > + > +- **Jansson** > + > + This library enables support to parse and read JSON files. > + > +- **DLPack** > + > + This library provides headers for open in-memory tensor structures. > + > +.. note:: > + > + DPDK CNXK ML driver requires DLPack version 0.7 > + > +.. code-block:: console Please add sections for cross and native. > + git clone https://github.com/dmlc/dlpack.git > + cd dlpack > + git checkout v0.7 -b v0.7 > + cmake -S ./ -B build \ > + -DCMAKE_C_COMPILER=3Daarch64-linux-gnu-gcc \ > + -DCMAKE_CXX_COMPILER=3Daarch64-linux-gnu-g++ \ > + -DBUILD_MOCK=3DOFF > + make -C build > + make -C build install > + > +- **TVM** > + > + Apache TVM provides a runtime library (libtvm_runtime) used to execute > + models on CPU cores or hardware accelerators. > + > +.. note:: > + > + DPDK CNXK ML driver requires TVM version 0.10.0 > + > +.. code-block:: console > + > + git clone https://github.com/apache/tvm.git I need to use --recursive to avoid CMake Error at /usr/share/cmake/Modules/ExternalProject.cmake:3176 (message= ): No download info given for 'project_libbacktrace' and its source director= y: > + cd tvm > + git checkout v0.10.0 -b v0.10.0 > + cmake -S ./ -B build \ > + -DCMAKE_C_COMPILER=3Daarch64-linux-gnu-gcc \ > + -DCMAKE_CXX_COMPILER=3Daarch64-linux-gnu-g++ \ > + -DMACHINE_NAME=3Daarch64-linux-gnu \ > + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=3DNEVER \ > + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=3DONLY > + make -C build > + make -C build install > + > +- **TVMDP** > + > + Marvell's `TVM Dataplane Library `_ > + works as an interface between TVM runtime and DPDK drivers. TVMDP libr= ary > + provides a simplified C interface for TVM's runtime based on C++. > + > +.. code-block:: console > + > + git clone https://github.com/MarvellEmbeddedProcessors/tvmdp.git > + cd tvmdp > + git checkout main > + cmake -S ./ -B build \ > + -DCMAKE_TOOLCHAIN_FILE=3Dconfig/toolchains/arm64_linux_gcc.cmake \ > + -DBUILD_SHARED_LIBS=3DON \ > + -DBUILD_TESTING=3DOFF [main]dell[tvmdp] $ cmake -S ./ -B build -DCMAKE_INSTALL_PREFIX=3D/export/cross_prefix/prefix -DCMAKE_TOOLCHAIN_FILE=3Dconfig/toolchains/arm64_linux_gcc.cmake -DBUILD_SHARED_LIBS=3DON -DBUILD_TESTING=3DOFF -- The CXX compiler identification is GNU 13.2.0 -- The C compiler identification is GNU 13.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done CMake Error at CMakeLists.txt:53 (find_package): By not providing "Finddmlc.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "dmlc", but CMake did not find one. Could not find a package configuration file provided by "dmlc" with any o= f the following names: dmlcConfig.cmake dmlc-config.cmake Add the installation prefix of "dmlc" to CMAKE_PREFIX_PATH or set "dmlc_DIR" to a directory containing one of the above files. If "dmlc" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! > +enable_mvtvm =3D true > + > +if not jansson_dep.found() > + message('drivers/ml/cnxk: jansson not found') > + enable_mvtvm =3D false > +endif > + > +if not cc.check_header('dlpack/dlpack.h') > + message('drivers/ml/cnxk: dlpack.h not found') > + enable_mvtvm =3D false > +endif > + > +tvmrt_lib =3D cc.find_library('tvm_runtime', required: false) > +if tvmrt_lib.found() > + tvmrt_dep =3D declare_dependency(dependencies: tvmrt_lib) > +else > + message('drivers/ml/cnxk: tvm_runtime not found') > + enable_mvtvm =3D false > +endif > + > +tvmdp_dep =3D dependency('tvmdp', required: false) > +if not tvmdp_dep.found() > + message('drivers/ml/cnxk: tvmdp not found') > + enable_mvtvm =3D false > +endif > + > sources =3D files( > 'cn10k_ml_dev.c', > 'cn10k_ml_ops.c', > @@ -21,6 +47,39 @@ sources =3D files( > > deps +=3D ['mldev', 'common_cnxk', 'kvargs', 'hash'] > > +if enable_mvtvm > + > +dpdk_conf.set('RTE_MLDEV_CNXK_ENABLE_MVTVM', 1) > + > +driver_sdk_headers +=3D files( > + 'mvtvm_ml_ops.h', > +) Remove this