Utilizing Intel® AVX with Cakewalk SONAR X1

This is a whitepaper (Utilizing Intel® AVX with Cakewalk SONAR X1) which I co-authored with Intel engineer Rajshree Chabukswar, highlighting the advantages of optimizing for the Intel AVX chipset, with a focus on digital audio processing in a modern DAW like SONAR X1.

We’re excited with our synergetic relationship with Intel, which allows us to take  advantage of their bleeding edge technology in ways that directly beneft our users, allowing them to squeeze the most power out of their systems. While the paper is technical and requires an understanding of some low level programming, it also offers insight into the nuts and bolts of whats involved in optimizations for Intel CPU architectures in a modern DAW.

The paper features a real world case study of SONAR X1 code that was optimized in to take advantage of the benefits of the 256 bit AVX instruction set. If you have an Intel CPU from the Sandy Bridge processor family, it supports AVX and SONAR X1 will take advantage of it.
(While AVX is an Intel instruction set, it has also been adopted by AMD will be available in their upcoming Bulldozer processors. )

Code which is optimized for AVX  vectorization capabilities can work with 256-bit vectors, allowing working on 8 32-bit floating point values per iteration. In other words, this is twice the data throughput of earlier SSE instruction set! While this doesn’t necessarily translate to twice as fast, it is a huge step up in performance in many cases as the white paper illustrates.

The first step in any optimization task is what is referred to as “hotspot analysis”. In this phase you identify the bottlenecks in the code or that would benefit most from AVX optimization. We did analysis running through stress test projects and workflows that showed some classic hotspots. Once these were identified, the code was AVX optimized using the new AVX intrinsics available in Visual Studio 2010.

Click below to read the paper or download the PDF from Intel’s site:
Utilizing Intel® AVX with Cakewalk SONAR X1

[ Additional credits to Keith Albright and Bob Currie from Cakewalk, for hotspot analysis, development, and troubleshooting ]

Why a program crash can be good for you

OK that sounds like an oxymoron. A crash, good? Thats crazy talk!
Well maybe not quite that crazy – read on to find out why…

Why would anyone actually want their app to crash you may ask? To answer that question lets cover some background about why applications crash on Windows (or any OS).

An application crashes when it performs an unexpected operation or encounters what is called an “exception condition”. Exceptions include unwanted operations like writing to invalid memory locations, divide by zero errors, page faults, etc. Programs can end up with exceptions like this for a variety of reasons:

  •  bugs in the progam code 
  •  bugs in loaded DLL’s which share the same memory and address space as the host application. You frequently encounter dll’s via plug-in’s in applications (eg. loading a VST in an audio application or a imaging plug-in in Photoshop)
  • bugs in the operating system

Normally when an error like this occurs, Windows will display the familiar error message “This Program Has Performed an Illegal Operation and Will Be Shut Down” and the program will close. Some applications like SONAR handle such errors more gracefully and will even try and intercept these exception and attempt to allow the user to save their work before exiting the program. Additionally on Windows you can choose to save what is called a Minidump containing “post mortem” debugging info that is very useful to developers to find out why the program crashed.
Continue reading “Why a program crash can be good for you”