AGILE (gpu image reconstruction library): Difference between revisions

From Cheaha
Jump to navigation Jump to search
(Initial page draft with build script)
 
(→‎Build and Install AGILE Library: Add double support to build example)
 
(12 intermediate revisions by the same user not shown)
Line 4: Line 4:


AGILE is available as a source code bundle and requires a GPU to execute.
AGILE is available as a source code bundle and requires a GPU to execute.
=== AGILE on Desktop ===
You can run AGILE on your desktop (or other system) as long as it has a GPU installed.  You will need to adapt the build instructions for Cheaha below to fit your environment.  The instructions for Cheaha are based on a CentOS 5.5 system environment.
The main change will likely be in the location of your CUDA Toolkit and SDK.  You may also want to adjust or skip the steps to install the dependencies if you platform already has them installed, though there isn't any harm installing them again in your build directory as described (only a slight disk storage cost).


=== AGILE on Cheaha ===
=== AGILE on Cheaha ===
Line 11: Line 17:
==== Preliminary Requirements ====
==== Preliminary Requirements ====


==== Command to Build ====
Before getting started, please review the [[Software Build Considerations]] to help create a sane, reproducible software product.
 
Using or building software for the GPU on Cheaha requires that you directly log into the [[GPU compute node]].  Start an SSH session with cheaha.uabgrid.uab.edu and after you log in execute a second SSH to the GPU compute node.
 
ssh cheaha-compute-1-9
 
==== Set up Build Environment ====
 
The build instructions below will assume all commands are executed from a directory dedicated to the AGILE build, after you are logged into the GPU compute node, set up your build environment.  In addition to your base build environment you will need the CUDA compiler utilities.
 
mkdir agile-build
cd agile-build
bash
PATH=/bin:/usr/bin; unset LD_LIBRARY_PATH
module load cuda/cuda-4
export MY_AGILE_BUILD_HOME=$PWD
 
==== Install Dependencies for AGILE Build ====
 
===== CMake =====
 
