Installation of SDK on Windows from sources
This section describes how to install Metavision SDK on Windows 10 from sources.
Note
If you don’t own Metavision SDK, you can still have access to the source code of the Open modules (Base, Core, Core ML, Stream, UI, and HAL), and compiling our open source project OpenEB will be enough if you plan to work only with open modules. In that case, follow the specific guide on the Installation of OpenEB.
Table of Contents
Supported Cameras
Metavision SDK contains the source code of the Prophesee camera plugin, enabling to stream data from our event-based cameras and to read recordings of event-based data. The supported cameras are:
If you want to use a Prophesee EVK that is not in the list above, it might have been discontinued. Refer to the Prophesee EVKs Support section to find out which previous version of the SDK is supporting it.
If you own a third-party vendor event-based camera, refer to the Camera Plugin Installation page to see how it can be deployed and configured.
Required Configuration
Compilation and execution were tested on platforms that meet the following requirements:
Operating system: Windows 10 64-bit
Architecture: amd64 (a.k.a. x64)
Graphic card: must support OpenGL 3.0 minimum
To install the SDK on Linux, check the page Installation of SDK on Linux.
Downloading and Extracting the Source Code
To compile Metavision SDK on Windows, you will need some source code archives available in our JFrog Artifactory APT server.
To download those archives, follow those steps:
If you don’t have a Prophesee Microsoft Entra ID account yet, request one by completing this form
Ensure you are not currently logged into any other domains with a Microsoft Entra ID account besides Prophesee. To avoid conflicts, consider using a private or incognito browsing window, which will isolate your login session.
Connect to https://propheseeai.jfrog.io
Choose “SAML SSO” login type
Enter your Entra ID credentials. Your login should follow this format: jdoe@customers.prophesee.ai
You should now see something similar to:
The source code archives can then be found at this URL or can also be retrieved by browsing the Artifacts menu (metavision-sdk-5-archives / main / sources).
Download the following files:
metavision_open_full_x.y.z.tar.gz
(OpenEB)
metavision_sdk_advanced_sources_x.y.z.tar.gz
(Advanced modules and standalone applications)
Then, extract the content of the archive metavision_open_full_x.y.tar.gz
:
tar -xvf metavision_open_full_x.y.tar.gz
This will create the folder openeb-x.y.z
containing OpenEB source code.
The absolute path to this directory is called MV_SDK_SRC_DIR
in the next sections.
Then extract the advanced source archive in MV_SDK_SRC_DIR
:
tar -xvf metavision_sdk_advanced_sources_x.y.z.tar.gz -C <MV_SDK_SRC_DIR>
Upgrading Metavision
If you are upgrading Metavision from a previous version, you should first read carefully the Release Notes as some changes may impact your usage of our SDK (e.g. API updates) and cameras (e.g. firmware update might be necessary).
Then, if you have previously installed any Prophesee software, you will need to uninstall it first.
Remove the folders where you installed Metavision artifacts (check both the build
folder of the source code and
C:\Program Files\Prophesee
which is the default install path of the deployment step).
Prerequisites
System Settings
You must enable the support for long paths:
Hit the Windows key, type gpedit.msc and press Enter
Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
Double-click the “Enable Win32 long paths” option, select the “Enabled” option and click “OK”
Development tools
To compile Metavision, you will need to install some extra tools:
install git
install CMake 3.26 (more recent versions might not be compatible)
install Microsoft Visual C++ compiler (MSVC, 64-bit version) included in Visual Studio 2022 - Fall 2023 LTSC (version 17.8). If you install the Build Tools only, make sure Windows 10 SDK is checked, and add English Language Pack.
Installing Dependencies
Install some dependencies with vcpkg:
download and extract vcpkg version 2024.04.26 as a folder referred to as
VCPKG_SRC_DIR
in the following sections.In a command prompt, navigate to VCPKG_SRC_DIR` and launch the following commands:
bootstrap-vcpkg.bat vcpkg updateCopy the
vcpkg.json
file located in the SDK source code atutils/windows
intoVCPKG_SRC_DIR
:copy MV_SDK_SRC_DIR\utils\windows\vcpkg.json VCPKG_SRC_DIR
Finally, launch the following command that will install the dependencies:
vcpkg install --triplet x64-windows --x-install-root installed
Note
If you’re using vcpkg across multiple projects or versions of OpenEB, it’s beneficial to streamline the number of vcpkg installations you manage. To achieve this, you’ll need the specific versions of the libraries required. You can find these versions by cross-referencing our
vcpkg.json
file with the official vcpkg repository, but for your convenience, we’ve listed them below:
libusb: 1.0.27
boost: 1.78.0
opencv: 4.8.0
dirent: 1.24.0
gtest: 1.14.0
pybind11: 2.12.0
glew: 2.2.0
glfw3: 3.4.0
eigen3: 3.4.0
hdf5: 1.14.2
ogre: 14.2.2
protobuf: 3.21.12
ceres: 2.1.0
You should also install FFMPEG library that is required to write videos:
Add the
bin
directory of the FFMPEG install to yourPATH
Installing Python
To execute our Python Samples and use the Python API, you will need Python and some additional libraries. If you plan to use only Metavision Studio for now, you can skip this Python dependencies section.
If Python is not available on your system, install it:
Download the installer for one of the supported Python versions:
Python 3.9 (“Windows installer (64-bit)”)
Python 3.10 (“Windows installer (64-bit)”)
Python 3.11 (“Windows installer (64-bit)”)
Python 3.12 (“Windows installer (64-bit)”)
Run the installer and follow the prompt
Add Python install and script directories in your
PATH
and make sure they are listed before theWindowsApps
folder which contains a Python alias launching the Microsoft Store. So, if you installed Python 3.9 in the default path, your userPATH
should contain those three lines in that order:%USERPROFILE%\AppData\Local\Programs\Python\Python39 %USERPROFILE%\AppData\Local\Programs\Python\Python39\Scripts %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
We recommend using Python with virtualenv to avoid conflicts with other installed Python packages.
Create a virtual environment:
python -m venv C:\tmp\prophesee\py3venv --system-site-packages
When creating the virtual environment, it is necessary to use the --system-site-packages
option to ensure that
the SDK packages installed in the system directories are accessible. However, this option also makes your local
user site-packages visible by default. To prevent this and maintain a cleaner virtual environment,
you should set the environment variable PYTHONNOUSERSITE
to true (which you may add to your system configuration to make it permanent):
set PYTHONNOUSERSITE=true
Finally, install the necessary dependencies:
C:\tmp\prophesee\py3venv\Scripts\python -m pip install pip --upgrade
C:\tmp\prophesee\py3venv\Scripts\python -m pip install -r MV_SDK_SRC_DIR\utils\python\requirements_openeb.txt -r MV_SDK_SRC_DIR\utils\python\requirements_sdk_advanced.txt
Optionally, you can run the activate
command (C:\tmp\prophesee\py3venv\Scripts\activate
) to modify your shell’s environment variables,
setting the virtual environment’s Python interpreter and scripts as the default for your current session.
This allows you to use simple commands like python
without needing to specify the full path each time.
For simplicity, throughout the documentation of the Code Samples, we will assume
the python
command refers to the interpreter within the activated virtual environment.
Note
You can also use anaconda to install Python and
conda to manage your Python packages, but be sure to use a Python version that we support.
You will need to adapt the library installation steps accordingly and use conda
whenever we use pip
.
In addition, check that conda PYTHONPATH
contains the aforementioned PATH
. For example for Python 3.9:
%USERPROFILE%\AppData\Local\Programs\Python\Python39
%USERPROFILE%\AppData\Local\Programs\Python\Python39\Scripts
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
If not, add them. For example with sys.path.append()
method of python module sys
:
import sys
print(sys.path)
# Add %USERPROFILE%\AppData\Local\Programs\Python\Python39 to PYTHONPATH if the output of print(sys.path) does not mention it.
sys.path.append("%USERPROFILE%\AppData\Local\Programs\Python\Python39")
In this documentation, we chose to use pip as a package manager.
Prerequisites for the CV3D module
To use the CV3D module, you need to install a third-party Sophus library that is required to handle geometric transformation problems:
Clone the Sophus repository:
git clone https://github.com/strasdat/Sophus.git
Go to the Sophus directory:
cd Sophus
As of February 2024, there is a bug in Sophus repo preventing to compile on Windows, so you should check-out a specific commit as a workaround:
git checkout e10eb6e00cecc3cbeebb893f8a739120de151156
Create and open the build directory
mkdir build && cd build
Create a directory where Sophus will be installed (make sure you have the write permission in that directory):
mkdir <sophus_install_path>
Compile and install (note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one):
cmake .. -DCMAKE_TOOLCHAIN_FILE=<VCPKG_SRC_DIR>\scripts\buildsystems\vcpkg.cmake -DCMAKE_INSTALL_PREFIX=<sophus_install_path> -DSOPHUS_USE_BASIC_LOGGING=ON cmake --build . --config Release cmake --build . --target install
Prerequisites for the ML module
If you have some Nvidia hardware with GPUs, you can optionally install CUDA and cuDNN to leverage them with PyTorch and LibTorch. Make sure that you install a version of CUDA that is compatible with your GPUs by checking Nvidia compatibility page.
Note
At the moment, we don’t support OpenCL and AMD GPUs.
LibTorch for C++
To compile and run the ML samples that leverage the Torch library, you need LibTorch (PyTorch’s C++ frontend):
Download the LibTorch version corresponding to your CUDA version (or take the CPU version if you don’t have CUDA):
Unzip the archive as a new folder
LIBTORCH_DIR_PATH
Add
LIBTORCH_DIR_PATH\lib
to yourPATH
to be able to compile the ML samples depending on libtorch
Prerequisites for standalone apps
To be able to compile Metavision Studio, you need to install NodeJS by downloading and running NodeJS 16.18.1 installer
Compilation
By now, you should have downloaded the source code from the “Downloading the Source Code” section. Let’s proceed with the compilation steps.
Follow one of the next sections depending of the tool you chose: CMake or MS Visual Studio.
Compilation using CMake
Open a command prompt and follow those steps:
Open the
MV_SDK_SRC_DIR
directorycd MV_SDK_SRC_DIR
Create and open the build directory:
mkdir build && cd build
Generate the solution using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):
cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF -DUSE_SOPHUS=ON -DSophus_DIR=<SOPHUS_DIR_PATH>\share\sophus\cmake -DUSE_TORCH=ON -DTorch_DIR=<LIBTORCH_DIR_PATH>\share\cmake\Torch
you can adapt this command depending on the module you choose to install:
to skip the compilation of the CV3D module, remove the Sophus options
to skip the compilation of the ML module, remove the Torch options
to skip the compilation of Metavision Studio, add
-DCOMPILE_METAVISION_STUDIO=OFF
Compile:
cmake --build . --config Release --parallel 4
Once the compilation is done, you have two options: you can choose to work directly from the build
folder
or you can deploy the SDK files (applications, samples, libraries etc.) in a directory of your choice.
Option 1 - working from
build
folder
To use SDK directly from the
build
folder, you need to update some environment variables using this script:utils\scripts\setup_env.bat
Option 2 - deploying in a directory of your choice
To deploy SDK in the default folder (
C:\Program Files\Prophesee
), execute this command (your console should be launched as an administrator):cmake --build . --config Release --target install
To deploy SDK in another folder, you should generate the solution again (step 3 above) with the additional variable
CMAKE_INSTALL_PREFIX
having the value of your target folder (SDK_PRO_INSTALL_DIR
).Similarly, to specify where the Python packages will be deployed (
PYTHON3_PACKAGES_INSTALL_DIR
), you should use thePYTHON3_SITE_PACKAGES
variable.Here is an example of a command customizing those two folders:
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<SDK_PRO_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF -DUSE_SOPHUS=ON -DSophus_DIR=<SOPHUS_DIR_PATH>\share\sophus\cmake -DUSE_TORCH=ON -DTorch_DIR=<LIBTORCH_DIR_PATH>\share\cmake\Torch
After this command, you should launch the actual compilation and installation of SDK (your console should be launched as an administrator):
cmake --build . --config Release --parallel 4 cmake --build . --config Release --target installYou also need to manually edit some environment variables:
append
<SDK_PRO_INSTALL_DIR>\bin
toPATH
(C:\Program Files\Prophesee\bin
if you used default configuration)append
<SDK_PRO_INSTALL_DIR>\lib\metavision\hal\plugins
toMV_HAL_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\metavision\hal\plugins
if you used default configuration)append
<SDK_PRO_INSTALL_DIR>\lib\hdf5\plugin
toHDF5_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\hdf5\plugin
if you used default configuration)append
<PYTHON3_PACKAGES_INSTALL_DIR>
toPYTHONPATH
(not needed if you used default configuration)
Compilation using MS Visual Studio
Open a command prompt and follow those steps:
Open the
MV_SDK_SRC_DIR
directorycd MV_SDK_SRC_DIR
Create and open the build directory:
mkdir build && cd build
Generate the Visual Studio files using CMake (adapt the command to your Visual Studio version and note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one):
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF -DUSE_SOPHUS=ON -DSophus_DIR=<SOPHUS_DIR_PATH>\share\sophus\cmake -DUSE_TORCH=ON -DTorch_DIR=<LIBTORCH_DIR_PATH>\share\cmake\Torch
Open the solution file metavision.sln, select the Release configuration and build the ALL_BUILD project.
Once the compilation is done, you have two options: you can choose to work directly from the build
folder
or you can deploy the SDK files (applications, samples, libraries etc.) in a directory of your choice.
Option 1 - working from
build
folder
To use SDK directly from the
build
folder, you need to update the environment variables as done in this script:utils\scripts\setup_env.bat
Option 2 - deploying SDK
To deploy SDK, you need to build the
INSTALL
project. By default, files will be deployed inC:\Program Files\Prophesee
Camera Plugins
Prophesee camera plugin is included in SDK, but you need to install the drivers for the cameras to be available on Windows. To do so, follow this procedure:
download wdi-simple.exe from our file server
execute the following commands in a Command Prompt launched as an administrator:
wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f4 wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f5 wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f3
Note
In some cases, the installation of the drivers fails with a message similar to
libwdi:warning [wdi_prepare_driver] could not sign cat file
.
This is generally a consequence of the security policies applied by your IT department.
If you are in that situation, check our FAQ entry covering that topic.
Note
If your EVK is listed in the Device Manager, but the Properties tab shows a message similar to
No drivers are installed for this device
,
check the FAQ entry about this driver issue.
If you own an EVK2 or an RDK2, there are a few additional steps to complete.
First, check in your device manager that you have the three following interfaces when your camera is connected: CDC NCM
; EVK2
; fastboot
, displayed as below with a warning sign
(from left to right, picture 1
). If not, uninstall the device already installed as shown in picture 2
and 3
(generally the already installed device is, either EVK2 if you connect an EVK2 device or fastboot if you connect an RDK2 device).
Kindly note that you should repeat this uninstall operation until your device (EVK2/fastboot) is not recognized anymore and appears in other devices
with a warning sign
.
Now, you should install the relevant driver for each of the three interfaces (EVKv2, CDC-NCM and FastbootInterface).
To do so, follow those steps for each interface:
find out the name of interface by checking the Device Manager as shown in the picture below:
For example, we can see on the right picture that the interface number is
03
.install the relevant driver with the following command launched as an administrator:
wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x03fd -p 0x5832 -i <INTERFACE_NUMBER>
If you are using a third-party camera, you need to follow the instructions provided by the camera vendor
to install the driver and the camera plugin. Make sure that you reference the location of the plugin in
the MV_HAL_PLUGIN_PATH
environment variable.
Running tests
Running the test suite is a sure-fire way to ensure you did everything well with your compilation and installation process. The more modules you add the more tests will be run when you do this step.
Download the files necessary and click on the
Download All
button to retrieve an archive of all the files necessary to run the tests. Please be aware that the archive you’ll receive is approximately 5.4 Gb in size.Extract and put the contents of this archive into
<MV_SDK_SRC_DIR>
. For instance, the correct path of sequence gen31_timer.raw should be <MV_SDK_SRC_DIR>/datasets/openeb/gen31_timer.raw.To run the test suite you need to reconfigure your build environment using CMake and to recompile. Make sure that all your pro modules were properly configured.
Compilation using only CMake
Regenerate the build using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):
cd <MV_SDK_SRC_DIR>/build cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
Compile:
cmake --build . --config Release --parallel 4
Compilation using CMake and MS Visual Studio
Generate the Visual Studio files using CMake (adapt the command to your Visual Studio version and note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one.):
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
Open the solution file metavision.sln, select the Release configuration and build the ALL_BUILD project.
Running the test suite (after making sure you launched the script
utils\scripts\setup_env.bat
mentioned before):ctest -C Release
Get started!
You are now ready to use Metavision SDK. The best way to start getting familiar with the event-based technology is to open an event-based camera with Metavision Studio to begin data collection and visualization. You can choose to dive directly in the SDK by following a getting started guide or looking at a Code Sample.