Skip to content
Saurabh Singh edited this page Jul 30, 2024 · 3 revisions

In order to build Altis, it assumes the environment is already setup properly. If you have not set up the environment yet, please refer to Environment Setup before proceeding.

Go to the root directory of Altis, execute the following instruction and you are all set:

./setup.sh

You can also change the target device ID by adding the -d <device-id> flag. This flag is responsible for detecting the corresponding device SM capacity and generating a header file with device-specific parameters such as L2 cache size, which is required for compilation. For example, if you want to test the second GPU in your system, you should run ./setup.sh -d 1.

Or you can run through each of the following steps and understand the building process.

First, you need to generate a device-specific header file called cuda_device_attr.h and place it at src/cuda/common:

cd config/cuda_device_attr_gen
make
./deviceQuery ../../src/cuda/common/ [device-id]
make clean
cd ../..

You might encounter error when trying to run make inside config/cuda_device_attr_gen. This likely is caused by the fact the code used to generate cuda_device_attr.h uses C++11 features and your compiler didn't turn on that option or the version is old. You might want to try adding -std=c++11 to g++.

Then create a build directory in the project root directory. Inside build, simply run:

cmake -DCMAKE_CUDA_ARCHITECTURES=$(your_SM_number) ..

This will generate the Makefile required for final compilation. Finally, you can build Altis by:

make
Clone this wiki locally