nvdla / sw

NVDLA SW
Other
489 stars 193 forks source link

Porting UMD and KMD on a FreeRTOS #167

Open asgarpasha1 opened 5 years ago

asgarpasha1 commented 5 years ago

Can anyone help me with porting the NVDLA software(nvdla/sw) on a different OS(MQX RTOS) please? I want to run inference using nvdla vp on a Synopsis controller which uses MQX RTOS. I tried to take out Linux dependencies from umd and kmd but looks like it's a very difficult task including but not limited to replacing Linux data structures and file system dependencies(nvdla is tightly coupled with Linux kernel). Or if the above is not feasible what could be a better approach to achieve this?

prasshantg commented 5 years ago

@asgarpasha1 you should be able to use https://github.com/nvdla/sw/tree/master/kmd/firmware as it is in your OS since it does not have OS dependent code.

You just need to port https://github.com/nvdla/sw/tree/master/kmd/port/linux for your OS.

What difficulties did you face?

asgarpasha1 commented 5 years ago

There are many structures in the kernel space(nvdla/sw/port/linux/) like 'kref', 'drm_file', 'drm_device' to name a few which are initialized by the kernel in some way which will then be used to initialize structures required for nvdla device in kmd firmware. Besides, there are a lot of Linux include files which have to be taken out to complete the portability. How do I go about porting it cleanly considering the issues and complexities faced above?

Also, If I have to collapse umd and kmd to make it a common user space application without having any Linux dependencies and which can run on x86 host by compiling it by gcc, what do you think should be done? Basically mean to say making /nvdla/sw/umd and /nvdla/sw/kmd completely OS independent application.

Thanks for the quick response!

akioolin commented 5 years ago

@asgarpasha1

please check the following github project https://github.com/leeehui/nvdla_riscv

for my understanding, kmd could be two part. one is for OS interface, th related code could be found in port directory. the other is for nvdla ip manipulation, which is located in firmware directory.

this project could be a very good start point for porting UMD/KMD onto FreeRTOS. for my opinion, due to FreeRTOS's memory model is phusical based, the difficulty will more simpler then Linux one. But Nvidia give us a very useful version very kindly :)

Hope this could help you.

asgarpasha1 commented 5 years ago

Thanks a ton @akioolin !! Hopefully this should help me a lot.

asgarpasha1 commented 5 years ago

@akioolin Could you please let me know the steps to run the ported NVDLA code to Risc-V on x86 host system?

akioolin commented 5 years ago

@asgarpasha1 I'm sorry for that. this project is the one I know. but I didn't test it. because i didn't have a RISC-V on x86 image with nvdla.