PGO under MSVC 2015

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

PGO under MSVC 2015

Post by Cardoso »

Hi, I would like to make a PGO of my engine.
I know I have to copy some dll to my engine folder but I have two problems:

1 - I have several amd64* folders under C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\
...\bin\amd64
...\bin\amd64_x86
...\bin\x86_amd64
I want a 64bit compile, wich folder do I use and wich dll should I copy to my engine folder?

2 - I know some statistics file is generated in my engine folder while running the instrumentation exe, what file is that, and very importantely to where do I copy it back, so that the compiler can find it, before making the final PGO compile?

best regards,
Alvaro
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: PGO under MSVC 2015

Post by cdani »

I make pgo builds like this:
https://blogs.msdn.microsoft.com/vcblog ... using-pgo/
No manipulation is necessary.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: PGO under MSVC 2015

Post by jdart »

I am a command-line guy, so I use NMAKE for this: see

https://github.com/jdart1/arasan-chess/ ... kefile.win

The "profiled" target does all PGO steps and writes the final profiled executable into the target binary directory.

I build the profile objects into directory distinct from a regular build, since they use different flags from a regular (non-profile) build.

--Jon
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: PGO under MSVC 2015

Post by velmarin »

cdani wrote:I make pgo builds like this:
https://blogs.msdn.microsoft.com/vcblog ... using-pgo/
No manipulation is necessary.
The native pgo of the microsoft compiler is quite incomplete if we compare it to what it is capable of doing "Intel compiler",
In Intel we have an engine compiled and instrumented, registered in the GUI that we like, and we do play, analyze or what interests us, this creates a lot of files with information for the compiler, for the last compiled final.
Intel even tells you the functions that no information has been obtained.
To do it with Microsoft compiler it takes a few dlls, despite all my attempts I have never got it.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: PGO under MSVC 2015

Post by cdani »

velmarin wrote: The native pgo of the microsoft compiler is quite incomplete if we compare it to what it is capable of doing "Intel compiler",
In Intel we have an engine compiled and instrumented, registered in the GUI that we like, and we do play, analyze or what interests us, this creates a lot of files with information for the compiler, for the last compiled final.
Intel even tells you the functions that no information has been obtained.
To do it with Microsoft compiler it takes a few dlls, despite all my attempts I have never got it.
Interesting, thanks. I really have not delved into the subject.
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: PGO under MSVC 2015

Post by pedrox »

I am not sure if I fully understood the question.

I previously used visual c ++ and maked a pgo exe.

I did not need to move the exe from his folder to do the instrumentation and training. From the console I did solve a test of positions epd and that was worth. I'm not sure if with games the result would be higher. In my case the exe was about 4% faster.

In case of wanting games, I think it was possible to install the engine in the GUI, without moving it from folder and make the games without having to go copying dlls.
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: PGO under MSVC 2015

Post by velmarin »

pedrox wrote:I am not sure if I fully understood the question.

I previously used visual c ++ and maked a pgo exe.

I did not need to move the exe from his folder to do the instrumentation and training. From the console I did solve a test of positions epd and that was worth. I'm not sure if with games the result would be higher. In my case the exe was about 4% faster.

In case of wanting games, I think it was possible to install the engine in the GUI, without moving it from folder and make the games without having to go copying dlls.
With Intel Compiler and Visual C ++ environment, we compiled the project for PGO or PGI, installed in Fritz or Arena GUI, ect, this previous engine,
  Without closing the project in Visual C ++, project must be open.
We make it work with different workloads, with tablebases or without them, with analysis, unicore or multicore ect, this makes that all the functions of the engine are instrumented.
Always without closing the project, the different information files for the compiler will be generated.
Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: PGO under MSVC 2015

Post by Cardoso »

I do need to move the exe from the build folder to the normal program folder, since the exe depends on several external files to initialize correctly.
My engine is not chess, it is a portuguese variante of checkers.
Also my GUI sends a lot of initializing commands, so I do need to move the exe to the normal program folder and run it from the GUI.
After I run the instrumented exe I suppose I must copy the profile files back to the build folder, I'm not sure.

But what is confusing me is what dlls must I copy to the normal program folder.
I think it is pgodb140.dll
but there is also pgomgr.exe should I copy it also?
What's worse is that I have several folders where those files are:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64
From wich of the above folders should I get pgodb140.dll and maybe also also pgomgr.exe ?

best regards,
Alvaro
Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: PGO under MSVC 2015

Post by Cardoso »

Yes I tested PGO with the Intel compiler and it sure is smooth working.
I liked it very much.
The reason I'm running away from the Intel compiler is that it will make exes run slower on all AMD cpus on purpose.
That is why I want to use MSVC.

best regards,
Alvaro
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: PGO under MSVC 2015

Post by jdart »

The directories you mention are for different compiler platforms. x86_64 is for building where host and target are an Intel 64-bit architecture. x86_amd64 is for building on a 32-bit OS for 64-bit target.

--Jon