[http://www.cmake.org CMake] is a build management tool that provides utilities to support cross platform code.  The CMake project provides a 32-bit binary for Linux that you can use.  The utilities only control the build process, therefore the 32-bit code CMake code should not affect the 64-bit AGILE binaries produced below.
 
wget http://www.cmake.org/files/v2.8/cmake-2.8.6-Linux-i386.tar.gz
tar xvfz cmake-2.8.6-Linux-i386.tar.gz
PATH=$PATH:$PWD/cmake-2.8.6-Linux-i386/bin
 
===== Boost =====
 
[http://www.boost.org Boost] is a collection of peer-reviewed portable C++ libraries that are targeted for standardization.  Install boost with:
 
wget 'http://downloads.sourceforge.net/project/boost/boost/1.48.0/boost_1_48_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.48.0%2F&ts=1322092023&use_mirror=cdnetworks-us-2'
tar xvfz boost_1_48_0.tar.gz
cd boost_1_48_0
./bootstrap.sh --prefix=$PWD/../boost
./b2 install
cd ..
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/boost/lib
 
===== Doxygen =====
 
[http://www.doxygen.org Doxygen] is a documentation system that supports many languages and builds documentation from source code and comments embedded in the source code, helping ensure accurate API documentation.
 
wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.7.5.1.src.tar.gz
tar xvfz doxygen-1.7.5.1.src.tar.gz
cd doxygen-1.7.5.1
./configure --prefix $PWD/../doxygen
make
make install
cd ..
export PATH=$PATH:$PWD/doxygen/bin
 
==== Build and Install AGILE Library ====
 
The AGILE library is built in a dedicated sub-directory of the AGILE source code extract. The following steps install the AGILE library in the build directory and sets an environment variable $AGILE_LIB_HOME that may be useful for additional work with the AGILE library.
 
wget http://www.imt.tugraz.at/uploads/files/misc/agile-20110727.zip
unzip agile-20110727.zip
cd agile
mkdir build
cd build
cmake -DBOOST_ROOT=../../boost -DCMAKE_INSTALL_PREFIX=../../agile-lib/ -DCUDA_SDK_ROOT_DIR=$CUDAHOME/NVIDIA_GPU_Computing_SDK -DENABLE_GPU_DOUBLE=ON ..
make
make install
cd ../..
export AGILE_LIB_HOME=$PWD/agile-lib/
 
==== Run Example Reconstruction ====
 
AGILE comes with a number of tutorials and an example reconstruction code for total generalized variation (TGV2) image reconstruction from multiple coil data. See paper in reference at AGILE site.  More information is available the corresponding readme.txt file:
 
less $MY_AGILE_BUILD_HOME/agile/apps/tgv_radial_image_recon/readme.txt


The following build instructions were provided by Dr. Puri Bangalore
You can run this example in your current build environment with the following commands:
<pre>
wget http://www.cmake.org/files/v2.8/cmake-2.8.6-Linux-i386.tar.gz
tar xvfz cmake-2.8.6-Linux-i386.tar.gz
cd cmake-2.8.6-Linux-i386
export PATH=$PATH:/home/puri/cmake-2.8.6-Linux-i386/bin
echo $PATH
cd
wget http://downloads.sourceforge.net/project/boost/boost/1.48.0/boost_1_48_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.48.0%2F&ts=1322092023&use_mirror=cdnetworks-us-2
tar xvfz boost_1_48_0.tar.gz
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/puri/boost_1_48_0/libs
cd
cd boost_1_48_0
./bootstrap.sh --prefix=/home/puri/boost
./b2 install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/puri/boost/lib
cd
wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.7.5.1.src.tar.gz
tar xvfz doxygen-1.7.5.1.src.tar.gz
cd doxygen-1.7.5.1
ls
more INSTALL
cd
wget http://downloads.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.gz?r=http%3A%2F%2Fflex.sourceforge.net%2F&ts=1322094898&use_mirror=voxel
tar xvfz flex-2.5.35.tar.gz
cd flex-2.5.35
./configure --prefix=/home/puri/flex
make install
cd
cd flex
ls
ls bin/
export PATH=$PATH:/home/puri/flex/bin
cd
cd doxygen-1.7.5.1
./configure --prefix /home/puri/doxygen
make install
make
make install
cd
export PATH=$PATH:/home/puri/doxygen/bin
cd
cd agile
mkdir build
cd build
more ../readme.txt
cmake -DBOOST_ROOT=/home/puri/boost -DCMAKE_INSTALL_PREFIX=/home/puri/apps/ ..
ccmake .
make
make tut01
make tut01-run
cd tutorial/tut01/tut01
cd tutorial/tut01/
ls
./tut01
cd ../tut02
ls
./tut02
./tut02
cd ../tut03
./tut03
cd ../tut04
./tut04
cd ../tut05
./tut05
mpirun -np 2 ./tut05
mpirun -np 4 ./tut05
cd ../tut06
./tut06
mpirun -np 4 ./tut06
mpirun -np 2 ./tut06
mpirun -np 1 ./tut06
mpirun -np 2 compute-0-4 compute-0-7 ./tut06
mpirun -np 2 -host compute-0-4 compute-0-7 ./tut06
mpirun -help
mpirun -host compute-0-4 compute-0-7 -np 2 ./tut06
mpirun --host compute-0-4 compute-0-7 -np 2 ./tut06
mpirun -np 2 --host compute-0-4 compute-0-7 ./tut06
mpirun -help
cat > ~/hostfile
mpirun -np 2 -hostfile ~/hostfile ./tut06
cd ../tut07
ls
cd ../tut08
ls
./tut08
cd
cd agile/apps/tgv_radial_image_recon/
/home/puri/agile/build/apps/tgv_radial_image_recon/nfft2d_tgv_recon_nogfx -param=recon_32_param.txt


</pre>
cd $MY_AGILE_BUILD_HOME/agile/apps/tgv_radial_image_recon
../../build/apps/tgv_radial_image_recon/nfft2d_tgv_recon_nogfx -param=recon_32_param.txt
 
This run will produce the output file recon_32.dat


== AGILE Support ==
== AGILE Support ==
Line 112: Line 104:


Please visit the AGILE web site for information on use.
Please visit the AGILE web site for information on use.
== References ==
Thanks to Dr. Purushotham Bangalore, CIS@UAB for the original build script for AGILE.
Please visit the [http://www.imt.tugraz.at/index.php/research/agile-gpu-image-reconstruction-library AGILE home page] for all additional needs.

Latest revision as of 19:13, 9 December 2011

AGILE (Environment for Linear and non-linear Image reconstruction using GPU Acceleration) is an open source library for GPU accelerated reconstruction problems in medical imaging. AGILE is developed at the Institute of Medical Engineering, Gratz University of Technology. It includes reconstruction code for Magnetic Resonance Imaging and Fluorescence Tomography, and was developed and tested on Linux systems.

Using AGILE

AGILE is available as a source code bundle and requires a GPU to execute.

AGILE on Desktop

You can run AGILE on your desktop (or other system) as long as it has a GPU installed. You will need to adapt the build instructions for Cheaha below to fit your environment. The instructions for Cheaha are based on a CentOS 5.5 system environment.

The main change will likely be in the location of your CUDA Toolkit and SDK. You may also want to adjust or skip the steps to install the dependencies if you platform already has them installed, though there isn't any harm installing them again in your build directory as described (only a slight disk storage cost).

AGILE on Cheaha

At this time, AGILE can only be run on Cheaha by building from source and running directly on the demonstration GPU node.

Preliminary Requirements

Before getting started, please review the Software Build Considerations to help create a sane, reproducible software product.

Using or building software for the GPU on Cheaha requires that you directly log into the GPU compute node. Start an SSH session with cheaha.uabgrid.uab.edu and after you log in execute a second SSH to the GPU compute node.

ssh cheaha-compute-1-9

Set up Build Environment

The build instructions below will assume all commands are executed from a directory dedicated to the AGILE build, after you are logged into the GPU compute node, set up your build environment. In addition to your base build environment you will need the CUDA compiler utilities.

mkdir agile-build
cd agile-build
bash
PATH=/bin:/usr/bin; unset LD_LIBRARY_PATH
module load cuda/cuda-4
export MY_AGILE_BUILD_HOME=$PWD

Install Dependencies for AGILE Build

CMake

CMake is a build management tool that provides utilities to support cross platform code. The CMake project provides a 32-bit binary for Linux that you can use. The utilities only control the build process, therefore the 32-bit code CMake code should not affect the 64-bit AGILE binaries produced below.

wget http://www.cmake.org/files/v2.8/cmake-2.8.6-Linux-i386.tar.gz
tar xvfz cmake-2.8.6-Linux-i386.tar.gz
PATH=$PATH:$PWD/cmake-2.8.6-Linux-i386/bin
Boost

Boost is a collection of peer-reviewed portable C++ libraries that are targeted for standardization. Install boost with:

wget 'http://downloads.sourceforge.net/project/boost/boost/1.48.0/boost_1_48_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.48.0%2F&ts=1322092023&use_mirror=cdnetworks-us-2'
tar xvfz boost_1_48_0.tar.gz 
cd boost_1_48_0
./bootstrap.sh --prefix=$PWD/../boost
./b2 install
cd ..
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/boost/lib
Doxygen

Doxygen is a documentation system that supports many languages and builds documentation from source code and comments embedded in the source code, helping ensure accurate API documentation.

wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.7.5.1.src.tar.gz
tar xvfz doxygen-1.7.5.1.src.tar.gz 
cd doxygen-1.7.5.1
./configure --prefix $PWD/../doxygen
make 
make install
cd ..
export PATH=$PATH:$PWD/doxygen/bin

Build and Install AGILE Library

The AGILE library is built in a dedicated sub-directory of the AGILE source code extract. The following steps install the AGILE library in the build directory and sets an environment variable $AGILE_LIB_HOME that may be useful for additional work with the AGILE library.

wget http://www.imt.tugraz.at/uploads/files/misc/agile-20110727.zip
unzip agile-20110727.zip
cd agile
mkdir build
cd build
cmake -DBOOST_ROOT=../../boost -DCMAKE_INSTALL_PREFIX=../../agile-lib/ -DCUDA_SDK_ROOT_DIR=$CUDAHOME/NVIDIA_GPU_Computing_SDK -DENABLE_GPU_DOUBLE=ON ..
make
make install
cd ../..
export AGILE_LIB_HOME=$PWD/agile-lib/

Run Example Reconstruction

AGILE comes with a number of tutorials and an example reconstruction code for total generalized variation (TGV2) image reconstruction from multiple coil data. See paper in reference at AGILE site. More information is available the corresponding readme.txt file:

less $MY_AGILE_BUILD_HOME/agile/apps/tgv_radial_image_recon/readme.txt

You can run this example in your current build environment with the following commands:

cd $MY_AGILE_BUILD_HOME/agile/apps/tgv_radial_image_recon
../../build/apps/tgv_radial_image_recon/nfft2d_tgv_recon_nogfx -param=recon_32_param.txt

This run will produce the output file recon_32.dat

AGILE Support

AGILE is not supported on Cheaha beyond the above build instructions provided for AGILE.

AGILE Tutorials

Please visit the AGILE web site for information on use.

References

Thanks to Dr. Purushotham Bangalore, CIS@UAB for the original build script for AGILE.

Please visit the AGILE home page for all additional needs.