GPU Computing

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about Multi-channel FFT example

Hi, MathGuy,

I am a layman to GPU but very happy to join this group.

When I learn Multi-channel FFT.vi and try to modify it for my application, I found several questions.

1. Why the VI compares the size of #of Channels and samples/channel at the begining and use the smaller to be the input for the Initialize Library.VI?

2. The Downloaddata.VI accepts 1D or 2D array data input, but the description does not well introduce the format or structure of the input 1D or 2D array. Now if I want to do FFT on a 3D cubic (x,y,z) array along its "z" direction (which means I have x*y channels), do I need to first convert it into at least a 2D (x*y,z) array before input them into Downloaddata.vi?

I am using LV2012 64bit, win7 64bit and GPU analysis toolkit.

Thank you for your help.

best,

Xsword

0 Kudos
Message 1 of 6
(10,115 Views)

Good questions:

1. The check for size/channel vs # of channels was a limitation from previous versions of CUDA. The toolkit supports v4.0 or later and I did not check if the FFT in v4.0 supports having more channels than the sample size. I have verified the limit is no longer there for v5.0.

2. The format of the input and output data for an FFT is defined by NVIDIA documentation. We tried not to duplicate in our help any information that specific to NVIDIA  because the behavior can change between versions of CUDA. To learn more about how they 'consume' array data that's downloaded, you can go to https://developer.nvidia.com/cuFFT.

The Download Data and Upload Data VIs in the toolkit use cudaMemcpy() which is part of the CUDA Runtime API to transfer data to and from the device. LabVIEW's array data is row-wise oriented and that will be the physical ordering of the data on the GPU. However, depending on the CUDA function, this data may be treated as row-wise (as it is w/ the cuFFT) or column-wise (as is the default with cuBLAS).

For 3D data, I believe the 3D orientation is similar bertween LV and CUDA in terms of the 3D FFT. Any transpose that would be necessary on the host would match what is needed on the GPU.

Darren

NI LabVIEW Scientific Computing | Technical Chair : Numerical Mathematics Consortium

"Numerical accuracy and the common cold - one is as easy to get as the other is to lose."

Message 2 of 6
(7,824 Views)

Hi, Darren,

Thank you very much for your promt and helpful guidance!

Sorry for foggeting to let you know I am using CUDA5.0.

For Ques.1, is my understanding right that now with CUDA5.0, I can use channel# more than the size/channel only if their product not exceed the availible memory resource in the GPU? I am learning the other example "Get GPU Device Information" and got the attached results of my GPU card:

QQ截图20130430112820.png

I know from these parameters I should know a maximum #of channels and size/channel product with known array data type. But I really lack the ABCs of GPU hw knowledge. Do you have any suggestion for me to quickly catch up?

For Ques2, I think it is the same thing I need to learn basics of CUDA.

Will get back to you after my study!

Many thanks!

Xsword

0 Kudos
Message 3 of 6
(7,824 Views)

Hi, Darren,

     QQ图片20130502123830.jpg

I am trying to modify the Multi-channel FFT example into the above. Waht I wanna is to do real2complex FFT on a 2D U16 array. But when I try to wire the Download data.vi's dst out withe signals in of FFT.vi, it always shows the "Wire:Class conflict" error. I tried to select different FFT.vi type but none of them works. Why is it?

best,

Xsword

0 Kudos
Message 4 of 6
(7,824 Views)

Yes to your question #1 - you can have more channels than your channel sample size. I just validated this using CUDA v5.0 display drivers and CUDA Runtime API v4.1 and v5.0.

NOTE: It is often the case thay your display driver will support a higher version of CUDA because it gets updated along w/ other Windows updates. Your version of your CUDA Runtime and Driver APIs are tied to the toolkit version you have installed so these are not automatically updated unless you manually install a new version of the CUDA toolkit.

0 Kudos
Message 5 of 6
(7,824 Views)

You modification to the FFT example won't work because the CUFFT function does not work on integer data (e.g. U16). To better understand what is supported, you should refer to NVIDIA's online documentation for their CUFFT library.

Links to their documentation (including the cuFFT library) is towards the bottom of their CUDA development page (https://developer.nvidia.com/cuda-toolkit). These pages can change over time but NVIDIA has always made user documentation available for their publically available libraries (e.g. CUFFT, CUBLAS, CURAND, etc).

The wire is broken in this case because there is no interface in LV that supports this input type. The FFT VI is a poly VI and will auto-select the appropriate instance based on the inputs. You can also manually select which version you which to use. This is necessary to do some of the more advanced inplace-versions of the FFT (and Inverse FFT).

Darren

0 Kudos
Message 6 of 6
(7,824 Views)