Thursday, October 31, 2019

GPU and CUDA explorations with OpenCV


Bscancompute
    While loop 9.01159 sec.
      While loop 12.5376 sec.
        While loop 13.7008 sec.

            2nd run
              While loop 9.03921 sec.
                While loop 8.88572 sec.
                  While loop 8.32227 sec.

                      Test wo FFT,
                        Before while loop 0.0226007 sec.
                          While loop 3.82644 sec.
                            While loop 3.6609 sec.
                              While loop 3.07903 sec.

                              • A simple sample program, to perform a 2D DFT and inverse, gave the following results on running more than once -
                              • samplecudadft,
                                480x360 fft and inv fft
                                DFT and inverse, with upload/dl 0.255261 sec.
                                (after running several times).

                                2400x360,
                                DFT and inverse, with upload/dl 0.261917 sec.

                                CPU
                                E:\OCT\opencvcuda\OpencvCuda\x64\Release>samplecudadft
                                DFT and inverse, on CPU 0.0144597 sec.
                                DFT and inverse, with upload/dl 0.260429 sec.
                              • bottleneck seems to be FFT "planning" and not upload download.

                                E:\OCT\opencvcuda\OpencvCuda\x64\Release>samplecudadftDFT and inverse, on CPU 0.0146046 sec.
                                DFT and inverse, with upload/dl 0.263986 sec.
                                DFT and inverse, without upload/dl 0.260521 sec.
                                and running it a 2nd time,
                                DFT and inverse, 2nd time without upload/dl 0.00618453 sec.
                              • Even when called as a function, quite fast after the first time.
                                DFT and inverse, as a function 0.00678208 sec.
                                DFT and inverse, as a function 0.00605592 sec.
                                DFT and inverse, as a function 0.00654344 sec.
                                DFT and inverse, as a function 0.00608254 sec.
                                DFT and inverse, as a function 0.00651554 sec.
                                DFT and inverse, as a function 0.00623649 sec.
                                DFT and inverse, as a function 0.00607195 sec.
                                DFT and inverse, as a function 0.0063154 sec.
                                DFT and inverse, as a function 0.00597894 sec.
                                DFT and inverse, as a function 0.00685649 sec.
                                DFT and inverse, as a function 0.00608895 sec.
                              • Will probably need to optimize based on
                                https://docs.opencv.org/master/dd/d3d/tutorial_gpu_basics_similarity.html
                              • Currently, with upload / download and variable assignment not optimized,
                                on cpu,
                                While loop 9.15065 sec.
                                on gpu,
                                While loop 9.34765 sec.
                                where variables were initialized, 64 to 32 conversion and back were included.

                                More important, the Bscan image shows up a bug.

                              Friday, October 25, 2019

                              a workflow for equal loudness RMS normalization on Adobe Audition

                              Sat with the Telugu team and worked out the following procedure for increasing and standardizing the RMS volume of their audio to -12 dB in Adobe Audition.


                              1. Match the volumes in the relevant regions to around -12 dB peak.
                              2. Do Noise Reduction by selecting a region of audio without noise, and then using that as the noise to be removed, around 70% or 80%.
                              3. Noise Gate at -60 dB - the threshold to be tweaked depending on audio's background noise level.
                              4. Choose either L or R track and mute the other track if relevant audio is only on one track, then convert to Mono.
                              5. Multiband compression using the Broadcast preset, and decreasing the thresholds by -20 dB, with Brickwall On.
                              6. Reverb filter if required.
                              7. Total RMS to -18 dB.
                              8. Hard Limiter at -6 dB.
                              9. Normalize peaks to 100%.


                              Tuesday, October 22, 2019

                              UTF-16 LE with BOM and compiler errors, warning: null character(s) ignored

                              By some fluke, the source code which I had edited on Windows got saved on github as UTF-16 LE with BOM (as reported by Geany). This was not compiling on Linux, which gave lots of warnings,

                              warning: null character(s) ignored

                              Googling got the UTF to UTF convertor on www.fileformat.info which converted the file properly to UTF-8. Problem solved.

                              Saturday, October 12, 2019

                              clearing up GMail used space

                              Change of 16.21 GB to 16.11 GB by deleting 8893 conversations from Trash, most of them short text-only email notifications.

                              100 MB for 10,000 short text emails, or around 10 kB per email.

                              So, probably it does not make sense to delete small emails - deleting attachments would clear up much more space.

                              Monday, October 07, 2019

                              X windows issues after CUDA install, resolved

                              Since my machine is supposed to have a GeForce GT 330M according to lspci, I thought I could try out the old version of CUDA SDK - apparently version 6.5 is the last one to support the GT 330M. The deb was supposed to be for Ubuntu 14.04, and I was running Linux Mint 18.1 based on Ubuntu 16.04. The deb and the apt-get install ran without any complaints. But ...

                              The build of examples worked, but the the cuda compatible nvidia card was not detected. And, after a restart, X did not come up.

                              Possible culprit was the NVidia driver for the older 14.04 kernel, which probably needed to be removed and so on. After some googling and some trial and error, the following method worked -

                              sudo apt purge nvidia*
                              sudo apt-get update 
                              sudo apt-get autoremove
                              sudo apt-get upgrade
                              sudo apt-get install --reinstall xserver-xorg-core
                              sudo apt-get install --reinstall xserver-xorg-video-nouveau

                              and a reboot.