Commit Graph

293 Commits (master)

Author SHA1 Message Date
Dean Lee 3c08d0f1f7
clutil refactor (#2733)
* cleaup clutil.h

* clutil.c -> clutil.cc

* std::hash

* try simplify functions

* using namespace group help functions

* continue

* add function get_platform_info

* continue

* remove caching

* struct CLContext

* std::cout & CL_ERR_TO_STR

* remove CLU_NO_CACHE

* Revert "struct CLContext"

This reverts commit 882e413f22.

* cl_get_error_string : remove undefied error codes

* replace all printf with std::cout

* util::read_file

* cleanup

* revert CL_ERR_TO_STR

* simplify

* add macro CL_ERR_TO_STR

* cl_get_error_string: fix undeclared errors

* log_size should not +1

* use std::stirng log

* apply review
2020-12-11 13:05:32 +01:00
HaraldSchafer 630c7309a5
Test model refactor (#2720)
* template funcion fill_meta

* add function get_plan_max_idx

* add function get_mdn_max_idx

* remove temp builder variables

* get_mdn_max_idx->get_lead_data

* get_pan_max_idx->get_plan_data

* fill_lane_line

* combine fill_lane_line&fill_path into one function

* fill_lead_vw

* using unique_ptr

* prefer using constexpr

* more constexpr,remove duplicate defined TRAJECTORY_SIZE

* remove suffix _arr from variable name

* misc

* remove extern c

* refactor model_publish

* remove unused paramaters

* traffic_convention to c style array

* c style array:prev_desire&pulse_desire

* fix error&make easy for review

* const mat3 &transform

* move cl_command_queue into ModelState

* use maco LEAD_MHP_SELECTION

* move constexpr from .h to .cc

* remove #define MODEL_NAME

* modeldata.h: contexpr

* remove param temporal from model_init

* helper function get_best_data

* fix probs

* int

Co-authored-by: deanlee <deanlee3@gmail.com>
2020-12-09 22:48:14 -08:00
Mitchell Goff bbe9accd4d
Added model_replay and fixed some bugs in camera_replay (#2679)
* Added model_replay and fixed some bugs in camera_replay

* Unpack capnp logs on device

* add sync to device

* GPU now also works on PC

* update model ref

* update refs

* dont change this one

* Use pipeline calib instead of rlog calib

* remove that

* update refs

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-12-08 19:01:59 -08:00
Adeeb Shihadeh b3fd759fe8
log DSP execution time (#2723)
* log dsp execution time

* don't need that
2020-12-08 17:28:47 -08:00
HoverB_SN_11 18c9e42520 too wide 2020-12-08 19:31:38 +00:00
Dean Lee 531b85b983
fix fille lead (#2703) 2020-12-06 13:02:23 -08:00
ZwX1616 f30d15ea24
raw pred api (#2611)
* send both

* update cereal

* ptr type

* this is fine

* clean up

* v1 and v2

* header

* update cereal

* cereal
2020-12-02 18:46:12 -08:00
Dean Lee bd4f6650fa
simplify building capnp messages with arrays (#2617) 2020-11-30 12:08:52 +01:00
Dean Lee 42183d913f
Error checking macros for opencl (#2615)
* macro CL_CHECK&CL_CHECK_ERR

* trigger checks
2020-11-30 12:04:49 +01:00
George Hotz bdb1b766d0
Make the DSP work everywhere (#2621)
* Use DSP again

* 20 Hz

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-11-30 11:21:06 +01:00
Willem Melching feaecbd615
remove check on frame drop in modeld (#2638) 2020-11-27 16:13:37 +01:00
Comma Device 71930a4b96 mask out the priority 2020-11-24 06:05:59 +00:00
Comma Device 5a8c90f32c give the model GPU context highest priority 2020-11-24 05:57:34 +00:00
George Hotz a14ce09018
More governance work, fix thneed (#2610)
* more governance work

* fix thneed on qcom2

* waste doesn't OOM

Co-authored-by: Comma Device <device@comma.ai>
2020-11-23 17:52:28 -08:00
George Hotz 327aa123f4
Prerotate dmonitoringmodeld input (#2606)
* not tested, but something like this

* more like this

* dl and ur may still be flipped

* they were flipped

* Revert "they were flipped"

This reverts commit fbd477bb44.

Co-authored-by: Comma Device <device@comma.ai>
2020-11-23 17:42:01 -08:00
Adeeb Shihadeh d92f923d70
update frame drop filter (#2592) 2020-11-21 14:50:53 -08:00
George Hotz 917eff8c30
New settings for governors, +30% memory bandwidth (#2590)
* new settings for governors, +30% memory bandwidth

* CPU waste is better

* warm up frame_drop

* optional CORE arg for rtshield

* back off priorities of processes not critical to driving

* if it doesn't drive, it's not realtime

* err, resource. this should have been included

* reverse order to not spike

Co-authored-by: Comma Device <device@comma.ai>
2020-11-20 19:25:12 -08:00
Adeeb Shihadeh 85c9a71bc9 should be seconds 2020-11-20 14:32:22 -08:00
Adeeb Shihadeh 580589b250
log DM model execution time (#2589) 2020-11-20 13:38:31 -08:00
Comma Device 826c21b045 fix some lack of cache awareness in yuvframe2tensor 2020-11-20 18:03:06 +00:00
Comma Device 06f6f245ff simpler repro for dmon lag issue 2020-11-20 17:30:31 +00:00
George Hotz 6fc7c0c005 other includes to build repro on pc 2020-11-20 09:09:43 -08:00
Comma Device b9a8e7b209 simpler repro, no vector required 2020-11-20 17:03:49 +00:00
Comma Device 97b716512a repros better with cache clears 2020-11-20 16:50:25 +00:00
Comma Device 52673f0532 reproduce dmon lag 2020-11-20 16:39:12 +00:00
HaraldSchafer 7378bc4284
fix frame drop percentage (#2578)
* correct, I think

* add model execution time

* remove unused

* token is a file

* this is gonna change

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-11-19 21:05:29 -08:00
HaraldSchafer 7b216e7cbb
Minor fixes 08 (#2565)
* correct indexes

* best metrics yet 30231f46-08af-477e-9d30-776593913c24/700

* sometimes x decreases

* update model refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-11-17 20:04:32 -08:00
HaraldSchafer 08846b5c0e
Torch model (#2452)
* refactor draw model

* rebase master

* correct valid_len

* rename function

* rename variables

* white space

* rebase to master

* e16c13ac-927d-455e-ae0a-81b482a2c787

* start rewriting

* save proress

* compiles!

* oops

* many fixes

* seems to work

* fix desires

* finally cleaned

* wrong std for ll

* dont pulse none

* compiles!

* ready to test

* WIP does not compile

* compiles

* various fixes

* does something!

* full 3d

* not needed

* draw up to 100m

* fix segfault

* wrong sign

* fix flicker

* add road edges

* finish v2 packet

* Added pytorch supercombo

* fix rebase

* no more keras

* Hacky solution to the NCHW/NHWC incompatibility between SNPE and our frame data

* dont break dmonitoringd, final model 229e3ce1-7259-412b-85e6-cc646d70f1d8/430

* fix hack

* Revert "fix hack"

This reverts commit 5550fc01a7881d065a5eddbbb42dac55ef7ec36c.

* Removed axis permutation hack

* Folded padding layers into conv layers

* Removed the last pad layer from the dlc

* Revert "Removed the last pad layer from the dlc"

This reverts commit b85f24b9e1d04abf64e85901a7ff49e00d82020a.

* Revert "Folded padding layers into conv layers"

This reverts commit b8d1773e4e76dea481acebbfad6a6235fbb58463.

* vision model: 5034ac8b-5703-4a49-948b-11c064d10880/780  temporal model: 229e3ce1-7259-412b-85e6-cc646d70f1d8/430  with permute + pool opt

* fix ui drawing with clips

* ./compile_torch.py 5034ac8b-5703-4a49-948b-11c064d10880/780 dfcd2375-81d8-49df-95bf-1d2d6ad86010/450 with variable history length

* std::clamp

* not sure how this compiled before

* 2895ace6-a296-47ac-86e6-17ea800a74e5/550

* db090195-8810-42de-ab38-bb835d775d87/601

* 5m is very little

* onnx runner

* add onnxruntime to pipfile

* run in real time without using the whole CPU

* bump cereal;

* add stds

* set road edge opacity based on stddev

* don't access the model packet in paint

* convert mat.h to a c++ header file (#2499)

* update tests

* safety first

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: mitchell <mitchell@comma.ai>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: George Hotz <george@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-11-11 20:31:46 -08:00
Willem Melching f2c8a6122d Revert "convert mat.h to a c++ header file (#2499)"
This reverts commit 519c043a63.
2020-11-09 01:41:36 -08:00
Dean Lee 519c043a63
convert mat.h to a c++ header file (#2499) 2020-11-09 01:19:09 -08:00
ZwX1616 c0946c8bdb
generalize camera assumptions (#2423)
* clean up 1

* complain

* cleanup

* make models api generic

* clean up 2

* cleanup

* remove unused
2020-11-05 13:22:28 -08:00
Willem Melching 339d1967cb
--std=c++17 (#2330)
* switch to c++17

* more 17

* 1z

* use std::clamp

* Fix types in clamp

* bump submodules

* bump laika

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-10-17 13:33:12 -07:00
ZwX1616 6b020241c9
Clean up and test camerad refactor (#2310)
* refactor

add function get_camerabuf_by_type

remove cl_free

use camera_id

move front stuff into frontview_thread

bigger refactor

more

typo

rename camerabuf *c to *b

cleanup header files

remove wideview_thread

camera_qcom.c to c++

fix SConscript

camera_process_buf

space

sendrgb same with before

do autoexposure in processing_thread

correct sendrgb

add camera_common.cc

move yuv_transform to CameraBuf

* use C to keep consitent

* rebase master

* rebase master

* continue refactor

* refactor all camera related data&function out of main

 done

* cleanup

* -use buf.rgb_width&height

* remoe ,

* rebase master

* remove unused std::vector

* add func common_camera_process_front

* fix max

* fix sendrgb

* less crap being logged

* fix indents

* add back thumbnails

* thumbnail fixed on tici

* junk junk junk

* unify api

* fix ptr ref

* lol!

* cleanup

* more simplified

* typos

* remove terminate

* use standard polling

* ops_thread refactor, too much code!

* fix build

* ok

* assert

* listen

* incl more

* wq!

* fix more build

* macos

* fix exp targets

* front is different

* const

* bye

* remath

* remove irrelevant

* do ops in a thread

* fix init

* return null

* QCOM2 ops

* qcom2 build

* missing comma

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-16 21:58:05 -07:00
Willem Melching 2e182e5c57
Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-13 16:23:23 +02:00
Willem Melching a4ccfcffe8
Remove czmq part 1 (#2332)
* remove czmq

* remove streaming mode from loggerd

* Add include for usleep
2020-10-13 16:01:07 +02:00
ZwX1616 00b642146f
tici camera art II (#2223)
* protect highlights

* fix modeld scale factor

* rewrite logic for accurate and smooth AE

* fix condition

* tune speed

* move to qcom2

* not exactly 2x

* avoid hunting due to ettr policy

* tune to new curve

* gain kickdowns

* log params

* 4x legroom

* no limit needed here

* simple lowpass

* tweak

* pin to a remote core

* speedup AE and lower night exp

* this curve makes more sense

* tuning from fleet data

* fix ui

* only qcom2

Co-authored-by: Comma Device <device@comma.ai>
2020-10-09 16:26:43 -07:00
ZwX1616 80515576d5
Upgrade to SNPE 1.41.0 (#2285)
* snpe 1.41.0

* cleanup

* unignored

* where is my symphony

* add snpe/dsp to release files

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-10-08 17:18:01 -07:00
Logan Lasiter 7d28afcde3
Add symphony-cpu lib once (#2232) 2020-09-28 11:46:51 +02:00
Willem Melching 8cc5bfcef8 fix modeld launch script larch64 detection 2020-09-25 14:14:54 +02:00
Adeeb Shihadeh 9418b710a7
fix unused dt entry on android (#2160)
Co-authored-by: Comma Device <device@comma.ai>
2020-09-22 14:46:37 -07:00
Adeeb Shihadeh ef21b83937
Improve realtime performance on NEOS (#2166)
* fix setting core affinity

* dmonitoringd doesn't need rt priority

* android only gets two cores

* model and planner get core 2

* log missed cycle count

* neos update

* prod image

* revert NEOS changes

* still need this
2020-09-16 15:33:12 -07:00
Dean Lee 8f45685c91
remove unused submaster (#2187) 2020-09-16 11:11:07 -07:00
ZwX1616 13588e4255
improve tici camerad robustness (#2135)
* equalize performance on three threads

* need to request first

* clean up indexing

* obsolete

* handling skips and drops

* clean up repeated chunks

* use main frame id

* oneshot

* real skip check

* move to test

* should be cropped H here

Co-authored-by: Comma Device <device@comma.ai>
2020-09-14 16:05:57 -07:00
Comma Device 3801374da9 need to free tici DSP asap 2020-09-14 22:03:13 +00:00
Adeeb Shihadeh 4d5733924a
message builder (#2161)
* use custom MessageBuilder from cereal

* use MesageBuilder.toBytes

* bump cereal

* unused

* another one

* fix ui msg

Co-authored-by: deanlee <deanlee3@gmail.com>
2020-09-12 21:48:15 -07:00
Adeeb Shihadeh fdbfe52927
tici driver monitoring (#2158)
* use cpu for now on tici

* pin to core 5

* fix driver view

* probably wrong

* correct this time

* RHD too

Co-authored-by: Comma Device <device@comma.ai>
2020-09-12 17:50:22 -07:00
ZwX1616 e9f49254da
swap ur/dl (#2153) 2020-09-11 11:29:19 -07:00
Vivek Aithal c5dfbe7a72
dockerize carla + openpilot (#2011)
* dockerize carla + openpilot

* separate dockerfile

* bring back CI dockerfile

* cleanup bridge

* add op docker build and start script

* build container in CI

* fix camerad hack

* remove most magic numbers from bridge.py

* openpilot-sim docker build and run scripts

* fix dmonitoring hacks

* revert controlsd hacks

* clean up build scripts

* singular

* fix path

* fix image name

* modify sim readme

* sim readme and start script changes

* dockerfile with working opengl

* working opengl + passing panda build_st in docker

* fix bug in sim docker file

* bugfix sim docker file

* bugfix all op-sim docker issues

* modify readme + run script

* IT DRIVES

* clean this up

* more cleanup

* cleanup docker stuff

* more cleanup

* start with openpilot-base

* install carla python package

* Script is not in lib

* chmod

* everything should be running in docker now, the code may not be nice though

* works locally...

* rhdChecked is deprecated

* Checkout using git lfs when building sim container

* try to pass the tests

* pull latest docker

* gps should not throw an error on openpilot launch in bridge.py

* fixed a coding style error

* Only start ubloxd in car

* fixed more style problems

* revert typo

* Use enviromental variable to prevent errors in a simulator

* Remove unused import

* Attempt to fix missing enviromental variable

* fix typo

* less work for users, auto tmux engagement

* less work for users, auto tmux engagement

* fix check for nvidia

* clean up nvidia check

* remove typo, shorted dockerfile

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local>
Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 12:14:49 +02:00
Willem Melching 5c058140ed
tici: fix set_realtime_priority (#2124)
* cleanup and pin modeld to core 5

* Unused import
2020-09-02 17:52:41 +02:00
Willem Melching 873043b9fb 1024 MB should be enough for anyone 2020-09-02 15:12:30 +02:00
Adeeb Shihadeh 349040d958
driver monitoring cleanup (#2101)
* read rhd from param

* don't need that anymore

* fix build

* bump cereal

* read param from camerad too

* add read_db_bool helper

* bump model replay ref commit, IsRHD wasn't set
2020-08-29 17:16:00 -07:00
ZwX1616 b7bc342cc8 need no divided by 2 2020-08-28 12:20:36 -07:00
Adeeb Shihadeh 685340d578
Sound stability test (#2089)
* play sound

* clean this up

* no cereal

* fix module issue

Co-authored-by: Comma Device <device@comma.ai>
2020-08-27 15:50:48 -07:00
Willem Melching 3517d45802 make sure snpe can find libopencl 2020-08-27 11:35:52 +00:00
robbederks 37d6472bfa
Tici camerad (#2048)
* fix camera config

* typos

* oops

* more typo

* lambless

* forget to send

* visualize hist

* more typo

* 0xC000

* simple

* data loss prevention, clean up later

* loggerd

* back up code

* backup

* fixed memory leak

* fix vsync

* upload ecam

* WB

* 3stream

* fix OMX crash on loggerd rotation

* rewritten debayer kernel

* update viewer

* improved AE

* no artifact lines/grids

* standard trigger

* cleanups

* CCM

* cleanups

* slight tweak

* upd push sock

* build all these

* update tele fl

* update cereal

* upd viewer

* DualCameraState -> MultiCameraState

* cameras_open

* disable frame zmq push by default

* more cleanup

* no apks

* fix submodule error

* wat

* clean up trash

* remove junk

* only build on qcom2

* no need to check these

* update cereal

* some more minor cleanup

* bump panda

* add todo

* minor typo

* Revert "minor typo"

This reverts commit 9233a1df7c.

* not care

* use consistent hdr

* some cleanup

* Update selfdrive/camerad/main.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* more cleanups

* remove irrelevant stuff

* this too

* cleanup

* rerun ci

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
Co-authored-by: Tici <robbe@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-26 19:59:56 -07:00
Willem Melching a7be2b090d larch64 dmonitoringmodeld fixes 2020-08-26 17:49:20 +00:00
Willem Melching cd6ec8211c
larch64 modeld fixes (#2086) 2020-08-26 17:18:05 +02:00
Dean Lee 727055e0a0
remove device_id&context from ModelFrame (#2064) 2020-08-24 14:04:52 +02:00
Dean Lee de7b901dc1
move matmul3 into live_thread (#2069) 2020-08-24 14:00:00 +02:00
Dean Lee f8ab6bd009
ui: refactor model related functions (#2026)
* remove read_model

* remove structs for c-capnp

* remove duplicate #define from modeld

* add function fill_path_points

* fix Indentation

* use MODEL_PATH_DISTANCE instead of 192

* fix type

use validLen

* rename left_path_points&right_path_points to xxx_lane_points
2020-08-18 15:26:43 +02:00
Dean Lee d158837617
add function cl_get_device_id (#1948)
* add func cl_get_device_id

cleanup

* add fix from review
2020-08-17 11:24:39 +02:00
Dean Lee 36801a70eb
init and destroy transform_lock (#2003) 2020-08-16 16:31:53 -07:00
Dean Lee cccb63229d
fix bug that visionstream_destroy may be called twice (#1999) 2020-08-08 15:50:36 -07:00
Dean Lee ef435ef2ac
Make sure memory is released by using unique_ptr (#1958) 2020-08-05 12:27:56 +02:00
Dean Lee f80acad519
modeld: read frame_id if sm.update(0)>0 (#1947)
* read frameid if sm.update(0)>0

* move postion

same line
2020-08-01 11:01:43 -07:00
ZwX1616 2cfa0edb4c
EfficientNet driver monitoring (#1907)
* e96f9be6

* bump cereal

* filter sunglasses

* fix unittest

* update refs

* udpate refs

* update refs

* add tolerance for dmonitoringd

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-07-27 20:22:06 -07:00
Adeeb Shihadeh 5db81f60ca
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
2020-07-19 16:12:22 -07:00
Adeeb Shihadeh 35a5b057c1 minor cleanups from LGTM 2020-07-17 23:34:38 -07:00
ZwX1616 c2be31c10b Revert "EfficientNet driver monitoring (#1866)"
This reverts commit 2d0e994674.

Need to fix test
2020-07-17 18:20:04 -07:00
ZwX1616 2d0e994674
EfficientNet driver monitoring (#1866)
* e96f9be6

* bump cereal

* filter sunglasses

* fix unittest

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-07-17 15:34:02 -07:00
Adeeb Shihadeh 58c3b5ba84
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 a8e7a187ca.

* 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>
2020-07-14 14:23:27 -07:00
Adeeb Shihadeh 704bc1b883
small scons cleanup (#1858) 2020-07-10 15:26:16 -07:00
Adeeb Shihadeh c8f3ff8913 only check frame age for posenet too 2020-07-09 20:55:56 -07:00
Adeeb Shihadeh 587bdf5937 only check frame age for model validity 2020-07-09 20:37:28 -07:00
Adeeb Shihadeh 03e824a4b5
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
2020-07-09 17:02:21 -07:00
Adeeb Shihadeh eb1aa3d831
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>
2020-07-09 09:25:32 -07:00
Willem Melching 5e10efead1 Fix unsigned overflow in modeld frame age computation 2020-06-22 19:31:57 -07:00
Willem Melching 88f9266378
Make model packets invalid when frames are too old (#1759)
* make model packets invalid when frames are too old

* add frame numbers to cloudlog
2020-06-22 14:27:58 -07:00
Willem Melching a8e7a187ca Fix modeld dropping frames if processing takes over 50 ms 2020-06-19 16:57:28 -07:00
George Hotz 01a486308d
c++ify thneed to remove memory leaks (#1737)
Co-authored-by: Comma Device <device@comma.ai>
2020-06-19 15:53:48 -07:00
Dean Lee c8082190a0
release resources in modeld (#1700) 2020-06-19 11:38:39 -07:00
Jason Young 80101b350b
modeld process time logging to DEBUG (#1720)
Co-authored-by: Jason Young <jason@comma.ai>
2020-06-16 10:36:04 -07:00
Willem Melching 4ca8283d73
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
2020-06-15 15:58:12 -07:00
George Hotz 344a9a3699
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>
2020-06-11 18:21:59 -07:00
Jason Young ec5fc0e92b
Update realtime priority for modeld/dmonitoringd (#1675) 2020-06-10 17:40:22 -04:00
Dean Lee 90d97de74d
add function read_db_bytes (#1662) 2020-06-09 13:46:49 -07:00
George Hotz 7770041f92
Getting PC openpilot working again (#1650)
* fixup keras_runner to work and be nicer

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

* add E502

* no whitespace warnings

* fix violations

* no W391

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

* cleanup in progress

* done cleaning up

* no opendbc
2020-06-02 16:29:32 -07:00
Dean Lee cdb48cc180
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
2020-06-01 14:00:43 -07:00
Adeeb Shihadeh f3dcf861c7 enable flake8 E303: too many blank lines 2020-05-31 17:21:11 -07:00
Adeeb Shihadeh 27754a277c enable E261 in flake8: two spaces before inline comment 2020-05-31 14:07:29 -07:00
Adeeb Shihadeh efd5dffb1e enable flake8 E231: missing whitespace after comma 2020-05-31 12:49:11 -07:00
Dean Lee af36aa28ab
driving.cc: Pass ModelDataRaw by reference (#1600)
* pass ModelDataRaw by reference

* pass NVGpaint by refer
2020-05-30 10:08:44 -07:00
Willem Melching ba2ac1207a
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
2020-05-28 15:40:48 -07:00
Willem Melching 50f3f1d335
-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>
2020-05-26 13:27:01 -07:00
Dean Lee d5858955ee
reduce the scope of mutex (#1561) 2020-05-26 09:57:14 -07:00
George Hotz b8571710e0
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
2020-05-24 03:33:36 -07:00
Willem Melching ab5af232b2
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>
2020-05-21 16:04:33 -07:00
George Hotz 6c0ad1e675
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>
2020-05-18 11:34:29 -07:00
Comma Device 495e0c4648 wtf, how was that commented out and the tests still passed 2020-05-18 17:10:39 +00:00
George Hotz 78a352a8ca
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>
2020-05-17 23:13:17 -07:00
George Hotz 302d06ee70 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>
2020-05-15 13:53:01 -07:00
Willem Melching add784a7df
remove eigen from phonelibs (#1505) 2020-05-13 16:41:52 -07:00
Willem Melching 72db8d890d
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
2020-05-12 18:50:07 -07:00
Harald Schafer ee10697d86 safer 2020-05-10 22:00:41 -07:00
robbederks 71bebc4fca
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
2020-05-08 19:39:18 -07:00
HaraldSchafer 65fcc7c45f
Better poly (#1437)
- better polyfitting
- no mpc cost change during lane change
- model trained with better ll gt, sim noise and guaranteed memories
2020-05-08 17:14:43 -07:00
Dean Lee b6d6f52032
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
2020-05-07 20:14:30 -07:00
George Hotz d5ca841b0f Revert "Bypass alignment related copy whenever possible (#1443)"
This reverts commit b225016628.
2020-05-04 09:54:05 -07:00
George Hotz e568d3cadc
More LGTM fixups (#1457)
* exclude lib dirs, fix 3 cpp errors

* fix more alerts, exclude mkvparse

Co-authored-by: George Hotz <geohot@gmail.com>
2020-05-02 20:00:41 -07:00
George Hotz 1295cfe06c
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>
2020-05-02 12:07:34 -07:00
Dean Lee b225016628
Bypass alignment related copy whenever possible (#1443)
remove blank lines

add file messagehelp.h

remove blank line

simplify

after review
2020-05-01 19:21:00 -07:00
Dean Lee 98ec06e125
unmap a previously mapped buff (#1410) 2020-04-22 10:16:05 -07:00
Dean Lee 2928c53e4f
cleanup visionipc when recovering from fault in dmonitoringd and loggerd (#1402) 2020-04-20 13:15:11 -07:00
Andrew Sidhu a120adaecc
Fix by Boggyver - Add Traffic Convention data to input buffer (#1405)
Credit goes to Boggyver for finding this.
2020-04-20 10:05:33 -07:00
Dean Lee ce4528c392
dmonitoringmodeld: fix memory leak (#1403) 2020-04-20 09:23:23 -07:00
Dean Lee 25ab2521ab
fixes the error with OpenCL depreciation warnings (#1394) 2020-04-19 14:04:33 -07:00
Willem Melching e171a7a047 modeld, add cloudlogs 2020-04-19 14:00:30 -07:00
Dean Lee 8f2858efba
modeld, cleanup visionipc when recovering from fault 2020-04-19 13:59:36 -07:00
Willem Melching 02e474580e
Release messaging sockets and context on shutdown (#1391)
* release resources when thread is done

* add white space

* add white space

Co-authored-by: deanlee <deanlee3@gmail.com>
2020-04-17 16:37:34 -07:00
ZwX1616 6c5080fa98
fix RHD memory leak 2020-04-16 17:31:59 -07:00
HaraldSchafer f5b28ad2d2
add traffic convention (#1372)
* I think this works

* clean up
2020-04-15 21:19:25 -07:00
ZwX1616 133b1a20b4
RHD support for driver monitoring (#1299) 2020-04-15 16:48:44 -07:00
HaraldSchafer d3edc594ce
Traffic b2 (#1345)
* add traffic convention

* hope this work

* no comment

* latest and gratest

* big gru model

* 1af55c7d-ee15-414a-9e98-a0cb08c3441f/75

* much later in training

* wrong temporal size

* converged

* fix lane changes
2020-04-13 13:27:06 -07:00
George Hotz 8db0993663
tici: add (somewhat) broken camerad support (#1300)
* capnparm

* building in progress

* scons build works

* that script fixes opencl

* start new camera code

* includes and more camera scripts

* control c works now

* no device control yet

* phy too

* just one camera for now

* fix capnparm

* hmm, the inits are needed

* more cameras

* link stop start

* doesn't work yet

* fix ion on qcom2

* start poll ish

* 4 pictures and done

* no jpeg

* it works to picture

* destroy sync obj

* both work for now

* defined QCOM2

* fix fd leak

* run modeld

* 10 bit mode

* real frame stride

* needs digital gain

* dnew

* no color correcting on new

* that snpe doesn't work

* qcom2 gate

* cleanups

* oops, fix aarch64 detector

* update cereal

* modeld works with SNPE

* fix driver monitoring model

Co-authored-by: Tici <robbe@comma.ai>
2020-03-31 16:34:55 -07:00
George Hotz 6e5a2d404b
Preparing for the efficientnet (#1255)
* snpe version 1.35.0.698

* fix files common for new snpe

* efficient net with normal names

* compiling with 1.32 works

* actual snpe files

* fix monitoring, delete unneeded

* point the symlinks to the right places

* err, modeld needs the CPU

* benchmark for 50 its

* put back old model for now

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
Co-authored-by: George Hotz <geohot@gmail.com>
2020-03-30 14:20:51 -07:00
ZwX1616 a95e61edf4
add webcam to cameras (#1201) 2020-03-26 19:19:47 -07:00
Harald Schafer d02f55ae0b add long_x 2020-03-26 17:40:12 -07:00
Comma Device 9a50e0445a add program dumping to opencl hooks 2020-03-18 03:30:39 +00:00
George Hotz 774912075a
hook opencl to profile SNPE (#1249)
* hook for snpe speed

* hook works

* prints kernel names

* add timing to hook

* clean up printing

Co-authored-by: Comma Device <device@comma.ai>
2020-03-17 20:04:55 -07:00
HaraldSchafer 63d3bb517f
Pulse desire (#1172)
* initial

* compilation fixes

* add desire

* pulse desire

* 0d5728f6-a918-40a6-bce3-a9d0f1238180/20

* cleaner

* inject model

* inject model

* test runs

* ah already done I see

* remove useless

* update

* updates, doesnt work

* fix generating new references

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-03-04 18:51:45 -08:00
Harald Schafer 5f34f17c9e cutin not correctly parsed 2020-02-20 13:28:23 -08:00
Comma Device 042415b021 actually fix benchmark script 2020-02-19 02:27:31 +00:00
Comma Device a8f5562081 fix snpe_benchmark script 2020-02-19 02:13:46 +00:00
George Hotz c50c718293
Cleanup simulator and add usage instructions (#1050)
* cleanup simulator files

* minor updates

* update readme

* keras runner builds

* hmm, still doesn't work

* keras runner works

* should work with python3 keras mod

* touchups
2020-02-04 19:46:57 -08:00
HaraldSchafer f610e596c4
Multipath supercombo (#1036)
* exclude stuff outside of validity window

* 94dd2da7-23ae-4628-9d12-37f58b379110/10

* fbe443fd-1d65-4b4d-8e3a-3817b58bacd0/50

* sanity clip
2020-02-03 11:25:22 -08:00
ZwX1616 6322a275d6
dmonitoringd (#1016) 2020-01-30 19:12:44 -08:00
George Hotz 6ceffe68d0 base SNPE path off home dir, still not really generic 2020-01-17 17:45:38 -08:00
George Hotz da079d47d7 logcatd, loggerd, mapd, modeld, proclogd 2020-01-17 11:20:17 -08:00