diff --git a/src/core/runtime/amd_blit_sdma.cpp b/src/core/runtime/amd_blit_sdma.cpp index 669402b04..b39f86461 100644 --- a/src/core/runtime/amd_blit_sdma.cpp +++ b/src/core/runtime/amd_blit_sdma.cpp @@ -164,10 +164,11 @@ hsa_status_t BlitSdma: } // HDP flush supported on gfx900 and forward. - // FIXME: Not working on gfx10, raises SRBM write protection interrupt. // gfx90a can support xGMI host to device connections so bypass HDP flush // in this case. - if (agent_->isa()->GetMajorVersion() == 9) { + // gfx101x seems to have issues with HDP flushes + if (agent_->isa()->GetMajorVersion() >= 9 && + !(agent_->isa()->GetMajorVersion() == 10 && agent_->isa()->GetMinorVersion() == 1)) { hdp_flush_support_ = link.info.link_type != HSA_AMD_LINK_INFO_TYPE_XGMI; } diff --git a/src/core/util/lnx/os_linux.cpp b/src/core/util/lnx/os_linux.cpp index 7850490e2..b13c907b8 100644 --- a/src/core/util/lnx/os_linux.cpp +++ b/src/core/util/lnx/os_linux.cpp @@ -111,24 +111,6 @@ class os_thread { return; } } -\ - err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get()); - - // Probably a stack size error since system limits can be different from PTHREAD_STACK_MIN - // Attempt to grow the stack within reason. - if ((err == EINVAL) && stackSize != 0) { - while (stackSize < 20 * 1024 * 1024) { - stackSize *= 2; - err = pthread_attr_setstacksize(&attrib, stackSize); - if (err != 0) { - fprintf(stderr, "pthread_attr_setstacksize failed: %s\n", strerror(err)); - return; - } - err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get()); - if (err != EINVAL) break; - debug_print("pthread_create returned EINVAL, doubling stack size\n"); - } - } if (core::Runtime::runtime_singleton_->flag().override_cpu_affinity()) { int cores = get_nprocs_conf(); @@ -141,7 +123,7 @@ class os_thread { for (int i = 0; i < cores; i++) { CPU_SET_S(i, CPU_ALLOC_SIZE(cores), cpuset); } - err = pthread_setaffinity_np(thread, CPU_ALLOC_SIZE(cores), cpuset); + err = pthread_attr_setaffinity_np(&attrib, CPU_ALLOC_SIZE(cores), cpuset); CPU_FREE(cpuset); if (err != 0) { fprintf(stderr, "pthread_attr_setaffinity_np failed: %s\n", strerror(err)); @@ -149,6 +131,24 @@ class os_thread { } } + err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get()); + + // Probably a stack size error since system limits can be different from PTHREAD_STACK_MIN + // Attempt to grow the stack within reason. + if ((err == EINVAL) && stackSize != 0) { + while (stackSize < 20 * 1024 * 1024) { + stackSize *= 2; + err = pthread_attr_setstacksize(&attrib, stackSize); + if (err != 0) { + fprintf(stderr, "pthread_attr_setstacksize failed: %s\n", strerror(err)); + return; + } + err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get()); + if (err != EINVAL) break; + debug_print("pthread_create returned EINVAL, doubling stack size\n"); + } + } + if (err == 0) args.release(); else