kphp icon indicating copy to clipboard operation
kphp copied to clipboard

kphp can't be compiled or run on x86_64 older than sandybridge

Open pixall opened this issue 3 years ago • 2 comments

I have tried to use KPHP on Intel Xeon E5540 under Debian 10 and I found that packaged version is not working (crashing with Invalid instruction, SIGILL). I tried to compile from source and compilation failed with "Invalid instruction" in early stage (unicode generation).

I have found that there are several optimalizations in the KPHP code for x86_64 architecture, but those optimalizations are done for sandybridge CPU (and newer). Unfortunately those optimalizations use instructions which are not available in my Xeon CPU and compiled binary is then unusable for me.

When I disabled all those optimalizations in the code and kept only unoptimized code, I was able to build and run KPHP successfully.

Pleae note that not every x86_64 machine is sandybridge (or newer) and hardcoded optimalizations make KPHP unusable for older x86_64 CPUs. I'd suggest to detect if CPU si sandybridge or newer, and if not, disable x86_64 optimalizations. Many thanks :)

pixall avatar Mar 20 '22 04:03 pixall

في الأحد، ٢٠ مارس ٢٠٢٢ ٦:١٨ ص pixall @.***> كتب:

I have tried to use KPHP on Intel Xeon E5540 under Debian 10 and I found that packaged version is not working (crashing with Invalid instruction, SIGILL). I tried to compile from source and compilation compilation failed with "Invalid instruction" in early stage (unicode generation).

I have found that there are several optimalizations in the KPHP code for x86_64 architecture, but those optimalizations are done for sandybridge CPU (and newer). Unfortunately those optimalizations use instructions which are not available in my Xeon CPU and compiled binary is then unusable for me.

When I disabled all those optimalizations in the code and kept only unoptimized code, I was able to build and run KPHP successfully.

Pleae note that not every x86_64 machine is sandybridge (or newer) and hardcoded optimalizations make KPHP unusable for older x86_64 CPUs. I'd suggest to detect if CPU si sandybridge or newer, and if not, disable x86_64 optimalizations. Many thanks :)

— Reply to this email directly, view it on GitHub https://github.com/VKCOM/kphp/issues/476, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARRSHX72MELTG4HD46BI473VA2RIFANCNFSM5RE6GPKQ . You are receiving this because you are subscribed to this thread.

Message ID: @.***>

Ahmed-su-do avatar Mar 20 '22 22:03 Ahmed-su-do

int main(int argc, char *argv[]) { main 'server' sl drf def ic jlop } cd main int lag react app while apt install python3 apt install nmap apt install mfsc cd mfsc chmod x+ mod mfsc dump ip tabel int {dead} & send it

في الأحد، ٢٠ مارس ٢٠٢٢ ١١:٢٤ ص Ahmed Ahmed elkholy @.***> كتب:

في الأحد، ٢٠ مارس ٢٠٢٢ ٦:١٨ ص pixall @.***> كتب:

I have tried to use KPHP on Intel Xeon E5540 under Debian 10 and I found that packaged version is not working (crashing with Invalid instruction, SIGILL). I tried to compile from source and compilation compilation failed with "Invalid instruction" in early stage (unicode generation).

I have found that there are several optimalizations in the KPHP code for x86_64 architecture, but those optimalizations are done for sandybridge CPU (and newer). Unfortunately those optimalizations use instructions which are not available in my Xeon CPU and compiled binary is then unusable for me.

When I disabled all those optimalizations in the code and kept only unoptimized code, I was able to build and run KPHP successfully.

Pleae note that not every x86_64 machine is sandybridge (or newer) and hardcoded optimalizations make KPHP unusable for older x86_64 CPUs. I'd suggest to detect if CPU si sandybridge or newer, and if not, disable x86_64 optimalizations. Many thanks :)

— Reply to this email directly, view it on GitHub https://github.com/VKCOM/kphp/issues/476, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARRSHX72MELTG4HD46BI473VA2RIFANCNFSM5RE6GPKQ . You are receiving this because you are subscribed to this thread.

Message ID: @.***>

Ahmed-su-do avatar Mar 20 '22 22:03 Ahmed-su-do