Thursday, February 20, 2014

R cannot be resolved. Android ubuntu

Fixing "R cannot be resolved" problem in Android ADT of Ubuntu

When I tried to install the latest Android ADT in my ubuntu 13.10 laptop, I found that annoying "R cannot be resolved" bug. And it also reports that aapt cannot find or open libstdc++.so.6and libz.so.1.

After I search the web, here is the solution I found:

sudo apt-get install lib32ncurses5 lib32stdc++6
 
sudo apt-get install lib64z1-dev

Friday, January 24, 2014

how to install gpgpu-sim and run gpu benchmarks without graphic card

GPGPU-sim is a tool developed for simulating NVIDIA GPUs. (download here)  Here is how I figured out to install it and run it without a physical NVIDIA GPU card on your computer. I only tried Ubuntu os and it might work for mac os. Sorry about that. 

1. download GPGPU-sim: git clone git://dev.ece.ubc.ca/gpgpu-sim

2. Install dependencies as described in /gpgpu-sim/v3.x/README. For Ubuntu you can actually use 'sudo apt-get install xxx' to install most of them. gcc and g++ 4.4 and 4.5 both work well but 4.1 and 4.7 don't work. if you need to set symbolic link of gcc, here is a link showing how to do it: click here.

3. Install cuda toolkit and SDK. Note that don't use the latest CUDA 5.5 or something newer because the latest cuda integrates cuda toolkit, Nvidia driver and cuda SDK into one package. If you don't get a NVIDIA video card, the installation always aborts. So here I download cuda toolkit 4.2, https://developer.nvidia.com/cuda-toolkit-42-archive, and corresponding SDK. The nvidia driver is not needed. Just install toolkit and SDK. Some error might be reported during building SDK but it's ok to ignore them. 
What matters is the library generated in /NVIDIA_GPU_Computing_SDK/C/lib, which is needed when building benchmarks

Next, 
 export CUDA_INSTALL_PATH=/usr/local/cuda
 export PATH=$PATH:$CUDA_INSTALL_PATH/bin

as mentioned in /gpgpu-sim/v3.x/README
4. Now you are ready to build the simulator. In  /gpgpu-sim/v3.x, 
source setup_environment
make
if some library can not be found, type:
export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/local/cuda/lib64

5. Next step is to compile the ispass2009-benchmarks. Open /gpgpu-sim/ispass2009-benchmarks/README.ISPASS-2009, and set the environment variables it mentioned. Open /gpgpu-sim/ispass2009-benchmarks and change 'ROOTDIR' to your setting.
Then it should be ready to run:

make -f Makefile.ispass-2009

Note that building some benchmarks can be failed given your NVIDIA SDK library. Just comment them out in Makefile.ispass-2009 and build the rest. In the end most of benchmarks can be built successfully. In my case, AES, CP and DG fails but the rest 8 benchmarks are built successfully.

6. Follow the steps in /gpgpu-sim/ispass2009-benchmarks/README.ISPASS-2009 and bingo your gpgpusim should run with real benchmarks just fine without a gpu card.

 More comments. GPGPU-sim includes simulator, benchmarks, power tool and visualizing tools. One cool thing of GPGPU-sim is it can run real GPU applications. However, compiling these applications need cuda toolkit and libraries from SDK. As long as NVIDIA driver is not needed to generate libraries, it is fine to run GPGPU-sim without a Nvidia video card.