I’m trying to run CVB on ubuntu-18.04 x64 using the .net core CVB api.
I have downloaded cvb-13.03.000-ubu1804-x86_64, run the installer and created a simple hello world application using the CVMock.vin driver.
My code looks like this:
using System;
using System.IO;
using Stemmer.Cvb;
using Stemmer.Cvb.Driver; // for IndexedStream
using Stemmer.Cvb.Utilities; // for SystemInfo
namespace Cvb
{
class Program
{
static void Main(string[] args)
{
Example();
}
private static void Example() {
Device device = DeviceFactory.OpenPort(@"/opt/cvb/drivers/CVMock.vin", 0);
var stream = device.Stream;
stream.Start();
for (int i = 0; i < 100; i++) {
var result = stream.Wait();
var image = result;
Console.WriteLine("timestamp: " + image.RawTimestamp);
}
}
}
}
Then I publish this project as follows: dotnet publish -c release -r ubuntu.18.04-x64
When I run the binary I receive the following exception: Unhandled Exception: System.IO.FileLoadException: Loading the Device from file /opt/cvb/drivers/CVMock.vin failed.
This seems to be a .net core related issue as the C++ and Python examples do work.
Also I have gone through all steps described in this post where CVB is setup in a ubuntu:18.04 container, except for running it in a container (I’ve tried a regular Ubuntu setup and WSL2) with similar result.
Is there anything fundamental going on with CVB and .NET Core support or are there some different steps I need to take to get .NET Core compiled binaries to use CVB drivers?
Usually this error occurs when either the driver is already in use, not found or there is a 32/64 bit missmatch between Cvb/Build of Application and the Os…
Running Cvb within Wsl1/2 works (with some restrictions), but it is not officially tested.
Running Cvb within a container is not officially tested.
Running Cvb .Net Core on Linux is not officially tested.
So building an application, with all (or just some of) the points above, might be a bit tricky.
However my assumption is that the “dotnet publish …” is the issue here. Specifically the dependencies.
As a next step i would suggest:
create a log using LogGUI (or on WSL with siLogSvc -x (just because Wsl will create issues with UI)). With LogGUI you can set the logging levels (with Wsl you need to manipulate /var/opt/cvb/log/LogModuleConf.json).
Regarding the siLogSvc, it should have logged a lot of messages, is there by any chance an instance running a service?
Regarding no logging on Ubuntu. Is this also the case, when just starting the genicambrowser?
Regarding the publishing, I can already tell you that “Any CPU” is bad, definitly 64 or 32 bit (corresponding to your CVB installation). However i have to ask a collegue whether this has any chance of working.
@gajus Ok this is the info i was looking, so a 32 bit setup (on either side) has higher, but unknown chance of working. But a 64bit setup will not work (with all released versions of cvb).