Imaging solutions with Free Software & Open Hardware

Who's online

There are currently 0 users online.

Subscribe to Wiki Recent Changes feed
Track the most recent changes to the wiki in this feed. MediaWiki 1.28.0
Updated: 4 min 27 sec ago

103993

Thu, 05/21/2020 - 12:22

new pcb for FLIR Boson camera core

New page

==103993==
Adapter for FLIR Boson 640x512 LWIR sensor module
[[Image:103993_pcb-layout.png|thumb|400px|
[[Media:103993_sch.pdf|103992 circuit diagram]] <br/>
[[Media:103993_gerber.tar.gz|103992 Gerber files]] <br/>
[[Media:103993_assy.tar.gz|103992 placement files]]
]] Andrey.filippov

File:103993 gerber.tar.gz

Thu, 05/21/2020 - 12:18

Andrey.filippov uploaded File:103993 gerber.tar.gz

New page

== Licensing ==
{{CERN OHLv1.1 }} Andrey.filippov

File:103993 assy.tar.gz

Thu, 05/21/2020 - 12:18

Andrey.filippov uploaded File:103993 assy.tar.gz

New page

== Licensing ==
{{CERN OHLv1.1 }} Andrey.filippov

File:103993 sch.pdf

Thu, 05/21/2020 - 12:17

Andrey.filippov uploaded File:103993 sch.pdf

New page

== Licensing ==
{{CERN OHLv1.1 }} Andrey.filippov

File:103993 pcb-layout.png

Thu, 05/21/2020 - 12:16

Andrey.filippov uploaded File:103993 pcb-layout.png

New page

== Licensing ==
{{GNU FDLv1.3 }} Andrey.filippov

Main Page

Thu, 05/21/2020 - 11:09

