Building NVBIO - BenLangmead/jhu-compute GitHub Wiki

Mac

I tried this on my Mac:

git clone [email protected]:NVlabs/nvbio.git
cd nvbio
mkdir build ; cd build
cmake ..

Oops. Got this:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_CUDART_LIBRARY (ADVANCED)
    linked by target "bamtools" in directory /Users/langmead/git/nvbio/contrib/bamtools
    linked by target "moderngpu" in directory /Users/langmead/git/nvbio/contrib/moderngpu
    ...
CUDA_TOOLKIT_INCLUDE (ADVANCED)
   used as include directory in directory /Users/langmead/git/nvbio/contrib/bamtools
   used as include directory in directory /Users/langmead/git/nvbio/contrib/moderngpu
   ...

I installed the NVIDIA CUDA toolkit and that fixed this (though I then still warnings about OpenMP).

Next problem: make doesn't work:

$ make
Scanning dependencies of target zlib
[  1%] Building C object contrib/zlib-1.2.7/CMakeFiles/zlib.dir/adler32.o
cc1: error: unrecognized command line option "-stdlib=libstdc++"
make[2]: *** [contrib/zlib-1.2.7/CMakeFiles/zlib.dir/adler32.o] Error 1
make[1]: *** [contrib/zlib-1.2.7/CMakeFiles/zlib.dir/all] Error 2
make: *** [all] Error 2

Beginning to think this won't work on a Mac.

Linux

I tried this on HHPC.

git clone [email protected]:NVlabs/nvbio.git
cd nvbio
mkdir build ; cd build
cmake ..

Success!

make is a success too.

Hooray! When it's done:

$ ./nvSetBWT/nvSetBWT 
visible : nvSetBWT - Copyright 2013-2014, NVIDIA Corporation
info    : usage:
info    :   nvSetBWT [options] input_file output_file
info    :   options:
info    :    -v       | --verbosity     int (0-6) [5]
info    :    -cpu-mem | --cpu-memory    int (MB)  [8192]
info    :    -gpu-mem | --gpu-memory    int (MB)  [2048]
info    :    -c       | --compression   string    [1R]   (e.g. "1", ..., "9", "1R")
info    :    -F       | --skip-forward
info    :    -R       | --skip-reverse
info    :   output formats:
info    :     .txt      ASCII
info    :     .txt.gz   ASCII, gzip compressed
info    :     .txt.bgz  ASCII, block-gzip compressed
info    :     .bwt      2-bit packed binary
info    :     .bwt.gz   2-bit packed binary, gzip compressed
info    :     .bwt.bgz  2-bit packed binary, block-gzip compressed
info    :     .bwt4     4-bit packed binary
info    :     .bwt4.gz  4-bit packed binary, gzip compressed
info    :     .bwt4.bgz 4-bit packed binary, block-gzip compressed

But won't run, obviously, since there's no GPU.

EC2

Here's a relevant article: https://aws.amazon.com/articles/7249489223918169.

  • never mind, not helpful. uses old GPU instance type

EC2 has the g2.2xlarge instance type that includes CUDA and a GPU. To launch it from the console, you have to choose an AMI that has support for "HVM". I chose "Amazon Linux AMI (HVM) 2014.03.1 - ami-978d91fe".

  • never mind, don't use that AMI
  • now trying: starcluster-base-centos-5.4-x86_64-ebs-hvm-gpu-hadoop-rc2 - ami-06a75a6f
    • never mind, that one doesn't work with latest GPU instance types
  • now trying: Cuda 5.5 Ubuntu 12.04 LTS - ami-59fb9130
    • never mind, same problem
  • now trying: Ubuntu-12.04_GPU_CUDA-OpenCL-PyOpenCL - ami-87377cee
    • never mind, same problem

OK, that's not working. This page seems to indicate there's a special HVM designation "G2" showing it works with the g2.2xlarge instance type. https://aws.amazon.com/amazon-linux-ami/instance-type-matrix/

  • BIDMat/BIDMach (g2.2xlarge) v0.3 - ami-5520353c

Worked!! Then do this:

sudo yum -y update
sudo yum -y install cmake gcc-c++
git clone https://github.com/NVlabs/nvbio.git
cd nvbio
mkdir build
cd build
cmake ..

Get this error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_TOOLKIT_INCLUDE (ADVANCED)

Next I read this article which seemed to give the magic words needed to install CUDA 5.5 on the standard Linux AMI:

sudo yum -y groupinstall "Development Tools"
sudo yum -y install git libcurl-devel python-devel screen rsync yasm numpy
wget http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run
sudo sh cuda_5.5.22_linux_64.run

But I ran into a problem with the last command:

$ sudo sh cuda_5.5.22_linux_64.run
Can't locate Env.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5
/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./cuda-installer.pl line 6.
BEGIN failed--compilation aborted at ./cuda-installer.pl line 6.

I did the following:

sudo perl -MCPAN -e 'install Test'
sudo perl -MCPAN -e 'install Test::More'
sudo perl -MCPAN -e 'install Env'

Now sudo sh cuda_5.5.22_linux_64.run gets further. I answer yes to all the yes/no questions and accepted defaults for other questions. But I get an error relating to the kernel source:

Installing the NVIDIA display driver...
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly.
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the '--kernel-source-path' flag.

===========
= Summary =
===========

Driver:   Installation Failed
Toolkit:  Installation skipped
Samples:  Installation skipped

A helpful commenter suggests this:

sudo yum install kernel-devel-`uname -r`
sudo sh cuda_5.5.22_linux_64.run --kernel-source-path /usr/src/kernels/3.10.35-43.137.amzn1.x86_64

But I get the same error even with that.

I tried to build NVBIO even with the driver having failed to install:

git clone https://github.com/NVlabs/nvbio.git
mkdir -p nvbio/build
cd nvbio/build
sudo yum -y install cmake
cmake ..

It failed:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_CUDART_LIBRARY (ADVANCED)
    linked by target "bamtools" in directory /home/ec2-user/nvbio/contrib/bamtools
    linked by target "moderngpu" in directory /home/ec2-user/nvbio/contrib/moderngpu
    linked by target "nvbio" in directory /home/ec2-user/nvbio/nvbio
    ...

Also tried Ubuntu (instructions), but kept getting error like this:

The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-profiler (= 5.5.22-3ubuntu1) but it is not going to be installed
                       Depends: nvidia-cuda-dev (= 5.5.22-3ubuntu1) but it is not going to be installed
                       Recommends: nvidia-visual-profiler (= 5.5.22-3ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.