Skip to content

Commit 397fa1d

Browse files
committed
ROCm 6.1.2 updates
1 parent 34437c2 commit 397fa1d

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

src/core/runtime/amd_blit_sdma.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,11 @@ hsa_status_t BlitSdma<RingIndexTy, HwIndexMonotonic, SizeToCountOffset, useGCR>:
164164
}
165165

166166
// HDP flush supported on gfx900 and forward.
167-
// FIXME: Not working on gfx10, raises SRBM write protection interrupt.
168167
// gfx90a can support xGMI host to device connections so bypass HDP flush
169168
// in this case.
170-
if (agent_->isa()->GetMajorVersion() == 9) {
169+
// gfx101x seems to have issues with HDP flushes
170+
if (agent_->isa()->GetMajorVersion() >= 9 &&
171+
!(agent_->isa()->GetMajorVersion() == 10 && agent_->isa()->GetMinorVersion() == 1)) {
171172
hdp_flush_support_ = link.info.link_type != HSA_AMD_LINK_INFO_TYPE_XGMI;
172173
}
173174

src/core/util/lnx/os_linux.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,6 @@ class os_thread {
111111
return;
112112
}
113113
}
114-
\
115-
err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get());
116-
117-
// Probably a stack size error since system limits can be different from PTHREAD_STACK_MIN
118-
// Attempt to grow the stack within reason.
119-
if ((err == EINVAL) && stackSize != 0) {
120-
while (stackSize < 20 * 1024 * 1024) {
121-
stackSize *= 2;
122-
err = pthread_attr_setstacksize(&attrib, stackSize);
123-
if (err != 0) {
124-
fprintf(stderr, "pthread_attr_setstacksize failed: %s\n", strerror(err));
125-
return;
126-
}
127-
err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get());
128-
if (err != EINVAL) break;
129-
debug_print("pthread_create returned EINVAL, doubling stack size\n");
130-
}
131-
}
132114

133115
if (core::Runtime::runtime_singleton_->flag().override_cpu_affinity()) {
134116
int cores = get_nprocs_conf();
@@ -141,14 +123,32 @@ class os_thread {
141123
for (int i = 0; i < cores; i++) {
142124
CPU_SET_S(i, CPU_ALLOC_SIZE(cores), cpuset);
143125
}
144-
err = pthread_setaffinity_np(thread, CPU_ALLOC_SIZE(cores), cpuset);
126+
err = pthread_attr_setaffinity_np(&attrib, CPU_ALLOC_SIZE(cores), cpuset);
145127
CPU_FREE(cpuset);
146128
if (err != 0) {
147129
fprintf(stderr, "pthread_attr_setaffinity_np failed: %s\n", strerror(err));
148130
return;
149131
}
150132
}
151133

134+
err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get());
135+
136+
// Probably a stack size error since system limits can be different from PTHREAD_STACK_MIN
137+
// Attempt to grow the stack within reason.
138+
if ((err == EINVAL) && stackSize != 0) {
139+
while (stackSize < 20 * 1024 * 1024) {
140+
stackSize *= 2;
141+
err = pthread_attr_setstacksize(&attrib, stackSize);
142+
if (err != 0) {
143+
fprintf(stderr, "pthread_attr_setstacksize failed: %s\n", strerror(err));
144+
return;
145+
}
146+
err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get());
147+
if (err != EINVAL) break;
148+
debug_print("pthread_create returned EINVAL, doubling stack size\n");
149+
}
150+
}
151+
152152
if (err == 0)
153153
args.release();
154154
else

0 commit comments

Comments
 (0)