← Older revision Revision as of 17:09, 21 May 2020 Line 16: Line 16:  **[[10393#More_details|Electronics]] **[[10393#More_details|Electronics]]  **[[Elphel_camera_parts_0393|Mechanical parts]] **[[Elphel_camera_parts_0393|Mechanical parts]] −*[[Elphel_camera_assemblies|View 3D models]]+*[[Elphel_camera_assemblies|View camera models in 3D]]  *[[Roadmap_393|Roadmap]] *[[Roadmap_393|Roadmap]]  <!--|'''[[Previous Models]]'''<br> old products--> <!--|'''[[Previous Models]]'''<br> old products--> Oleg

10393 manual

Wed, 05/20/2020 - 14:48

‎Firmware images

← Older revision Revision as of 20:48, 20 May 2020 (2 intermediate revisions by the same user not shown)Line 11: Line 11:  |valign='top'|[[File:NC393-CS marked ports.jpeg|thumb|200px|Fig.1a 10393 interfaces]] |valign='top'|[[File:NC393-CS marked ports.jpeg|thumb|200px|Fig.1a 10393 interfaces]]  |valign='top'|[[File:10393_boards_assembly.png|thumb|265px|Fig.1b Boards connections (NC393-F-CS)]] |valign='top'|[[File:10393_boards_assembly.png|thumb|265px|Fig.1b Boards connections (NC393-F-CS)]] −|valign='top'|[[File:10393 dev mmc.jpeg|thumb|150px|Fig.1c Using micro SD card for development]]+|valign='top'|[[File:10393 dev mmc.jpeg|thumb|150px|Fig.1c Micro SD card for development]]  |} |}  * Power supply options ([[10393_power|more information]]): * Power supply options ([[10393_power|more information]]): Line 351: Line 351:     ==<font color="blue">Firmware images</font>== ==<font color="blue">Firmware images</font>== −* [https://community.elphel.com/files/393/20200508/ '''20200508''']+* [https://community.elphel.com/files/393/20200520/ '''20200520''']  +* [https://community.elphel.com/files/393/20200508/ 20200508]  * [https://community.elphel.com/files/393/20190321/ 20190321] * [https://community.elphel.com/files/393/20190321/ 20190321] −* [https://community.elphel.com/files/393/20180511/ 20180511]      ===Changelog=== ===Changelog=== −  <font size='1'>'''==20200508=='''+  <font size='1'>'''==20200520=='''  + (rocko build)  + * Set time on main page access - taking browser time and writing to 10393 if times differ by 24h+.  + * Added script for sensor testing (switch to test pattern, check md5sum).  +  Supporting MT9P006. Linked to main page.  + * Main page:  +  * Added links to page displaying MJPEG stream in canvas  +  * Added more controls (FPS, Manual Exposure and Auto Exposure Limit)  +  * Added quick switch to 1080p@30fps (MT9P006)  + * Updated JPEG/JP4 decoding javascript plugin - less time (-10ms) spent on EXIF reading.  + * Created utils.php, currenty helps to GET-request:  +  * ports configuration  +  * set/get system time  + * Fixed snapshot button for cameras with unused ports in multicam/ UI.  + '''==20200508=='''    (rocko build)   (rocko build)    * updated camogm   * updated camogm Oleg

10393 manual

Wed, 05/20/2020 - 14:48

‎Firmware images

← Older revision Revision as of 20:48, 20 May 2020 (3 intermediate revisions by the same user not shown)Line 11: Line 11:  |valign='top'|[[File:NC393-CS marked ports.jpeg|thumb|200px|Fig.1a 10393 interfaces]] |valign='top'|[[File:NC393-CS marked ports.jpeg|thumb|200px|Fig.1a 10393 interfaces]]  |valign='top'|[[File:10393_boards_assembly.png|thumb|265px|Fig.1b Boards connections (NC393-F-CS)]] |valign='top'|[[File:10393_boards_assembly.png|thumb|265px|Fig.1b Boards connections (NC393-F-CS)]] −|valign='top'|[[File:10393 dev mmc.jpeg|thumb|150px|Fig.1c Using micro SD card for development]]+|valign='top'|[[File:10393 dev mmc.jpeg|thumb|150px|Fig.1c Micro SD card for development]]  |} |}  * Power supply options ([[10393_power|more information]]): * Power supply options ([[10393_power|more information]]): Line 322: Line 322:  ** link the recorded logs to /www/pages/logs/ ** link the recorded logs to /www/pages/logs/  ** refresh http://192.168.0.9/read_imu_log.php ** refresh http://192.168.0.9/read_imu_log.php  +  +==<font color="blue">Set system time</font>==  +  +===Command line from PC===  + <font size='2'># Compare PC and camera clocks  + ~$ ssh root@192.168.0.9 date;date -u  + # Write PC time into camera clock  + ~$ ssh root@192.168.0.9 "date -s @`( date -u +"%s" )` &&  hwclock -w"  +  +===PHP===  +If in the current firmware includes '''http://192.168.0.9/utils.php''' then the clock is checked every time the index page is opened ('''http://192.168.0.9'''). The clock is then updated if the browser time differs from the camera time by more than 24h.  +  +It's also possible to force apply time using the following GET request:  + <nowiki>http://192.168.0.9/utils.php?cmd=time&apply&ts=<timestamp_in_ms></nowiki>  + #example:  + <nowiki>http://192.168.0.9/utils.php?cmd=time&apply&ts=1589913066650</nowiki>     ==<font color="blue">eSATA port switching</font>== ==<font color="blue">eSATA port switching</font>== Line 335: Line 351:     ==<font color="blue">Firmware images</font>== ==<font color="blue">Firmware images</font>== −* [https://community.elphel.com/files/393/20200508/ '''20200508''']+* [https://community.elphel.com/files/393/20200520/ '''20200520''']  +* [https://community.elphel.com/files/393/20200508/ 20200508]  * [https://community.elphel.com/files/393/20190321/ 20190321] * [https://community.elphel.com/files/393/20190321/ 20190321] −* [https://community.elphel.com/files/393/20180511/ 20180511]      ===Changelog=== ===Changelog=== −  <font size='1'>'''==20200508=='''+  <font size='1'>'''==20200520=='''  + (rocko build)  + * Set time on main page access - taking browser time and writing to 10393 if times differ by 24h+.  + * Added script for sensor testing (switch to test pattern, check md5sum).  +  Supporting MT9P006. Linked to main page.  + * Main page:  +  * Added links to page displaying MJPEG stream in canvas  +  * Added more controls (FPS, Manual Exposure and Auto Exposure Limit)  +  * Added quick switch to 1080p@30fps (MT9P006)  + * Updated JPEG/JP4 decoding javascript plugin - less time (-10ms) spent on EXIF reading.  + * Created utils.php, currenty helps to GET-request:  +  * ports configuration  +  * set/get system time  + * Fixed snapshot button for cameras with unused ports in multicam/ UI.  + '''==20200508=='''    (rocko build)   (rocko build)    * updated camogm   * updated camogm Oleg

