zivid-python icon indicating copy to clipboard operation
zivid-python copied to clipboard

Trace/breakpoint trap on Debian, Python 3.8, Zivid 2.1.0

Open mortlind opened this issue 5 years ago • 28 comments

I am on Debian with Python 3.8, and can install 2.1.0 core and telicam driver fine, and pip install zivid succeeds. But any attempt at getting the camera results in Trace/breakpoint trap. E.g. the standard example fails:

import zivid
app = zivid.Application()
camera = app.connect_camera()

Even the emulated camera fails:

>>> camera = app.create_file_camera("ZividSampleData2/FileCameraZividOne.zfc")
Trace/breakpoint trap

Is there any easy fix for this?

mortlind avatar Nov 03 '20 10:11 mortlind

Could you post a minimal but self-contained Python script that reproduces this error?

eskaur avatar Nov 03 '20 10:11 eskaur

Could you post a minimal but self-contained Python script that reproduces this error?

I posted the first three lines from the standard example. That is sufficient for me to generate the error.

mortlind avatar Nov 03 '20 10:11 mortlind

Ah, so to be clear, running either samples/sample_capture.py or samples/sample_capture_from_file.py fails with "Trace/breakpoint trap"? Could you give me the output of python samples/sample_print_version_info.py (if it works)?

eskaur avatar Nov 03 '20 10:11 eskaur

I confirm that sample_capture.py and sample_capture_from_file.py fail the same way with "Trace/breakpoint trap". Following is the version info:

ml@lib13:~/install/zivid/zivid-python$ python samples/sample_print_version_info.py 
Python: 3.8.6
zivid-python: 2.0.0.2.1.0
Zivid SDK: 2.1.0+d2007e12-1
ml@lib13:~/install/zivid/zivid-python$ 

A further piece of information: When trying to get an interface to the camera, i.e. immediately following the statement camera = app.connect_camera(), the camera fan revs up. Hence, I do believe that connecting to the camera works.

mortlind avatar Nov 03 '20 11:11 mortlind

Thank you, that looks as it should. What exact version of Debian are you running? I'd like to reproduce this problem myself.

lsb_release -a

eskaur avatar Nov 03 '20 12:11 eskaur

ml@lib13:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bullseye/sid
Release:        testing
Codename:       bullseye
ml@lib13:~$ 

mortlind avatar Nov 03 '20 12:11 mortlind

And

ml@lib13:~$ uname -a
Linux lib13 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) x86_64 GNU/Linux

mortlind avatar Nov 03 '20 12:11 mortlind

Ah that's pretty bleeding-edge. Have you also tried with the latest stable Debian by any chance? (Debian 10 / Buster)

eskaur avatar Nov 03 '20 13:11 eskaur

I do not have a stable install around at the moment, but I will try out with a live install when I find the time.

mortlind avatar Nov 03 '20 13:11 mortlind

I may be able to test with Debian 10 myself soon. May take a bit because we don't have a test-setup ready, since we don't officially support Debian.

Tip: Ubuntu is the officially supported (and most tested) distro for Zivid.

eskaur avatar Nov 03 '20 13:11 eskaur

I know that Ubuntu is the supported distribution. However, Debian is the free choice, and I will stretch a long way to get everything working on Debian :-)

The difference should be quite minor, so the errors may simply be due to implicit dependencies. If we discover, and express these in the installer, or just in the README, everything will be fine, I am sure ...

mortlind avatar Nov 03 '20 13:11 mortlind

