Hi all, I am planning to add the ability of using compute devices for signature matching to ClamAV. I have already implemented the Aho-Corasick algorithm besides KMP and Boyer Moore using CUDA for matching simple and raw strings without any wildcard or meta-character/regular expression compatibility.
you can read the report through the project here: http://pasargad.cse.shirazu.ac.ir/~rahimy/cuda-strmatch.zip I have talked on initial issues with Edwin and below is a summary of what I am going to do: First thing is moving to OpenCL instead of CUDA, this is choice is mainly because the cross-platform nature of OpenCL. So, the implemented module can be compiled and run on machines with multiple brands of commodity hardware such as ATI, Intel, Nvidia, and any device that has OpenCL compatible driver. If we were successful to move to the OpenCL library, then I might take these steps: 1- implement an Aho-Corasick data structure suitable for Compute devices, while being lightweight and memory optimized. 2- designing a scalable architecture for moving both buffers and signatures to be moved to GPU and scanned for, a major challenge for implementing such a module for ClamAV is the huge number of signatures ( o(100k) ). 3- creating the Aho-Corasick trie for chunks of signatures, so the first version of this module might be the one which does the signature chunk matching on the GPU, then gives back data about each signature chunk (i.e. match offset and final state for each match) and does the meta matching on the CPU side. 4- porting the CPU task in 3 to GPU. These are the main things I think that are the most important, thanks to edwin, so I did not discuss about the details. Please let me know about any ideas or anything that crosses a mind about these things. Another thing about the report, the pdf file, the speedups for short signatures (length of two) are false, they must actually be divided by 100. Regards, Hossein, =============================== Hossein Rahimi, B.Eng. Student of Software Engineering, Shiraz University, ECE school Phone: +98 936 3238761 _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html Please submit your patches to our Bugzilla: http://bugs.clamav.net