SWDEV-204804 - Detecing pcie atomic support
- check pcie atomci support for printf functionality
- if not enabled printf wont work
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: Ib366e8e71772b02210c4a830bca4bd8cc7a11664
[ROCm/clr commit: 15f1632dfa]
Cette révision appartient à :
@@ -603,6 +603,8 @@ struct Info : public amd::EmbeddedObject {
|
|||||||
|
|
||||||
//! AQL Barrier Value Packet support
|
//! AQL Barrier Value Packet support
|
||||||
bool aqlBarrierValue_;
|
bool aqlBarrierValue_;
|
||||||
|
|
||||||
|
bool pcie_atomics_; //!< Pcie atomics support flag
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Device settings
|
//! Device settings
|
||||||
|
|||||||
@@ -207,6 +207,16 @@ void Device::setupCpuAgent() {
|
|||||||
system_segment_.handle, system_coarse_segment_.handle, _bkendDevice.handle);
|
system_segment_.handle, system_coarse_segment_.handle, _bkendDevice.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Device::checkAtomicSupport() {
|
||||||
|
std::vector<amd::Device::LinkAttrType> link_attrs;
|
||||||
|
link_attrs.push_back(std::make_pair(LinkAttribute::kLinkAtomicSupport, 0));
|
||||||
|
if (findLinkInfo(system_segment_, &link_attrs)) {
|
||||||
|
if (link_attrs[0].second == 1) {
|
||||||
|
info_.pcie_atomics_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Device::~Device() {
|
Device::~Device() {
|
||||||
#ifdef WITH_AMDGPU_PRO
|
#ifdef WITH_AMDGPU_PRO
|
||||||
delete pro_device_;
|
delete pro_device_;
|
||||||
@@ -1167,6 +1177,8 @@ bool Device::populateOCLDeviceConstants() {
|
|||||||
|
|
||||||
setupCpuAgent();
|
setupCpuAgent();
|
||||||
|
|
||||||
|
checkAtomicSupport();
|
||||||
|
|
||||||
assert(system_segment_.handle != 0);
|
assert(system_segment_.handle != 0);
|
||||||
if (HSA_STATUS_SUCCESS != hsa_amd_agent_iterate_memory_pools(
|
if (HSA_STATUS_SUCCESS != hsa_amd_agent_iterate_memory_pools(
|
||||||
_bkendDevice, Device::iterateGpuMemoryPoolCallback, this)) {
|
_bkendDevice, Device::iterateGpuMemoryPoolCallback, this)) {
|
||||||
|
|||||||
@@ -374,6 +374,9 @@ class Device : public NullDevice {
|
|||||||
static const std::vector<AgentInfo>& getCpuAgents() { return cpu_agents_; }
|
static const std::vector<AgentInfo>& getCpuAgents() { return cpu_agents_; }
|
||||||
|
|
||||||
void setupCpuAgent(); // Setup the CPU agent which has the least NUMA distance to this GPU
|
void setupCpuAgent(); // Setup the CPU agent which has the least NUMA distance to this GPU
|
||||||
|
|
||||||
|
void checkAtomicSupport(); //!< Check the support for pcie atomics
|
||||||
|
|
||||||
//! Destructor for the physical HSA device
|
//! Destructor for the physical HSA device
|
||||||
virtual ~Device();
|
virtual ~Device();
|
||||||
|
|
||||||
|
|||||||
@@ -2781,7 +2781,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case amd::KernelParameterDescriptor::HiddenHostcallBuffer: {
|
case amd::KernelParameterDescriptor::HiddenHostcallBuffer: {
|
||||||
if (amd::IS_HIP) {
|
if (roc_device_.info().pcie_atomics_) {
|
||||||
uintptr_t buffer = reinterpret_cast<uintptr_t>(
|
uintptr_t buffer = reinterpret_cast<uintptr_t>(
|
||||||
roc_device_.getOrCreateHostcallBuffer(gpu_queue_, coopGroups, cuMask_));
|
roc_device_.getOrCreateHostcallBuffer(gpu_queue_, coopGroups, cuMask_));
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
@@ -2790,6 +2790,10 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_);
|
WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_);
|
||||||
|
} else {
|
||||||
|
ClPrint(amd::LOG_ERROR, amd::LOG_KERN,
|
||||||
|
"Pcie atomics not enabled, printf not supported");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur