Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Users mailing list

Subject: Re: [hwloc-users] Having trouble getting CPU Model string on Windows 7 x64
From: Robin Scher (robin_at_[hidden])
Date: 2014-01-28 03:46:27


Hi, thanks for responding.

The CPUModel is definitely available on this machine. A 32 bit process on the same machine correctly finds the model name using code that calls the cpuid inline assembly to get it, and the machine itself is a VM running on a Mac, and I get the same model name from the code on Mac and on a Linux VM running on the same machine as well. It seems to be an issue with the Windows port of hwloc, and possibly only with the 64 bit version (I haven’t tried the 32 bit version yet).

I am using the prebuilt binary on Windows. I haven’t tried (and I’m not sure I want to try) building hwloc from source on Windows x64 using MSVC, but I have found out so far today that Microsoft makes available a compiler intrinsic to get access to cpuid as a C function, and that’s supposed to allow you to do the same kind of cpuid call work done previously as inline assembly. Perhaps someone out there is more familiar with this specific functionality in hwloc and can fix this for the 64 bit Windows build? I can take a stab at it, but like I said, the biggest hwloc development I’ve done is setting a flag in the configure script when I build on Unix.

As a last question, where is the “CPUModel” documented about where it would appear? I was looking for that but couldn’t find it.

Thank you for any further advice.
-robin

Robin Scher
robin_at_[hidden]
+1 (213) 448-0443

On Jan 27, 2014, at 11:10 PM, Brice Goglin <Brice.Goglin_at_[hidden]> wrote:

> Hello,
>
> The CPUModel attribute should be only in Socket or machine/root objects. At least, that's what I documented and what I seem to see in the code. Did you actually see any other place?
>
> So it may just mean that the CPUModel is not available on your machine? Or maybe the code below is buggy somehow? Does lstopo -v on Windows show a CPUModel attribute? It does in a 32bits binary running on my Win7 64bits, but doesn't seem to find anything when running the 64bits binary. I don't remember well if there was a specific Windows 64bits issue in the cpuid code in the x86 backend.
>
> Brice
>
>
>
> Le 28/01/2014 01:59, Robin Scher a écrit :
>> Hi again.
>>
>> I’m trying to use hwloc 1.8 on Windows, Linux and Mac to get the CPU model string (e.g., “Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz”). Since hwloc on different platforms seem to stash this in different objects, I’m using code like this:
>>
>> String name;
>> hwloc_obj_type_t objs[] = {
>> HWLOC_OBJ_MACHINE,
>> HWLOC_OBJ_SOCKET,
>> HWLOC_OBJ_CORE,
>> HWLOC_OBJ_PU, };
>> for( size_t index = 0; index < (sizeof( objs ) / sizeof( hwloc_obj_type_t )) && name.Empty(); ++index )
>> {
>> hwloc_obj_t obj = hwloc_get_obj_by_type( topology, objs[ index ], 0 );
>> if( !obj ) continue;
>> const char *str = hwloc_obj_get_info_by_name( obj, "CPUModel" );
>> if( str ) name = String( str ).Trim();
>> }
>>
>> On Mac, it works (found string at HWLOC_OBJ_MACHINE), and on Linux it works (found string at HWLOC_OBJ_SOCKET), but on Windows x64, none of these find the string. They all return a NULL pointer.
>>
>> Am I missing something? I tried a few other of the object types, but didn’t find it with them either (I actually tried looping through all integer values between 0 and HWLOC_OBJ_TYPE_MAX and it didn’t appear in any of them).
>>
>> Thank you for any help you can provide.
>> -robin
>>
>> Robin Scher
>> robin_at_[hidden]
>> +1 (213) 448-0443
>>
>>
>>
>>
>>
>> _______________________________________________
>> hwloc-users mailing list
>> hwloc-users_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users
>
> _______________________________________________
> hwloc-users mailing list
> hwloc-users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users