hip: integrated Radeons (gfx1103/gfx1150/gfx1151, UMA flag) take the matrix-core prompt set by default; STRATA_IGPU_DEFAULTS=0 and each switch =0 turn it off; unit test with mock devices

This commit is contained in:
Niko1221 committed 2026-10-19 20:38:55 +02:00
1 parent 74e25e165b
commit ce968a2fac
4 files changed
+140 -12

No files matched your search

+15 -2
View File
@@ -2671,8 +2671,21 @@ int main(int argc, char** argv) {
{ // gfx1151 (Strix Halo): the switches that are exact there are on by default (strata/core/arch_defaults.hpp); before
// any engine code reads its switches (they are read at first use), and the user's own settings are kept
cudaDeviceProp ad{};
if (cudaGetDeviceProperties(&ad, 0) == cudaSuccess) strata::core::apply_arch_defaults(ad.gcnArchName);
else (void) cudaGetLastError();
if (cudaGetDeviceProperties(&ad, 0) == cudaSuccess) {
// an integrated Radeon (UMA / APU: the device property, not the name): the matrix-core prompt set is on by
// default. Only when EVERY visible GPU is integrated and of the same architecture, so a box that also holds a
// discrete card (whichever the engine ends up using) keeps the old defaults.
bool all_igpu = ad.integrated != 0;
int ndev = 0;
if (all_igpu && cudaGetDeviceCount(&ndev) == cudaSuccess) {
for (int d = 1; d < ndev && d < 64; ++d) {
cudaDeviceProp od{};
if (cudaGetDeviceProperties(&od, d) != cudaSuccess || od.integrated == 0 ||
std::strncmp(od.gcnArchName, ad.gcnArchName, 7) != 0) { all_igpu = false; (void) cudaGetLastError(); break; }
}
}
strata::core::apply_arch_defaults(ad.gcnArchName, all_igpu);
} else (void) cudaGetLastError();
}
#endif
#if !defined(STRATA_USE_HIP) && !defined(STRATA_GPU_METAL)