10393 manual

Tue, 05/19/2020 - 13:30

‎Event Logger (GPS, IMU, IMG & EXT)

← Older revision Revision as of 19:30, 19 May 2020 Line 322: Line 322:  ** link the recorded logs to /www/pages/logs/ ** link the recorded logs to /www/pages/logs/  ** refresh http://192.168.0.9/read_imu_log.php ** refresh http://192.168.0.9/read_imu_log.php  +  +==<font color="blue">Set system time</font>==  +  +===Command line from PC===  + <font size='2'># Compare PC and camera clocks  + ~$ ssh root@192.168.0.9 date;date -u  + # Write PC time into camera clock  + ~$ ssh root@192.168.0.9 "date -s @`( date -u +"%s" )` &&  hwclock -w"  +  +===PHP===  +If in the current firmware includes '''http://192.168.0.9/utils.php''' then the clock is checked every time the index page is opened ('''http://192.168.0.9'''). The clock is then updated if the browser time differs from the camera time by more than 24h.  +  +It's also possible to force apply time using the following GET request:  + <nowiki>http://192.168.0.9/utils.php?cmd=time&apply&ts=<timestamp_in_ms></nowiki>  + #example:  + <nowiki>http://192.168.0.9/utils.php?cmd=time&apply&ts=1589913066650</nowiki>     ==<font color="blue">eSATA port switching</font>== ==<font color="blue">eSATA port switching</font>== Oleg

10393 manual

Mon, 05/11/2020 - 13:01

‎In the package

← Older revision Revision as of 19:01, 11 May 2020 Line 9: Line 9:  * 10393 camera system ([[Elphel_camera_assemblies|these 3D models]] might be helpful). * 10393 camera system ([[Elphel_camera_assemblies|these 3D models]] might be helpful).  {| {| −|[[File:NC393-CS marked ports.jpeg|thumb|200px|Fig.1a 10393 interfaces]]+|valign='top'|[[File:NC393-CS marked ports.jpeg|thumb|200px|Fig.1a 10393 interfaces]] −|[[File:10393_boards_assembly.png|thumb|265px|Fig.1b Boards connections (NC393-F-CS)]]+|valign='top'|[[File:10393_boards_assembly.png|thumb|265px|Fig.1b Boards connections (NC393-F-CS)]]  +|valign='top'|[[File:10393 dev mmc.jpeg|thumb|150px|Fig.1c Using micro SD card for development]]  |} |}  * Power supply options ([[10393_power|more information]]): * Power supply options ([[10393_power|more information]]): Oleg

File:10393 dev mmc.jpeg

Mon, 05/11/2020 - 13:00

Oleg uploaded a new version of File:10393 dev mmc.jpeg

New page

== Licensing ==
{{CC }} Oleg

File:10393 dev mmc.jpeg

Mon, 05/11/2020 - 12:57

Oleg uploaded File:10393 dev mmc.jpeg

New page

== Licensing ==
{{CC }} Oleg

10393 manual

Fri, 05/08/2020 - 12:54

