Commit Graph

80 Commits

Author SHA1 Message Date
Adeeb Shihadeh
cd317b0780 Fix most remaining LGTM alerts (#1893)
* fixups from LGTM

* short globals

* fix spinner and textwindow

* total ordering

* no spinner/text window when import from manager

* not android
old-commit-hash: 5db81f60ca
2020-07-19 16:12:22 -07:00
Adeeb Shihadeh
370a68623e minor cleanups from LGTM
old-commit-hash: 35a5b057c1
2020-07-17 23:34:38 -07:00
ZwX1616
556752a77b Revert "EfficientNet driver monitoring (#1866)"
This reverts commit 0bc9d737dde1a50937d421f7a417260732f90480.

Need to fix test

old-commit-hash: c2be31c10b
2020-07-17 18:20:04 -07:00
ZwX1616
7a8bf9d7de EfficientNet driver monitoring (#1866)
* e96f9be6

* bump cereal

* filter sunglasses

* fix unittest

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2d0e994674
2020-07-17 15:34:02 -07:00
Adeeb Shihadeh
c374f03187 Revert modeld vipc conflate behavior and alert on dropped frame percent (#1877)
* Revert "Fix modeld dropping frames if processing takes over 50 ms"

This reverts commit fb908877a50d72e20a047bd4138316b12c8a30cc.

* track frame drop

* fix unused

* alert on frame drop perc

* reduce thresholds

* posenet is invalid on non-consecutive frames

* Refactor filter time constant

* Use vipc_dropped_frames for posenet valid check

* Actually set frame drop percentage

* Add explicit cast just to be sure

* Prevent frames dropped to go up to quickly on startup

* bump cereal

* reduce soft disable threshold to 1%

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 58c3b5ba84
2020-07-14 14:23:27 -07:00
Adeeb Shihadeh
ef00c30f3a small scons cleanup (#1858)
old-commit-hash: 704bc1b883
2020-07-10 15:26:16 -07:00
Adeeb Shihadeh
4d9200f307 only check frame age for posenet too
old-commit-hash: c8f3ff8913
2020-07-09 20:55:56 -07:00
Adeeb Shihadeh
c8a9fb9321 only check frame age for model validity
old-commit-hash: 587bdf5937
2020-07-09 20:37:28 -07:00
Adeeb Shihadeh
a1dbb38a0c Alert when modeld is lagging by more than a frame (#1823)
* alert when modeld is lagging by more than 1 frame

* log frameAge in modelData

* set posenet valid

* compute frame_age once
old-commit-hash: 03e824a4b5
2020-07-09 17:02:21 -07:00
Adeeb Shihadeh
cdfb090c7a Wunused (#1841)
* enable Wunused, first pass

* unused stuff in snpe model

* these are used on phone

* handle sigint and sigterm in modeld

* fix phone build

* camera qcom

* QCOM build works

* delete unused camerad vars

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: eb1aa3d831
2020-07-09 09:25:32 -07:00
Willem Melching
2e056ae2a3 Fix unsigned overflow in modeld frame age computation
old-commit-hash: 5e10efead1
2020-06-22 19:31:57 -07:00
Willem Melching
b772d12f87 Make model packets invalid when frames are too old (#1759)
* make model packets invalid when frames are too old

* add frame numbers to cloudlog
old-commit-hash: 88f9266378
2020-06-22 14:27:58 -07:00
Willem Melching
f9cae2aa8f Fix modeld dropping frames if processing takes over 50 ms
old-commit-hash: a8e7a187ca
2020-06-19 16:57:28 -07:00
George Hotz
83f6ec221f c++ify thneed to remove memory leaks (#1737)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 01a486308d
2020-06-19 15:53:48 -07:00
Dean Lee
e04a272892 release resources in modeld (#1700)
old-commit-hash: c8082190a0
2020-06-19 11:38:39 -07:00
Jason Young
266130770f modeld process time logging to DEBUG (#1720)
Co-authored-by: Jason Young <jason@comma.ai>
old-commit-hash: 80101b350b
2020-06-16 10:36:04 -07:00
Willem Melching
725c5e742f Modeld: loop over platforms to find CPU/GPU (#1710)
* Modeld: loop over platforms to find gpu

* Remove prints

* PC needs CPU

* Keep default for qcom

* Update error message
old-commit-hash: 4ca8283d73
2020-06-15 15:58:12 -07:00
George Hotz
5d069eb8c3 Fixups for Mac, and a bunch for PC (#1654)
* fix mac nui

* fix cereal

* builds on mac without warnings

* ui swap shouldn't be instant on pc

* camerad builds on mac

* modeld, and now everything, builds on mac

* ui draws pictures on mac now

* fix camerad shutdown

* support ui looping on pc

* python3 on that

* SCNu64 should be cross platform

* bump cereal and new apk

* clean up

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 344a9a3699
2020-06-11 18:21:59 -07:00
Jason Young
fae70a4d99 Update realtime priority for modeld/dmonitoringd (#1675)
old-commit-hash: ec5fc0e92b
2020-06-10 17:40:22 -04:00
Dean Lee
5fb85ede56 add function read_db_bytes (#1662)
old-commit-hash: 90d97de74d
2020-06-09 13:46:49 -07:00
George Hotz
4b6c80336b Getting PC openpilot working again (#1650)
* fixup keras_runner to work and be nicer

* truncate the lane lines based on the valid len
old-commit-hash: 7770041f92
2020-06-05 17:40:56 -07:00
Dean Lee
bbafa5a72d pass DMonitoringResult as referer (#1639)
old-commit-hash: c7ff6dd194
2020-06-05 12:42:01 -07:00
Adeeb
9027018368 Update Flake8 config (#1624)
* update flake8 checks

* add E502

* no whitespace warnings

* fix violations

* no W391

Co-authored-by: Jason Young <jason@comma.ai>
old-commit-hash: 367155168a
2020-06-03 16:13:34 -07:00
George Hotz
669977eb1f save valid_len
old-commit-hash: 4e7fe3a9ec
2020-06-03 14:18:42 -07:00
Adeeb
d035394ce7 Add pre-commit hooks (#1629)
old-commit-hash: ab83e48ec4
2020-06-03 12:54:49 -07:00
Willem Melching
a56e2b01f8 Make pylint more strict (#1626)
* make pylint more strict

* cleanup in progress

* done cleaning up

* no opendbc
old-commit-hash: 843a64c72f
2020-06-02 16:29:32 -07:00
Dean Lee
dbc8ca1d26 dmonitoring : use memory cache to avoid malloc/free on every frame (#1599)
* use memory cache

* use template function to return buffer

* inline function

* const size_t

* use std::vector instead of kj::array
old-commit-hash: cdb48cc180
2020-06-01 14:00:43 -07:00
Adeeb Shihadeh
9823f1164c enable flake8 E303: too many blank lines
old-commit-hash: f3dcf861c7
2020-05-31 17:21:11 -07:00
Adeeb Shihadeh
68a3061c9d enable E261 in flake8: two spaces before inline comment
old-commit-hash: 27754a277c
2020-05-31 14:07:29 -07:00
Adeeb Shihadeh
be0b43f339 enable flake8 E231: missing whitespace after comma
old-commit-hash: efd5dffb1e
2020-05-31 12:49:11 -07:00
Dean Lee
b72fcb69e2 driving.cc: Pass ModelDataRaw by reference (#1600)
* pass ModelDataRaw by reference

* pass NVGpaint by refer
old-commit-hash: af36aa28ab
2020-05-30 10:08:44 -07:00
Willem Melching
2ac27def5a Running pre-commit in CI (#1590)
* Running pre-commit in CI

* fix dockerfile syntax

* dont run on submodule repo folders

* Fix some import errors in ci

* more stuff

* That should be the last one
old-commit-hash: ba2ac1207a
2020-05-28 15:40:48 -07:00
Willem Melching
91f1082394 -Werror (#1567)
* werror

* -Wno-inconsistent-missing-override

* Silence ffmpeg deprecation warnings

* add some more pragmas to ignore warnings

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 50f3f1d335
2020-05-26 13:27:01 -07:00
Dean Lee
9d31c0194f reduce the scope of mutex (#1561)
old-commit-hash: d5858955ee
2020-05-26 09:57:14 -07:00
George Hotz
6a68510918 remove the clCreateProgramWithSource interceptor (#1559)
* remove the clCreateProgramWithSource interceptor

* that's old code, thneed is better

* label them thneed_, we shouldn't need to touch CL for anything not SNPE related
old-commit-hash: b8571710e0
2020-05-24 03:33:36 -07:00
Willem Melching
7f0b3180a4 Use C++ version of SubMaster and PubMaster (#1548)
* add PubMaster & SubMaster

remove 'delete msg'

remove headers

* use constructor to initial all submster

* modify drain sockets

* fix typo in ssconscript.remove lines

no checkValid in loggerd

last modify

handle_message:event->&event

fix type

remove heads

event to auto

* new interface

* api changed

* Revert "use constructor to initial all submster"

This reverts commit 73be7ea46250a325ce41d3a0445e34395a2ae692.

* change to new api

* revert loggerd

* dd

* use new PubSub api

* update to new interface

don't modify loggerd

reset panda

reset opendbc

remove empty lines

* switch to new pubMaster

* update to the new inteface

change

remove error code

. to ->

merge paramsd.cc

update panda

fix typo

simplify

fix typo

* Fix build

* always conflate

Co-authored-by: deanlee <deanlee3@gmail.com>
old-commit-hash: ab5af232b2
2020-05-21 16:04:33 -07:00
George Hotz
11628b1f14 add thneed self test (#1535)
* add thneed self test

* don't do the memset in thneed, shouldn't matter though

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 6c0ad1e675
2020-05-18 11:34:29 -07:00
Comma Device
16c1926f64 wtf, how was that commented out and the tests still passed
old-commit-hash: 495e0c4648
2020-05-18 17:10:39 +00:00
George Hotz
988361dd92 This isn't bigmodel, but there's a lot of good stuff here (#1532)
* bigmodel

* more debug print

* debugging bigmodel

* remove the tanh, debugging

* print images/buffers

* disassemble the command queues

* decompiler

* dump the shaders

* full disasm

* support patching kernel and fixing convolution_horizontal_reduced_reads_1x1

* microbenchmark

* 42 GFLOPS, 1 GB/s

* gemm benchmark

* 75 GFLOPS vs 42 GFLOPS

* 115 GFLOPS

* oops, never mind

* gemm image is slow

* this is pretty hopeless

* gemm image gets 62 GFLOPS

* this is addictive and still a waste of time

* cleanup cleanup

* that hook was dumb

* tabbing

* more tabbing

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 78a352a8ca
2020-05-17 23:13:17 -07:00
George Hotz
206b6abe7d thneed saves 45% of a core (#1512)
* thneed runs the model

* thneed is doing the hooking

* set kernel args

* thneeding the bufferS

* print the images well

* thneeds with better buffers

* includes

* disasm adreno

* parse packets

* disasm works

* disasm better

* more thneeding

* much thneeding

* much more thneeding

* thneed works i think

* thneed is patient

* thneed works

* 7.7%

* gpuobj sync

* yay, it mallocs now

* cleaning it up, Thneed

* sync objs and set power

* thneed needs inputs and outputs

* thneed in modeld

* special modeld runs

* can't thneed the DSP

* test is weird

* thneed modeld uses 6.4% CPU

* add thneed to release

* move to debug

* delete some junk from the pr

* always track the timestamp

* timestamp hacks in thneed

* create a new command queue

* fix timestamp

* pretty much back to what we had, you can't use SNPE with thneed

* improve thneed test

* disable save log

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 302d06ee70
2020-05-15 13:53:01 -07:00
Willem Melching
aedf223401 remove eigen from phonelibs (#1505)
old-commit-hash: add784a7df
2020-05-13 16:41:52 -07:00
Willem Melching
8505259e41 Library cleanup (#1491)
* library cleanup

* remove fastcv

* Fix build step

* bump cereal

* bump cereal

* Install capnp

* bump

* no docker cache

* Update installation instructions

* Needs sudo

* Can we sudo?

* Cache was not the problem

* remove static libraries from boardd install script

* Update setup script

* Remove import

* No capnp install in lgtm

* Fix dockerfile
old-commit-hash: 72db8d890d
2020-05-12 18:50:07 -07:00
Harald Schafer
02eeef5f2b safer
old-commit-hash: ee10697d86
2020-05-10 22:00:41 -07:00
robbederks
5a12fc32e7 Ambient light calibration parameters on persist partition (#1429)
* WIP: light sensor persistent params

* fix params writing

* Persistent params argument in C params lib. Fixed symlink flow

* Removed debug prints

* fix boardd

* fix ui

* remove debug print
old-commit-hash: 71bebc4fca
2020-05-08 19:39:18 -07:00
HaraldSchafer
f3747d2fe5 Better poly (#1437)
- better polyfitting
- no mpc cost change during lane change
- model trained with better ll gt, sim noise and guaranteed memories
old-commit-hash: 65fcc7c45f
2020-05-08 17:14:43 -07:00
Dean Lee
0b0674ef20 camerad: move c-capnp to c++ (#1472)
* convert c-capnp to c++

change paramater type

* remove c-capnp header from commonmodel.c

* unsigned short -> uint16_t

* MSM_CAMERA_I2C_ADDR_TYPE_MAX->4
old-commit-hash: b6d6f52032
2020-05-07 20:14:30 -07:00
George Hotz
16cbb5e255 Revert "Bypass alignment related copy whenever possible (#1443)"
This reverts commit 235d4f8957ee4566d6217783638fa58a586bb35a.

old-commit-hash: d5ca841b0f
2020-05-04 09:54:05 -07:00
George Hotz
d47b2ef576 More LGTM fixups (#1457)
* exclude lib dirs, fix 3 cpp errors

* fix more alerts, exclude mkvparse

Co-authored-by: George Hotz <geohot@gmail.com>
old-commit-hash: e568d3cadc
2020-05-02 20:00:41 -07:00
George Hotz
6fbcde48e5 Using lgtm.com and fixing found alerts (#1452)
* lgtm in readme, and mac nui fixes

* call super inits in radars

* unused imports, dup lines

* more radars, more unused imports

* pass CP into RadarInterfaceBase

* more fixups

* unused imports

* delete unused lines

* ugh, new unused import

Co-authored-by: George Hotz <geohot@gmail.com>
old-commit-hash: 1295cfe06c
2020-05-02 12:07:34 -07:00
Dean Lee
f2932aadfd Bypass alignment related copy whenever possible (#1443)
remove blank lines

add file messagehelp.h

remove blank line

simplify

after review
old-commit-hash: b225016628
2020-05-01 19:21:00 -07:00