Skip to content

Commit

Permalink
ROCm 6.1.2 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dayatsin-amd committed Jun 4, 2024
1 parent 34437c2 commit 397fa1d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
5 changes: 3 additions & 2 deletions src/core/runtime/amd_blit_sdma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,11 @@ hsa_status_t BlitSdma<RingIndexTy, HwIndexMonotonic, SizeToCountOffset, useGCR>:
}

// 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;
}

Expand Down
38 changes: 19 additions & 19 deletions src/core/util/lnx/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -141,14 +123,32 @@ 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));
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 (err == 0)
args.release();
else
Expand Down

0 comments on commit 397fa1d

Please sign in to comment.