86 return make_unique<HIPRTDevice>(info, stats, profiler, headless);
88 return make_unique<HIPDevice>(info, stats, profiler, headless);
89#elif defined(WITH_HIP)
90 return make_unique<HIPDevice>(info, stats, profiler, headless);
97 LOG_FATAL <<
"Request to create HIP device without compiled-in support. Should never happen.";
128 hipError_t
result = device_hip_safe_init();
129 if (
result != hipSuccess) {
130 if (
result != hipErrorNoDevice) {
138 if (
result != hipSuccess) {
144 const bool has_hardware_raytracing = hiprtewInit();
146 const bool has_hardware_raytracing =
false;
155 if (
result != hipSuccess) {
160 if (!hipSupportsDevice(
num)) {
176 if (
num != peer_num) {
177 if (hipSupportsDevice(peer_num)) {
179 hipDeviceCanAccessPeer(&can_access,
num, peer_num);
188 int pci_location[3] = {0, 0, 0};
189 hipDeviceGetAttribute(&pci_location[0], hipDeviceAttributePciDomainID,
num);
190 hipDeviceGetAttribute(&pci_location[1], hipDeviceAttributePciBusId,
num);
191 hipDeviceGetAttribute(&pci_location[2], hipDeviceAttributePciDeviceId,
num);
194 (
unsigned int)pci_location[0],
195 (
unsigned int)pci_location[1],
196 (
unsigned int)pci_location[2]);
199# if defined(WITH_OPENIMAGEDENOISE)
202# if OIDN_VERSION >= 20300
203 if (hipSupportsDeviceOIDN(
num) && oidnIsHIPDeviceSupported(
num)) {
205 if (hipSupportsDeviceOIDN(
num) && OIDNDenoiserGPU::is_device_supported(info)) {
214 int timeout_attr = 0;
215 hipDeviceGetAttribute(&timeout_attr, hipDeviceAttributeKernelExecTimeout,
num);
218 LOG_INFO <<
"Device is recognized as display.";
221 display_devices.push_back(info);
224 LOG_INFO <<
"Device has compute preemption or is not used for display.";
225 devices.push_back(info);
231 LOG_INFO <<
"Device with id \"" << info.
id <<
"\" supports "
236 if (!display_devices.empty()) {
237 devices.insert(devices.end(), display_devices.begin(), display_devices.end());
247 hipError_t
result = device_hip_safe_init();
248 if (
result != hipSuccess) {
249 if (
result != hipErrorNoDevice) {
250 return string(
"Error initializing HIP: ") + hipewErrorString(
result);
252 return "No HIP device found\n";
257 if (
result != hipSuccess) {
258 return string(
"Error getting devices: ") + hipewErrorString(
result);
264 if (hipDeviceGetName(
name, 256,
num) != hipSuccess) {
267 capabilities += string(
"\t") +
name +
"\n";
269# define GET_ATTR(attr) \
271 if (hipDeviceGetAttribute(&value, hipDeviceAttribute##attr, num) == hipSuccess) { \
272 capabilities += string_printf("\t\thipDeviceAttribute" #attr "\t\t\t%d\n", value); \
279 GET_ATTR(MaxThreadsPerBlock);
280 GET_ATTR(MaxBlockDimX);
281 GET_ATTR(MaxBlockDimY);
282 GET_ATTR(MaxBlockDimZ);
283 GET_ATTR(MaxGridDimX);
284 GET_ATTR(MaxGridDimY);
285 GET_ATTR(MaxGridDimZ);
286 GET_ATTR(MaxSharedMemoryPerBlock);
287 GET_ATTR(TotalConstantMemory);
290 GET_ATTR(MaxRegistersPerBlock);
292 GET_ATTR(TextureAlignment);
293 GET_ATTR(MultiprocessorCount);
294 GET_ATTR(KernelExecTimeout);
295 GET_ATTR(Integrated);
296 GET_ATTR(CanMapHostMemory);
297 GET_ATTR(ComputeMode);
298 GET_ATTR(MaxTexture1DWidth);
299 GET_ATTR(MaxTexture2DWidth);
300 GET_ATTR(MaxTexture2DHeight);
301 GET_ATTR(MaxTexture3DWidth);
302 GET_ATTR(MaxTexture3DHeight);
303 GET_ATTR(MaxTexture3DDepth);
304 GET_ATTR(ConcurrentKernels);
305 GET_ATTR(EccEnabled);
306 GET_ATTR(MemoryClockRate);
307 GET_ATTR(MemoryBusWidth);
308 GET_ATTR(L2CacheSize);
309 GET_ATTR(MaxThreadsPerMultiProcessor);
310 GET_ATTR(ComputeCapabilityMajor);
311 GET_ATTR(ComputeCapabilityMinor);
312 GET_ATTR(MaxSharedMemoryPerMultiprocessor);
313 GET_ATTR(ManagedMemory);
314 GET_ATTR(IsMultiGpuBoard);
316 capabilities +=
"\n";