← Older revision Revision as of 18:54, 8 May 2020 (13 intermediate revisions by the same user not shown)Line 208: Line 208:    sync   sync  </font> </font> −  −==<font color="blue">Event Logger (GPS, IMU, IMG & EXT)</font>==  −  −The FPGA-based Event Logger uses local clock for time-stamping data from Image Acquisition, External (Trigger) Input, GPS and IMU.  −  −* [[Event_logger|'''More information''']]  −===Record===  −====web====  −* Start:   −http://192.168.0.9/logger_launcher.php?cmd=start&file=/mnt/sda1/test.log&index=1&n=10000000  −* Stop:  −http://192.168.0.9/logger_launcher.php?cmd=stop  −* Help:  −http://192.168.0.9/logger_launcher.php  −  −====command line====  −* start:  −<font size='2'>  − root@elphel393:~# cat /dev/imu > /path/filename.log  −</font>  −* stop - CTRL-C or kill the process  −  −===Read===  −* http://192.168.0.9/read_imu_log.php (will display help)  −** on the first access creates /www/pages/logs/ (http://192.168.0.9/logs/)  −** link the recorded logs to /www/pages/logs/  −** refresh http://192.168.0.9/read_imu_log.php      ==<font color="blue">Store/restore configuration</font>== ==<font color="blue">Store/restore configuration</font>== Line 246: Line 219:  [[Autocampars 393|'''More information''']] [[Autocampars 393|'''More information''']]  * All stored parameters are automatically restored at boot * All stored parameters are automatically restored at boot  +  +==<font color="blue">Available programmable parameters</font>==  +To inspect all available reprogrammable parameters:  + 1. http://192.168.0.9 -> Parameter Editor  + 2. Follow a link for a particular port, e.g. http://192.168.0.9/autocampars.php?sensor_port=0  + 3. Select groups of interest in the top table -> View/Edit Current     ==<font color="blue">Change parameters</font>== ==<font color="blue">Change parameters</font>== Line 288: Line 267:     ==<font color="blue">Image formats</font>== ==<font color="blue">Image formats</font>== −====jpeg====+====JPEG==== −* '''color''': YCbCr 4:2:0, 3x3 pixels+* ''color'': YCbCr 4:2:0, 3x3 pixels −* '''mono6''': monochrome - color YCbCr 4:2:0 with zeroed out color components+* ''mono6'': monochrome - color YCbCr 4:2:0 with zeroed out color components −* '''mono''' : monochrome - color YCbCr 4:0:0 with omitted color components+* ''mono'' : monochrome - color YCbCr 4:0:0 with omitted color components    −'''Note:''' Is not the best for processing since a lot of information is lost at demosaicing+Note: JPEG is not the best for processing since some information gets lost when demosaicing is applied. −====jp4 raw====+====JP4====  +* provides a quality of RAW with compression, no demosaicing  * [[JP4|'''More information''']] * [[JP4|'''More information''']]  +  +==<font color="blue">Proper shutdown</font>==  +* if not properly shutdown - in a rare case the &mu;SD card can get corrupted (it's always safer to run '''sync''')  +<font size='2'>  + ~# sync  + ~# shutdown -hP now  +</font>  +Same effect:  +<font size='2'>  + http://192.168.0.9/autocampars.php?reboot  +</font>     ==<font color="blue">Temperature monitor</font>== ==<font color="blue">Temperature monitor</font>== Line 304: Line 295:  |} |}     +==<font color="blue">Event Logger (GPS, IMU, IMG & EXT)</font>==     +The FPGA-based Event Logger uses local clock for time-stamping data from Image Acquisition, External (Trigger) Input, GPS and IMU.  +  +* [[Event_logger|'''More information''']]  +===Record===  +====web====  +* Start:  +http://192.168.0.9/logger_launcher.php?cmd=start&file=/mnt/sda1/test.log&index=1&n=10000000  +* Stop:  +http://192.168.0.9/logger_launcher.php?cmd=stop  +* Help:  +http://192.168.0.9/logger_launcher.php  +  +====command line====  +* start:  +<font size='2'>  + root@elphel393:~# cat /dev/imu > /path/filename.log  +</font>  +* stop - CTRL-C or kill the process  +  +===Read===  +* http://192.168.0.9/read_imu_log.php (will display help)  +** on the first access creates /www/pages/logs/ (http://192.168.0.9/logs/)  +** link the recorded logs to /www/pages/logs/  +** refresh http://192.168.0.9/read_imu_log.php     ==<font color="blue">eSATA port switching</font>== ==<font color="blue">eSATA port switching</font>== Line 310: Line 326:  * available connections: * available connections:  ** camera <=> internal SSD (default) ** camera <=> internal SSD (default) −** camera <=> external drive (external drive will need a separate power source)+** camera <=> external drive (external drive requires a separate power source)  ** PC <=> internal SSD ** PC <=> internal SSD  * [[Sata_multiplexer_10389|'''More information''']] * [[Sata_multiplexer_10389|'''More information''']] −  −  −  −==<font color="blue">Proper shutdown</font>==  −* if not properly shutdown - &mu;SD might get corrupted (run '''sync''' at least)  −<font size='2'>  − shutdown -hP now  −</font>  −Same effect:  −<font size='2'>  − http://192.168.0.9/autocampars.php?reboot  −</font>      ==<font color="blue">Firmware/software update</font>== ==<font color="blue">Firmware/software update</font>== Line 330: Line 334:     ==<font color="blue">Firmware images</font>== ==<font color="blue">Firmware images</font>== −* [https://community.elphel.com/files/393/20190321/ '''20190321''']+* [https://community.elphel.com/files/393/20200508/ '''20200508''']  +* [https://community.elphel.com/files/393/20190321/ 20190321]  * [https://community.elphel.com/files/393/20180511/ 20180511] * [https://community.elphel.com/files/393/20180511/ 20180511] −* [https://community.elphel.com/files/393/20180416/ 20180416]      ===Changelog=== ===Changelog=== −  <font size='1'>'''==20190321=='''+  <font size='1'>'''==20200508=='''  + (rocko build)  + * updated camogm  + * added FLIR Lepton driver to kernel  + * added FLIR Lepton record to device tree  + '''==20190321=='''    * overall minor changes   * overall minor changes     * fixed photofinish demo    * fixed photofinish demo Oleg

10393 manual

Fri, 05/08/2020 - 10:58

‎Firmware images

← Older revision Revision as of 16:58, 8 May 2020 Line 330: Line 330:     ==<font color="blue">Firmware images</font>== ==<font color="blue">Firmware images</font>== −* [https://community.elphel.com/files/393/20190321/ '''20190321''']+* [https://community.elphel.com/files/393/20200508/ '''20200508''']  +* [https://community.elphel.com/files/393/20190321/ 20190321]  * [https://community.elphel.com/files/393/20180511/ 20180511] * [https://community.elphel.com/files/393/20180511/ 20180511] −* [https://community.elphel.com/files/393/20180416/ 20180416]      ===Changelog=== ===Changelog=== −  <font size='1'>'''==20190321=='''+  <font size='1'>'''==20200508=='''  + (rocko build)  + * updated camogm  + * added FLIR Lepton driver to kernel  + * added FLIR Lepton record to device tree  + '''==20190321=='''    * overall minor changes   * overall minor changes     * fixed photofinish demo    * fixed photofinish demo Oleg

10393 manual

Wed, 04/29/2020 - 12:20

‎Available lengths for cables for connecting sensors in custom setups

← Older revision Revision as of 18:20, 29 April 2020 (One intermediate revision by the same user not shown)Line 464: Line 464:  ===Available lengths for cables for connecting sensors in custom setups=== ===Available lengths for cables for connecting sensors in custom setups===  * [[FPC_cables|FPC cables]] - click for available lengths. * [[FPC_cables|FPC cables]] - click for available lengths. −* The cables are <font color='red'>asymmetrical</font> - for correct connecting a sensor to a system board see the figure below:+* The cables are <font color='red'>asymmetrical</font> - for correct connecting a sensor to a system board see the figure below. As a rule of thumb, the cable's back side (no contacts) will be on the same side with the connector's cover.  {| {|  |[[Image:Fpc_cable_conn_10393.jpeg|300px|thumb|Connecting sensors to the system board]] |[[Image:Fpc_cable_conn_10393.jpeg|300px|thumb|Connecting sensors to the system board]] Oleg

Tensorflow JNI development

Wed, 04/01/2020 - 11:48

‎Note

← Older revision Revision as of 17:48, 1 April 2020 (3 intermediate revisions by the same user not shown)Line 28: Line 28:     ==<font color='blue'>Build</font>== ==<font color='blue'>Build</font>==  +===Note===  +* <font color='red'>While running bazel ate all RAM (have 16GB) a few times and PC "hanged". To limit bazel's appetites try:</font>  + <font size=2>~$ bazel build --jobs 4 --local_ram_resources=4096 ...  + ~$ bazel test --jobs 4 --local_ram_resources=4096 ...  + # I think that '''local_ram_resources''' is MBs per thread (have 8):  + ~$ bazel build --local_ram_resources=2048 ...  + ~$ bazel test --local_ram_resources=2048 ...</font>  +  ===Quick=== ===Quick===  ~/git/tensorflow-1.15.0/mvn_build.sh: ~/git/tensorflow-1.15.0/mvn_build.sh: Oleg

Elphel on SourceForge

Tue, 03/17/2020 - 17:36

← Older revision Revision as of 23:36, 17 March 2020 Line 1: Line 1:  +{{Legacy}}  +'''Elphel currently uses git repository at https://git.elphel.com, mirrored at https://github.com/Elphel'''  +  +  = Releases description on Elphel's SourceForge project= = Releases description on Elphel's SourceForge project=    Andrey.filippov

Tensorflow JNI development

Fri, 03/13/2020 - 17:43

‎Build

← Older revision Revision as of 23:43, 13 March 2020 (4 intermediate revisions by the same user not shown)Line 28: Line 28:     ==<font color='blue'>Build</font>== ==<font color='blue'>Build</font>==  +===Quick===  +~/git/tensorflow-1.15.0/mvn_build.sh:  + <font size=2># Step 1 (Java):  +  + bazel build -c opt //tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni //tensorflow/java:pom  + mvn install:install-file -Dfile=bazel-bin/tensorflow/java/libtensorflow.jar -DpomFile=bazel-bin/tensorflow/java/pom.xml  +  + # Step 2 (JNI):  +  + bazel build -c opt //tensorflow/tools/lib_package:libtensorflow_jni.tar.gz  +  + rm -rf bazel-bin/tensorflow/tools/lib_package/maven  + mkdir -p bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  +  + POM="  + <project>  +  <modelVersion>4.0.0</modelVersion>  +  <description>Platform-dependent native code for the TensorFlow Java library. CUDA support depends on the local build.</description>  +  <groupId>org.tensorflow</groupId>  +  <artifactId>libtensorflow_jni_gpu</artifactId>  +  <version>1.15.0</version>  +  <packaging>jar</packaging>  +  <build>  +    <resources>  +      <resource>  +        <directory>.</directory>  +          <excludes>  +            <exclude>target/**</exclude>  +          </excludes>  +      </resource>  +    </resources>  +  </build>  + </project>  + "  +  + echo $POM > bazel-bin/tensorflow/tools/lib_package/maven/pom.xml  +  + tar -zxvf bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz -C bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  + cd bazel-bin/tensorflow/tools/lib_package/maven  + mvn package  + mvn install  + cd ../../../../..  +  +===Detailed===  +    <font size=2>cd ~/git/tensorflow-1.15.0   <font size=2>cd ~/git/tensorflow-1.15.0    ./configure # do not forget CUDA   ./configure # do not forget CUDA Line 76: Line 121:  Note: '''libtensorflow_jni_gpu''' - name can be any - just make sure you use it in your project's pom.xml. Note: '''libtensorflow_jni_gpu''' - name can be any - just make sure you use it in your project's pom.xml.  Next: Next: −  <font size=2>mvn package+  <font size=2>cd bazel-bin/tensorflow/tools/lib_package/maven −  mvn install</font>+ mvn package  +  mvn install  + cd ../../../../..  +</font>     ==<font color='blue'>Install JAR to local Maven Repository</font>== ==<font color='blue'>Install JAR to local Maven Repository</font>== Oleg

Tensorflow JNI development

Fri, 03/13/2020 - 17:43

‎Build

← Older revision Revision as of 23:43, 13 March 2020 (5 intermediate revisions by the same user not shown)Line 18: Line 18:  * '''Create Elipse project''' * '''Create Elipse project'''    −There's [https://github.com/bytedeco/javacpp-presets JavaCPP Presets] project. Seems useless.+There's [https://github.com/bytedeco/javacpp-presets JavaCPP Presets] project. <s>Seems useless</s>. Seems useful.     ==<font color='blue'>Install</font>== ==<font color='blue'>Install</font>== Line 28: Line 28:     ==<font color='blue'>Build</font>== ==<font color='blue'>Build</font>==  +===Quick===  +~/git/tensorflow-1.15.0/mvn_build.sh:  + <font size=2># Step 1 (Java):  +  + bazel build -c opt //tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni //tensorflow/java:pom  + mvn install:install-file -Dfile=bazel-bin/tensorflow/java/libtensorflow.jar -DpomFile=bazel-bin/tensorflow/java/pom.xml  +  + # Step 2 (JNI):  +  + bazel build -c opt //tensorflow/tools/lib_package:libtensorflow_jni.tar.gz  +  + rm -rf bazel-bin/tensorflow/tools/lib_package/maven  + mkdir -p bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  +  + POM="  + <project>  +  <modelVersion>4.0.0</modelVersion>  +  <description>Platform-dependent native code for the TensorFlow Java library. CUDA support depends on the local build.</description>  +  <groupId>org.tensorflow</groupId>  +  <artifactId>libtensorflow_jni_gpu</artifactId>  +  <version>1.15.0</version>  +  <packaging>jar</packaging>  +  <build>  +    <resources>  +      <resource>  +        <directory>.</directory>  +          <excludes>  +            <exclude>target/**</exclude>  +          </excludes>  +      </resource>  +    </resources>  +  </build>  + </project>  + "  +  + echo $POM > bazel-bin/tensorflow/tools/lib_package/maven/pom.xml  +  + tar -zxvf bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz -C bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  + cd bazel-bin/tensorflow/tools/lib_package/maven  + mvn package  + mvn install  + cd ../../../../..  +  +===Detailed===  +    <font size=2>cd ~/git/tensorflow-1.15.0   <font size=2>cd ~/git/tensorflow-1.15.0    ./configure # do not forget CUDA   ./configure # do not forget CUDA Line 76: Line 121:  Note: '''libtensorflow_jni_gpu''' - name can be any - just make sure you use it in your project's pom.xml. Note: '''libtensorflow_jni_gpu''' - name can be any - just make sure you use it in your project's pom.xml.  Next: Next: −  <font size=2>mvn package+  <font size=2>cd bazel-bin/tensorflow/tools/lib_package/maven −  mvn install</font>+ mvn package  +  mvn install  + cd ../../../../..  +</font>     ==<font color='blue'>Install JAR to local Maven Repository</font>== ==<font color='blue'>Install JAR to local Maven Repository</font>== Oleg

Tensorflow JNI development

Fri, 03/13/2020 - 17:43

‎Build

← Older revision Revision as of 23:43, 13 March 2020 (19 intermediate revisions by the same user not shown)Line 18: Line 18:  * '''Create Elipse project''' * '''Create Elipse project'''    −There's [https://github.com/bytedeco/javacpp-presets JavaCPP Presets] project. Seems useless.+There's [https://github.com/bytedeco/javacpp-presets JavaCPP Presets] project. <s>Seems useless</s>. Seems useful.     ==<font color='blue'>Install</font>== ==<font color='blue'>Install</font>== Line 28: Line 28:     ==<font color='blue'>Build</font>== ==<font color='blue'>Build</font>==  +===Quick===  +~/git/tensorflow-1.15.0/mvn_build.sh:  + <font size=2># Step 1 (Java):  +  + bazel build -c opt //tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni //tensorflow/java:pom  + mvn install:install-file -Dfile=bazel-bin/tensorflow/java/libtensorflow.jar -DpomFile=bazel-bin/tensorflow/java/pom.xml  +  + # Step 2 (JNI):  +  + bazel build -c opt //tensorflow/tools/lib_package:libtensorflow_jni.tar.gz  +  + rm -rf bazel-bin/tensorflow/tools/lib_package/maven  + mkdir -p bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  +  + POM="  + <project>  +  <modelVersion>4.0.0</modelVersion>  +  <description>Platform-dependent native code for the TensorFlow Java library. CUDA support depends on the local build.</description>  +  <groupId>org.tensorflow</groupId>  +  <artifactId>libtensorflow_jni_gpu</artifactId>  +  <version>1.15.0</version>  +  <packaging>jar</packaging>  +  <build>  +    <resources>  +      <resource>  +        <directory>.</directory>  +          <excludes>  +            <exclude>target/**</exclude>  +          </excludes>  +      </resource>  +    </resources>  +  </build>  + </project>  + "  +  + echo $POM > bazel-bin/tensorflow/tools/lib_package/maven/pom.xml  +  + tar -zxvf bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz -C bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  + cd bazel-bin/tensorflow/tools/lib_package/maven  + mvn package  + mvn install  + cd ../../../../..  +  +===Detailed===  +    <font size=2>cd ~/git/tensorflow-1.15.0   <font size=2>cd ~/git/tensorflow-1.15.0    ./configure # do not forget CUDA   ./configure # do not forget CUDA Line 43: Line 88:     * '''xml''' and '''jar''' will be taken care of by '''mvn''' command. * '''xml''' and '''jar''' will be taken care of by '''mvn''' command. −* '''so''' will have to be in the library path. Link or copy to '''/usr/lib/''' or go with "java -Djava.library.path=...". Example:+* '''so''' will have to be in the library path (alternatively see [[Tensorflow_JNI_development#Build_so_package|'''Build so package''']] a little below and skip this linking). Link or copy to '''/usr/lib/''' or go with "java -Djava.library.path=...".  +   +===[option 1] Link so library===    <font size=2># /usr/lib is in the default java.library.path   <font size=2># /usr/lib is in the default java.library.path    sudo ln -sf ~/GIT/tensorflow-1.15.0/bazel-bin/tensorflow/java/libtensorflow_jni.so /usr/lib/</font>   sudo ln -sf ~/GIT/tensorflow-1.15.0/bazel-bin/tensorflow/java/libtensorflow_jni.so /usr/lib/</font>  +  +=== preferred [option 2] Build so package===  + <font size=2>bazel build -c opt //tensorflow/tools/lib_package:libtensorflow_jni.tar.gz</font>  +It puts all libs into a single archive.  +Now to create a JAR to replace [https://mvnrepository.com/artifact/org.tensorflow/libtensorflow_jni_gpu libtensorflow_jni_gpu], do this:  + <font size=2>mkdir -p bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64  + tar -zxvf bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz -C bazel-bin/tensorflow/tools/lib_package/maven/org/tensorflow/native/linux-x86_64</font>  +Next create a pom.xml in ''bazel-bin/tensorflow/tools/lib_package/maven'':  + <font size=2><project>  +  <modelVersion>4.0.0</modelVersion>  +  <description>Platform-dependent native code for the TensorFlow Java library. CUDA support depends on the local build.</description>  +  <groupId>org.tensorflow</groupId>  +  <artifactId>'''libtensorflow_jni_gpu'''</artifactId>  +  <version>1.15.0</version>  +  <packaging>jar</packaging>  +  <build>  +    <resources>  +      <resource>  +        <directory>.</directory>  +          <excludes>  +            <exclude>target/**</exclude>  +          </excludes>  +      </resource>  +    </resources>  +  </build>  + </project></font>  +Note: '''libtensorflow_jni_gpu''' - name can be any - just make sure you use it in your project's pom.xml.  +Next:  + <font size=2>cd bazel-bin/tensorflow/tools/lib_package/maven  + mvn package  + mvn install  + cd ../../../../..  +</font>     ==<font color='blue'>Install JAR to local Maven Repository</font>== ==<font color='blue'>Install JAR to local Maven Repository</font>== Line 52: Line 132:  How to uninstall maven local repo - and switch back to official versions from Maven Central - [https://stackoverflow.com/questions/15358851/how-to-remove-jar-file-from-local-maven-repository-which-was-added-with-install this link]. Or remove unneeded stuff from '''~/.m2/repository/org/tensorflow''' How to uninstall maven local repo - and switch back to official versions from Maven Central - [https://stackoverflow.com/questions/15358851/how-to-remove-jar-file-from-local-maven-repository-which-was-added-with-install this link]. Or remove unneeded stuff from '''~/.m2/repository/org/tensorflow'''    −<font color=green size='4'>After '''*_jni.so''' is linked and '''jar''' installed one can resume normal development. See below what to add to your project's pom.xml</font>+<font color=green size='4'>After '''*_jni.so''' is linked (or '''jar''''d) and '''jar''' installed one can resume normal development. See below what to add to your project's pom.xml</font>     ==<font color='blue'>Modify TF JNI functions</font>== ==<font color='blue'>Modify TF JNI functions</font>== Oleg

Pages