forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AVX required ?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
EKruck



Joined: 09 Jan 2010
Posts: 181
Location: Aalen, Germany

PostPosted: Fri Feb 09, 2018 3:03 pm    Post subject: AVX required ? Reply with quote

One of my customers complains, that he cannot start one of the programs because his computer does not support AVX.
In the FTN95 help files I did not find a clear definition what the compiler is doing with SSE / AVX .
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Fri Feb 09, 2018 3:49 pm    Post subject: Reply with quote

This is a quick response. I can look at it in more detail later.

clearwin64.dll uses AVX instructions but only for routines like DOT_PRODUCT8@ when they are called directly in the Fortran code. One question is, does the presence of these routines cause a problem even when they are not called?

There again, routines like DOT_PRODUCT8@ only use AVX instructions when they are supported by the CPU.

Another question is, is AVX available but switched off on the end user's machine. AVX can be switched off via ""bcdedit /set xsavedisable 0". As a developer you can use this command (reboot needed) to test what happens to your application when AVX is disabled.

Correction and warning:
1. The value to use with xsavedisable is 1 and not 0.
2. My own experience with using bcdedit in this way was quite unpleasant.
At one point my machine failed to reboot until I used safe mode which is a long and tedious process under Windows 10. When using bcdedit it is vital that you first set up a process for backup and recover.
3. It turned out that the issue here relates to the fact that /64 /OPT creates an executable that will not load on a machine that does not support AVX.


Last edited by PaulLaidler on Wed Feb 14, 2018 8:40 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Sat Feb 10, 2018 10:26 am    Post subject: Reply with quote

There was a problem reported on the Forum that may be similar but I can't find it now. That problem was fixed by using a later build of clearwin64.dll. The current version should be OK. (note that clearwin64.dll is twinned with salflibc64.dll and these should always be shipped together).

Here is a list of routines that explicitly use AVX when it is supported otherwise they use SSE (SSE2 I guess).

DOT_PRODUCT8@
DOT_PRODUCT4@
AXPY8@
AXPY4@
also the standard intrinsic DOT_PRODUCT when the array size is large and is known at compile time.

clearwin64.dll is built using a Microsoft C++ compiler and there is an AVX option on the compiler command line which may be relevant. It is possible that Microsoft uses AVX in some way (in addition to our explicit use in clearwin64.dll).

On Monday I will aim to run some tests, after switching off AVX support on my machine, to see if this provides any insight.

If you know what CPU the end-user has then you can find out if it supports AVX and hence if they might have AVX support switched off on their machine.
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 181
Location: Aalen, Germany

PostPosted: Sat Feb 10, 2018 12:02 pm    Post subject: Reply with quote

Paul,
thanks for your explanations. From my experience a program do not start at all if it contains AVX parts but the computer does not support AVX.
I checked my program which causes the problem. There is definitely no call to any DOT or AXPY routine; as well not in the included library functions.
However, I found in the map file: "__test_avx - SALFLIBC64.DLL". This might be the problem.

I cannot switch off AVX because I provide my large number crunching program in two versions: AVX and SSE3. It will be compiled by Intel Fortran. There I can explicitly define which code generation shall be used.
Your compiler decides automatically about code generation. Because of the problems I need to select by myself the type of code generation.

Erwin
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Sat Feb 10, 2018 1:00 pm    Post subject: Reply with quote

Erwin

__test_avx will not cause a problem. It works for any CPU.

I was suggesting that you switch off AVX only as a temporary test, the make sure that clearwin64.dll loads and runs correctly without AVX.

At the moment FTN95 does not have an AVX switch on the command line. In certain situations it uses AVX when available but it is not dependent on AVX.

Paul
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 181
Location: Aalen, Germany

PostPosted: Sat Feb 10, 2018 3:01 pm    Post subject: Reply with quote

Paul,

I tried to switch AVX off with your command. But it did not work, otherwise my program compiled (iFort) to use AVX should not have started.

Erwin
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Sat Feb 10, 2018 3:17 pm    Post subject: Reply with quote

Erwin

Did you remember to reboot after the command?
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 181
Location: Aalen, Germany

PostPosted: Sat Feb 10, 2018 4:58 pm    Post subject: Reply with quote

of course
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Mon Feb 12, 2018 11:23 am    Post subject: Reply with quote

It turns out that AVX support can't be switched off (at least I have not been able to do so). So I can't test this on my current machine.

If anyone has easy access to a 64 bit machine that does not support AVX can you please test if clearwin64.dll loads correctly. My current understanding is that there should be no problem. Any program that calls winio@, for example, would provide a suitable test.
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 181
Location: Aalen, Germany

PostPosted: Mon Feb 12, 2018 2:32 pm    Post subject: Reply with quote

Paul,

it's vice versa: "bcdedit /set xsavedisable 1" switches AVX off.
The message then is:
Silverfrost exception report on BBman.exe
FTN95 optimised code needs AVX CPU capability at address 1c0084dd
Within file BBman.exe

Would the map file help you? I coud send it to your private email address.

Erwin
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Mon Feb 12, 2018 3:54 pm    Post subject: Reply with quote

Erwin

Thank you. Now I understand what is happening.

If you create your executable with /64 and /OPT then the executable will fail to load (on a machine without AVX) and it will generate this runtime error report.

This restriction is not actually needed right now. It has been included for the purposes of ongoing development in which we aim to use AVX in the outcome of the optimisation process.

For an immediate fix you could switch off FTN95 optimisation either generally or for this particular end user. Your choice may depend on how much improvement you get with /OPT applied.

Another possibility is for us to provide a switch on the SLINK64 command line to over-ride this restriction but that may not be easy and so could be costly in one way or another.


Last edited by PaulLaidler on Mon Feb 12, 2018 5:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 181
Location: Aalen, Germany

PostPosted: Mon Feb 12, 2018 5:00 pm    Post subject: Reply with quote

Paul,
I have switched off AVX, compiled all libraries and the program anew, but I receive still the same error message.
Erwin
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5587
Location: Salford, UK

PostPosted: Mon Feb 12, 2018 5:18 pm    Post subject: Reply with quote

Erwin

At the moment you can not use FTN95 /OPT /64 on a machine that does not have AVX support. Have you built using /OPT?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1024

PostPosted: Tue Feb 20, 2018 8:14 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
Erwin

At the moment you can not use FTN95 /OPT /64 on a machine that does not have AVX support. Have you built using /OPT?

That limitation is a rather unexpected handicap when the program does only integer and character processing; such a program would not use AVX instructions even if they were available (well, the RTL may contain AVX code that gets run even when the user's code is all-integer).

I hope that this restriction will be removed or relaxed in future versions of FTN95.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1997
Location: Sydney

PostPosted: Tue Feb 20, 2018 11:36 pm    Post subject: Reply with quote

What processors are there that support 64-bit, but don't have AVX support ?
I am thinking that it is a small group, but I may be surprised.
I am equating AVX with improved performance so if you need a large memory solution, wouldn't you need good performance.

John

( I have just purchased an i7-8700K and it is actually faster for AVX instructions. Same clock rate but faster memory, more cache > faster performance )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group