Skip to content

Commit 309ac5b

Browse files
committed
Add source code for RMV 1.2 release.
1 parent 7c1bcf9 commit 309ac5b

File tree

324 files changed

+15266
-13891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+15266
-13891
lines changed

CMakeLists.txt

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ IF(WIN32)
3939
# this warning is caused by the QT header files - use pragma to disable at source
4040
# disable warning C4127: conditional expression is constant
4141
add_compile_options(/wd4127)
42+
# this warning is caused by QT header files and has been introduced by VS2019 16.9.6
43+
# disable warning C5240: 'nodiscard': attribute is ignored in this syntactic position
44+
add_compile_options(/wd5240)
4245
# bump the stack size
4346
add_link_options(/STACK:16777216)
4447
ELSEIF(UNIX)
@@ -101,17 +104,64 @@ IF(WIN32)
101104
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT RadeonMemoryVisualizer)
102105
ENDIF(WIN32)
103106

104-
## Copy Documentation and Samples to output directory
105-
add_custom_target(Documentation ALL)
107+
## Copy Documentation and Samples to output directory. Note - this target is intentionally not included in
108+
## the default project build. It needs to be explicitly built as a separate project
109+
110+
# Determine where the build process will be placing the binary files
111+
# This is evaluated at project build time - not at CMake generation time
112+
set(BUILD_ROOT $<$<CONFIG:debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$<CONFIG:release>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}>)
113+
114+
# Define the option to pass to the sphinx documentation job
115+
set(SPHINX_OPTION public)
116+
117+
find_program(SPHINX_EXECUTABLE sphinx-build)
118+
if(NOT SPHINX_EXECUTABLE)
119+
message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
120+
endif()
121+
122+
# group sphinx source files into a sphinx folder
123+
file(GLOB SPHINX_DOC_FILES ${SPHINX_DOC_FILES} ${CMAKE_SOURCE_DIR}/documentation/source/*.rst)
124+
set (SPHINX_DOC_MAIN ${CMAKE_SOURCE_DIR}/documentation/source/conf.py)
125+
source_group("sphinx" FILES ${SPHINX_DOC_FILES} ${SPHINX_DOC_MAIN})
126+
127+
# group release documents into a release_docs folder
128+
set (RELEASE_DOCS_IN_ROOT
129+
${CMAKE_SOURCE_DIR}/README.md
130+
${CMAKE_SOURCE_DIR}/Release_Notes.txt
131+
${CMAKE_SOURCE_DIR}/NOTICES.txt
132+
${CMAKE_SOURCE_DIR}/License.txt
133+
)
134+
set (RELEASE_DOCS ${RELEASE_DOCS_IN_ROOT})
135+
source_group("release_docs" FILES ${RELEASE_DOCS})
136+
137+
# hang the sphinx build on the conf.py file and specify a dummy output ("sphinx_output")
138+
# this ensures the sphinx docs are built everytime you ask to build the Documentation target
139+
# Sphinx has proper dependency checking, so this works as expected.
140+
# Once built, clean up any unneeded files.
141+
add_custom_target(Documentation SOURCES ${SPHINX_DOC_FILES} ${RELEASE_DOCS} DEPENDS sphinx_output)
142+
add_custom_command(MAIN_DEPENDENCY ${SPHINX_DOC_MAIN} OUTPUT sphinx_output
143+
COMMAND ${CMAKE_COMMAND} -E echo "building Sphinx documentation"
144+
COMMAND ${SPHINX_EXECUTABLE} ${CMAKE_SOURCE_DIR}/documentation/source ${BUILD_ROOT}/docs/help/rmv/html/. -t ${SPHINX_OPTION}
145+
COMMAND ${CMAKE_COMMAND} -E remove_directory ${BUILD_ROOT}/docs/help/rmv/html/.doctrees
146+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/allocation_explorer.html
147+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/allocation_overview.html
148+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/capture.html
149+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/carousel.html
150+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/heap_overview.html
151+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/memory_leak_finder.html
152+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/resource_details.html
153+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/resource_list.html
154+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/resource_overview.html
155+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/settings.html
156+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/snapshot_delta.html
157+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rmv/html/timeline.html
158+
)
159+
106160
add_custom_command(TARGET Documentation POST_BUILD
107-
COMMAND ${CMAKE_COMMAND} -E echo "copying documentation to output directory"
108-
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/docs
109-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/documentation/License.htm $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/docs/.
110-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/README.md $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/.
111-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/Release_Notes.txt $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/.
112-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/NOTICES.txt $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/.
113-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/License.txt $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/.
114-
COMMAND ${CMAKE_COMMAND} -E echo "copying samples to output directory"
115-
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/samples
116-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/sampleTrace.rmv $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/samples/.
161+
COMMAND ${CMAKE_COMMAND} -E echo "copying Documentation to output directory"
162+
COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_ROOT}/docs
163+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RELEASE_DOCS_IN_ROOT} ${BUILD_ROOT}/.
164+
COMMAND ${CMAKE_COMMAND} -E echo "copying Samples to output directory"
165+
COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_ROOT}/samples
166+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/sampleTrace.rmv ${BUILD_ROOT}/samples/.
117167
)

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,30 @@ git clone https://github.com/GPUOpen-Tools/radeon_memory_visualizer.git
5151
As a preliminary step, make sure that you have the following installed on your system:
5252
* CMake 3.11 or above.
5353
* Python 3.7 or above.
54-
* Qt® 5 or above (5.12.6 is the default and recommended).
55-
* Visual Studio® 2015 or above (2017 is the default).
54+
* Qt® 5 or above (5.15.2 is the default and recommended).
55+
* Visual Studio® 2015 or above (2019 is the default).
5656

57-
Qt should be installed to the default location (C:\Qt\Qt5.12.6). The Qt 5.12.6 install package can be found at https://download.qt.io/archive/qt/5.12/5.12.6/.
58-
Make sure to select msvc2017 64-bit (under Qt 5.12.6 option) during Qt installation. Note that the expected installation will produce a C:\Qt\Qt5.12.6\5.12.6 folder.
57+
Qt V5.15.2 can be installed using the Qt online installer available from the Qt 5.15.2 release page here: https://www.qt.io/blog/qt-5.15.2-released
58+
As an alternative, the Qt 5.12.6 offline installer can be used here: https://download.qt.io/archive/qt/5.12/5.12.6/
59+
Qt should be installed to the default location (C:\Qt\Qt5.xx.x).
60+
Be sure to select msvc2017/msvc2019 64-bit during Qt installation, depending on the compiler you decide to use.
5961
A reboot is required after Qt is installed.
62+
6063
Cmake can be downloaded from (https://cmake.org/download/).
61-
Python (V3.x) can be downloaded from (https://www.python.org/).
64+
Python (V3.x) can be downloaded from (https://www.python.org/). To build the documentation from Visual Studio, the Sphinx Python Document Generator is needed.
65+
This can be installed once Python is installed, as follows:
66+
* Open a command prompt and navigate to the scripts folder in the python install folder. Then type these 2 commands:
67+
* pip install -U sphinx
68+
* pip install sphinx_rtd_theme
6269

63-
Run the python pre_build.py script in the build folder from a command prompt. If no command line options are provided, the defaults will be used (Qt 5.12.6 and Visual Studio 2017)
70+
Run the python pre_build.py script in the build folder from a command prompt. If no command line options are provided, the defaults will be used (Qt 5.15.2 and Visual Studio 2019)
6471

6572
Some useful options of the pre_build.py script:
66-
* --vs <Visual Studio version>: generate the solution files for a specific Visual Studio version. For example, to target Visual Studio 2019, add --vs 2019 to the command.
73+
* --vs <Visual Studio version>: generate the solution files for a specific Visual Studio version. For example, to target Visual Studio 2017, add --vs 2017 to the command.
6774
* --qt <path>: full path to the folder from where you would like the Qt binaries to be retrieved. By default, CMake would try to auto-detect Qt on the system.
6875

69-
Once the script has finished, in the case of Visual Studio 2017, a sub-folder called 'vs2017' will be created containing the necessary build files.
70-
Go into the 'vs2017' folder (build/win/vs2017) and double click on the RMV.sln file and build the 64-bit Debug and Release builds.
76+
Once the script has finished, in the case of Visual Studio 2019, a sub-folder called 'vs2019' will be created containing the necessary build files.
77+
Go into the 'vs2019' folder (build/win/vs2019) and double click on the RMV.sln file and build the 64-bit Debug and Release builds.
7178
The Release and Debug builds of RMV will be available in the build/release and build/debug folders.
7279

7380
## Support ##

build/dependency_map.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
# To allow for future updates where we may have cloned the project somewhere other than gerrit, store the root of
1212
# the repo in a variable. In future, we can automatically calculate this based on the git config
13-
gitRoot = "https://github.com/GPUOpen-Tools/"
13+
git_root = "https://github.com/GPUOpen-Tools/"
1414

1515
# Define a set of dependencies that exist as separate git projects.
1616
# each git dependency has a desired directory where it will be cloned - along with a commit to checkout
17-
gitMapping = {
18-
gitRoot + "QtCommon" : ["../external/qt_common", "v3.6.0"],
19-
gitRoot + "UpdateCheckAPI" : ["../external/update_check_api", "v2.0.0"],
17+
git_mapping = {
18+
git_root + "QtCommon" : ["../external/qt_common", "v3.7.0"],
19+
git_root + "UpdateCheckAPI" : ["../external/update_check_api", "v2.0.1"],
2020
}
2121

build/fetch_dependencies.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#! /usr/bin/python
1+
#! python3
22
# Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved.
33
#
4-
# Script to fetch all external git and/or downloable dependencies needed to build the project
4+
# Script to fetch all external git and/or downloadable dependencies needed to build the project
55
#
66
# fetch_dependencies.py (--internal)
77
#
@@ -26,82 +26,82 @@
2626
import urllib
2727

2828
# to allow the script to be run from anywhere - not just the cwd - store the absolute path to the script file
29-
scriptRoot = os.path.dirname(os.path.realpath(__file__))
29+
script_root = os.path.dirname(os.path.realpath(__file__))
3030

3131
# also store the basename of the file
32-
scriptName = os.path.basename(__file__)
32+
script_name = os.path.basename(__file__)
3333

3434
# Print a message to the console with appropriate pre-amble
35-
def logPrint(message):
36-
print ("\n" + scriptName + ": " + message)
35+
def log_print(message):
36+
print ("\n" + script_name + ": " + message)
3737
sys.stdout.flush()
3838

3939
# add script root to support import of URL and git maps
40-
sys.path.append(scriptRoot)
41-
from dependency_map import gitMapping
40+
sys.path.append(script_root)
41+
from dependency_map import git_mapping
4242

4343
# Clone or update a git repo
44-
def updateGitDependencies(gitMapping, update):
45-
for gitRepo in gitMapping:
44+
def update_git_dependencies(git_mapping, update):
45+
for git_repo in git_mapping:
4646
# add script directory to path
47-
tmppath = os.path.join(scriptRoot, gitMapping[gitRepo][0])
47+
tmp_path = os.path.join(script_root, git_mapping[git_repo][0])
4848

4949
# clean up path, collapsing any ../ and converting / to \ for Windows
50-
path = os.path.normpath(tmppath)
50+
path = os.path.normpath(tmp_path)
5151

5252
# required commit
53-
reqdCommit = gitMapping[gitRepo][1]
53+
reqd_commit = git_mapping[git_repo][1]
5454

55-
doCheckout = False
55+
do_checkout = False
5656
if not os.path.isdir(path):
5757
# directory doesn't exist - clone from git
58-
logPrint("Directory %s does not exist, using 'git clone' to get latest from %s" % (path, gitRepo))
59-
p = subprocess.Popen((["git", "clone", gitRepo ,path]), stderr=subprocess.STDOUT)
58+
log_print("Directory %s does not exist, using 'git clone' to get latest from %s" % (path, git_repo))
59+
p = subprocess.Popen((["git", "clone", git_repo ,path]), stderr=subprocess.STDOUT)
6060
p.wait()
6161
if(p.returncode == 0):
62-
doCheckout = True
62+
do_checkout = True
6363
else:
64-
logPrint("git clone failed with return code: %d" % p.returncode)
64+
log_print("git clone failed with return code: %d" % p.returncode)
6565
return False
6666
elif update == True:
6767
# directory exists and update requested - get latest from git
68-
logPrint("Directory %s exists, using 'git fetch --tags' to get latest from %s" % (path, gitRepo))
68+
log_print("Directory %s exists, using 'git fetch --tags' to get latest from %s" % (path, git_repo))
6969
p = subprocess.Popen((["git", "fetch", "--tags"]), cwd=path, stderr=subprocess.STDOUT)
7070
p.wait()
7171
if(p.returncode == 0):
72-
doCheckout = True
72+
do_checkout = True
7373
else:
74-
logPrint("git fetch failed with return code: %d" % p.returncode)
74+
log_print("git fetch failed with return code: %d" % p.returncode)
7575
return False
7676
else:
7777
# Directory exists and update not requested
78-
logPrint("Git Dependency %s found and not updated" % gitRepo)
78+
log_print("Git Dependency %s found and not updated" % git_repo)
7979

80-
if doCheckout == True:
81-
logPrint("Checking out required commit: %s" % reqdCommit)
82-
p = subprocess.Popen((["git", "checkout", reqdCommit]), cwd=path, stderr=subprocess.STDOUT)
80+
if do_checkout == True:
81+
log_print("Checking out required commit: %s" % reqd_commit)
82+
p = subprocess.Popen((["git", "checkout", reqd_commit]), cwd=path, stderr=subprocess.STDOUT)
8383
p.wait()
8484
if(p.returncode != 0):
85-
logPrint("git checkout failed with return code: %d" % p.returncode)
85+
log_print("git checkout failed with return code: %d" % p.returncode)
8686
return False
87-
logPrint("Ensuring any branch is on the head using git pull --ff-only origin %s" % reqdCommit)
88-
p = subprocess.Popen((["git", "pull", "--ff-only", "origin", reqdCommit]), cwd=path, stderr=subprocess.STDOUT)
87+
log_print("Ensuring any branch is on the head using git pull --ff-only origin %s" % reqd_commit)
88+
p = subprocess.Popen((["git", "pull", "--ff-only", "origin", reqd_commit]), cwd=path, stderr=subprocess.STDOUT)
8989
p.wait()
9090
if(p.returncode != 0):
91-
logPrint("git merge failed with return code: %d" % p.returncode)
91+
log_print("git merge failed with return code: %d" % p.returncode)
9292
return False
9393

9494
return True
9595

9696
# Main body of update functionality
97-
def doFetchDependencies(update, internal):
97+
def do_fetch_dependencies(update, internal):
9898
# Print git version being used
99-
gitCmd = ["git", "--version"]
100-
gitOutput = subprocess.check_output(gitCmd, stderr=subprocess.STDOUT)
101-
logPrint("%s" % gitOutput)
99+
git_cmd = ["git", "--version"]
100+
git_output = subprocess.check_output(git_cmd, stderr=subprocess.STDOUT)
101+
log_print("%s" % git_output)
102102

103103
# Update all git dependencies
104-
if updateGitDependencies(gitMapping, update):
104+
if update_git_dependencies(git_mapping, update):
105105
return True
106106
else:
107107
return False
@@ -114,4 +114,4 @@ def doFetchDependencies(update, internal):
114114
parser.add_argument("--internal", action="store_true", help="fetch dependencies required for internal builds of the tool (only used within AMD")
115115
args = parser.parse_args()
116116

117-
doFetchDependencies(True, args.internal)
117+
do_fetch_dependencies(True, args.internal)

0 commit comments

Comments
 (0)