Skip to content

Commit

Permalink
Merge branch 'dev' into stream-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrogers authored Jun 22, 2024
2 parents 54af36f + 6aa7ed1 commit e5a3825
Show file tree
Hide file tree
Showing 90 changed files with 5,552 additions and 276 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Workflow with cmake build system
name: Short-Tests-CMake

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the mydev branch
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-TITANV:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: TITANV

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests-cmake.sh

build-TITANV-LOCALXBAR:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: TITANV-LOCALXBAR

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests-cmake.sh

build-QV100:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: QV100

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests-cmake.sh

build-2060:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: RTX2060

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests-cmake.sh

build-3070:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: RTX3070

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests-cmake.sh
84 changes: 84 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This is a basic workflow to help you get started with Actions

name: Short-Tests

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the mydev branch
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-TITANV:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: TITANV

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh

build-TITANV-LOCALXBAR:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: TITANV-LOCALXBAR

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh

build-QV100:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: QV100

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh

build-2060:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: RTX2060

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh

build-3070:
runs-on: ubuntu-latest
container:
image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7
env:
CONFIG: RTX3070

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ debug_tools/WatchYourStep/ptxjitplus/*.ptx
accel-sim-framework/
gpu-app-collection/

setup
167 changes: 167 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
cmake_minimum_required(VERSION 3.17)

# Project name and version
project(GPGPU-Sim
VERSION 4.2.0
DESCRIPTION "cycle-level simulator modeling contemporary graphics processing units (GPUs)"
HOMEPAGE_URL https://github.com/accel-sim/gpgpu-sim_distribution
LANGUAGES CXX)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# GPGPU-Sim build option
option(GPGPUSIM_ENABLE_TRACE "Whether to enable GPGPU-Sim debug tracing" ON)

# GPGPU-Sim conditional build variable
set(GPGPUSIM_USE_POWER_MODEL OFF)
set(GPGPUSIM_USE_OPENCL OFF)

# Check for dependencies
include(gpgpusim_check.cmake)

# Create version file
add_custom_target(gen_build_string ALL
COMMAND ${CMAKE_COMMAND} -D INPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D OUTPUT_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/gpgpusim_gen_build_string.cmake
COMMENT "Generating build string file to ${CMAKE_CURRENT_BINARY_DIR}")

# CMake target
# GPGPU-Sim CUDA Runtime lib
# Use the entrypoint object files sources else CMake will complain
add_library(cudart SHARED $<TARGET_OBJECTS:gpgpusim_entrypoint>)
add_library(entrypoint STATIC $<TARGET_OBJECTS:gpgpusim_entrypoint>)

# Add global C/CXX compilation flags and definitions
# TODO Specify more build modes like gem5 with fast opt?
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_compile_definitions(DEBUG=1)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wall;-Wno-unused-function;-Wno-sign-compare;-g;-fPIC>")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wall;-Wno-unused-function;-Wno-sign-compare;-ggdb;-fPIC>")
else()
add_compile_definitions(DEBUG=0)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-O3;-g;-Wall;-Wno-unused-function;-Wno-sign-compare;-fPIC>")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wall;-Wno-unused-function;-Wno-sign-compare;-fPIC>")
endif()

# Add CUDA version
add_compile_definitions(CUDART_VERSION=${CUDA_VERSION_NUMBER})

# OpenCL support
if(GPGPUSIM_USE_OPENCL)
add_compile_definitions(OPENGL_SUPPORT)
endif()

# Tracing support
if(GPGPUSIM_ENABLE_TRACE)
add_compile_definitions(TRACING_ON=1)
endif()

# Add subdirectory
add_subdirectory(src)
add_subdirectory(libcuda)
add_subdirectory(libopencl)

# Set linker option for libcudart.so
if(APPLE)
target_link_options(cudart PUBLIC "-Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.1,-current_version,1.1;-lm;-lz;-pthread")
else()
target_link_options(cudart PUBLIC
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/linux-so-version.txt;-lm;-lz;-lGL;-pthread")
target_link_options(entrypoint PUBLIC
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/linux-so-version.txt;-lm;-lz;-lGL;-pthread")
endif()
# cuda: CUDA API lib
# ptxsim: cuda-sim, functional simulator
# gpgpusim: gpu simulator (gpgpu-sim)
# intersim: interconnect simulator
# accelwattch: power simulator
# Rest of source files in src/ will be created with gpgpusim_entrypoint target
target_link_libraries(cudart PUBLIC cuda ptxsim gpgpusim intersim)
target_link_libraries(entrypoint PUBLIC cuda ptxsim gpgpusim intersim)
if(GPGPUSIM_USE_POWER_MODEL)
target_link_libraries(cudart PUBLIC cuda ptxsim gpgpusim intersim accelwattch)
target_link_libraries(entrypoint PUBLIC cuda ptxsim gpgpusim intersim accelwattch)
endif()

# TODO Conditionally build for Opencl?
# if(GPGPUSIM_USE_OPENCL)
# add_library(OpenCL)
# endif()

# Install and post-install
# Get configure
set(GPGPUSIM_CONFIG "gcc-${CMAKE_CXX_COMPILER_VERSION}/cuda-${CUDA_VERSION_NUMBER}/${GPGPUSIM_BUILD_MODE}")

# Env var setup script
include(gpgpusim_gen_setup_environment.cmake)

# Installation
set(GPGPUSIM_INSTALL_PATH ${PROJECT_SOURCE_DIR}/lib/${GPGPUSIM_CONFIG})
install(TARGETS cudart DESTINATION ${GPGPUSIM_INSTALL_PATH})

# Installing symlinks
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.2\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.3\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.4\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.5.0\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.5.5\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.6.0\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.6.5\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.7.0\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.7.5\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.8.0\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.9.0\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.9.1\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.9.2\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.10.0\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.10.1\)")
install(CODE "execute_process\(\
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart> \
${GPGPUSIM_INSTALL_PATH}/$<TARGET_FILE_NAME:cudart>.11.0\)")
11 changes: 6 additions & 5 deletions aerialvision/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@
# Vancouver, BC V6T 1Z4


import ConfigParser, os
import configparser, os

userSettingPath = os.path.join(os.environ['HOME'], '.gpgpu_sim', 'aerialvision')

# Globally available configuration options for AerialVision
class AerialVisionConfig:

def __init__(self):
self.config = ConfigParser.SafeConfigParser()
self.config = configparser.SafeConfigParser()
self.config.read( os.path.join(userSettingPath, 'config.rc') )

def print_all(self):
for section in self.config.sections():
for option in self.config.options(section):
value = self.config.get(section, option)
print "\t%s.%s = %s" % (section, option, value);
print("\t%s.%s = %s" % (section, option, value));

def get_value(self, section, option, default):
if (self.config.has_option(section, option)):
Expand All @@ -90,10 +90,11 @@ def get_value(self, section, option, default):

#Unit test / configviewer
def main():
print "AerialVision Options:"
print("AerialVision Options:")
avconfig.print_all()
print "";
print("");

if __name__ == "__main__":
main()


Loading

0 comments on commit e5a3825

Please sign in to comment.