Ubuntu is certainly free, at least in the no-cost sense. Anyway, I would like for this to work on Debian (even if we don't "officially" support it), so I'm keen to investigate further.

eskaur avatar Nov 03 '20 13:11 eskaur

Ubuntu is free as "free beer" ... for now, and probably forever. But Debian is free as in "free mind". I do agree, however, that this latter part, relating to such things as freedom, liberty, and democracy, seems to matter less and less in the global tech-oligarchy we increasingly find ourselves :-(

mortlind avatar Nov 03 '20 14:11 mortlind

Moving on... :D Does any of the core Zivid functionality work on your machine? Like Zivid Studio, CLI-tools or compiling+running C++ samples? Just want to make sure the issue lies with zivid-python.

eskaur avatar Nov 03 '20 14:11 eskaur

ZividStudio starts up, but crashes with the same error while trying to connect to the camera. Thus, this is not a zivid-python or Python 3.8 issue. I have not tried any C++-application. Do you think that is worthwhile at this stage?

mortlind avatar Nov 03 '20 14:11 mortlind

Ah that is good to know. I thought this was a zivid-python issue. No, if you've confirmed that Zivid Studio crashes with the same error then you don't need to try the C++ samples.

eskaur avatar Nov 03 '20 14:11 eskaur

Have you tried both the Ubuntu 16.04 and the Ubuntu 18.04 debs? There are some differences in which libstdc++ they link to and such, so trying the other one may help.

eskaur avatar Nov 03 '20 14:11 eskaur

Usually, you would get better exceptions if OpenCL support is missing, but can you post the output of clinfo?

We dump logs to ~/.cache/Zivid/API/Log. Can you wipe that directory and run the reproducer once more and then upload the log file that appeared in ~/.cache/Zivid/API/Log/?

nedrebo avatar Nov 03 '20 14:11 nedrebo

Here are the Zivid API log and the output of clinfo. Zivid-1604413281724-114233.log clinfo.txt

mortlind avatar Nov 03 '20 14:11 mortlind

@eskaur

Have you tried both the Ubuntu 16.04 and the Ubuntu 18.04 debs? There are some differences in which libstdc++ they link to and such, so trying the other one may help.

Good point! I have only tried the 18.04-debs. I will immediately try the 16.04-debs.

mortlind avatar Nov 03 '20 14:11 mortlind

@eskaur

Have you tried both the Ubuntu 16.04 and the Ubuntu 18.04 debs? There are some differences in which libstdc++ they link to and such, so trying the other one may help.

I tested ZividStudio with 16.04 v.2.1.0. Same error :-(

mortlind avatar Nov 03 '20 14:11 mortlind

Oh well, thanks for checking.

eskaur avatar Nov 03 '20 14:11 eskaur

The log you posted was from using the 16.04 debs, right? Could I also get the logs from the crash when running with 18.04 debs?

eskaur avatar Nov 03 '20 15:11 eskaur

The log you posted was from using the 16.04 debs, right? Could I also get the logs from the crash when running with 18.04 debs?

I believe the logs I uploaded was with 18.04. I will upload new logs tomorrow for both versions, and with definite knowledge.

mortlind avatar Nov 03 '20 16:11 mortlind

@eskaur Today I tested with a live version of Debian stable, but was unable to find the package intel-opencl-icd there. It is apparently only in unstable. Without it, as I understand, the option is mesa-opencl-icd which only gives me OpenCL v. 1.1; the intel-specialized implementation gives me v. 2.1.

I just generated the logs particular for 16.04 and 18.04. They were obtained by running sample_capture_from_file.py on my Debian testing-system with intel-opencl-icd and OpenCL v. 2.1: Zivid-2.1.0-16.04.log Zivid-2.1.0-18.04.log

mortlind avatar Nov 04 '20 19:11 mortlind

Thank you, I'll check out those logs.

Are you able to install these Intel drivers on your stable Debian?: https://zivid.atlassian.net/wiki/spaces/ZKB/pages/530842161/Intel+CPU+with+integrated+GPU These drivers are at least know to work on Ubuntu.

eskaur avatar Nov 05 '20 09:11 eskaur

I will try, but I bet that it will require upgrading to more libraries from the Debian unstable release.

mortlind avatar Nov 05 '20 10:11 mortlind

@eskaur Postponed but not forgotten ... Please do tell me, if you test this yourself :-)

mortlind avatar Nov 10 '20 07:11 mortlind