P4 to Git Change 1715236 by axie@axie_win_opencl_laptop on 2018/12/03 14:48:51
SWDEV-165045 - Linux-Pro System Hard-Hang with Call Trace and VM Faults are observed while running ABAQUS-2018-OpenCL Sample on VEGA GPU "-g" option caused shader compiler generated isa code which caused the VM fault. The root cause is still unknown. "-g" is not a feature for end user. So remove it. Remove -g options from application. The affected API includes build, link and compile CL C kernel code. Update ocltst compiler test to remove one test which uses "-g" AMD_OCL_BUILD_OPTIONS_APPEND can be used to force "-g" option Test: Run the Abaqus as specfied in the JIRA twice. No VM fault. In a simple OpenCL test application, driver can handle build option "-g -cl-mad-enable -g -D DDBUILD -D ok-g -g" correctly. Teamcity test. http://ocltc.amd.com:8111/viewModification.html?modId=112334&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true No new failure. ReviewBoard: http://ocltc.amd.com/reviews/r/16255/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#98 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/compiler/OCLSeparateCompile.cpp#17 edit
This commit is contained in:
@@ -19,6 +19,24 @@
|
||||
|
||||
namespace amd {
|
||||
|
||||
static void remove_g_option(std::string &option)
|
||||
{
|
||||
// Remove " -g " option from application.
|
||||
// People can still add -g in AMD_OCL_BUILD_OPTIONS_APPEND, if it is so desired.
|
||||
std::string g_str("-g");
|
||||
std::size_t g_pos = 0;
|
||||
while ((g_pos = option.find(g_str, g_pos)) != std::string::npos) {
|
||||
if ((g_pos == 0 || option[g_pos - 1] == ' ') &&
|
||||
(g_pos + 2 == option.size() || option[g_pos + 2] == ' ')) {
|
||||
option.erase(g_pos, g_str.size());
|
||||
} else {
|
||||
g_pos += g_str.size();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Program::~Program() {
|
||||
// Destroy all device programs
|
||||
for (const auto& it : devicePrograms_) {
|
||||
@@ -185,6 +203,7 @@ cl_int Program::compile(const std::vector<Device*>& devices, size_t numHeaders,
|
||||
cppstr = cppstr.substr(pos + sizeof("-ignore-env"));
|
||||
optionChangable = false;
|
||||
}
|
||||
remove_g_option(cppstr);
|
||||
}
|
||||
option::Options parsedOptions;
|
||||
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable)) {
|
||||
@@ -269,6 +288,7 @@ cl_int Program::link(const std::vector<Device*>& devices, size_t numInputs,
|
||||
cppstr = cppstr.substr(pos + sizeof("-ignore-env"));
|
||||
optionChangable = false;
|
||||
}
|
||||
remove_g_option(cppstr);
|
||||
}
|
||||
option::Options parsedOptions;
|
||||
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable, true)) {
|
||||
@@ -460,6 +480,7 @@ cl_int Program::build(const std::vector<Device*>& devices, const char* options,
|
||||
cppstr = cppstr.substr(pos + sizeof("-ignore-env"));
|
||||
optionChangable = false;
|
||||
}
|
||||
remove_g_option(cppstr);
|
||||
}
|
||||
option::Options parsedOptions;
|
||||
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable)) {
|
||||
|
||||
Reference in New Issue
Block a user