Author Topic: OS/4 (technical details only)  (Read 18800 times)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: OS/4 (technical details only)
« Reply #60 on: March 05, 2019, 02:48:38 am »
PS- I posted another graphic of the CPU cabilities (feature flags) above at reply #55.

Yes, it seems to be incomplete, only showing up to SSE2.
Hmm, looking at Intel's site, it does seem to support AVX, which is what I was wondering.

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #61 on: March 05, 2019, 03:00:24 am »
PS- I posted another graphic of the CPU cabilities (feature flags) above at reply #55.

Yes, it seems to be incomplete, only showing up to SSE2.
Hmm, looking at Intel's site, it does seem to support AVX, which is what I was wondering.

I can verify it  does support AVX.  Attached pic

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: OS/4 (technical details only)
« Reply #62 on: March 05, 2019, 04:18:49 am »
Thanks

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #63 on: March 05, 2019, 04:44:11 am »
Should I open a ArcaOS ticket concerning AVX?

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: OS/4 (technical details only)
« Reply #64 on: March 05, 2019, 06:21:22 am »
There's already one open about looking into the feasibility of adding AVX support to the IBM kernel, which you probably can't access. Not much there besides a description of the needed feature.
The problem is that during a context switch, the AVX registers need to be preserved. Those registers can be up to 512 bits wide. Think of what happens if two programs are using AVX when the OS switches between them. I doubt that we'll see AVX support in the official kernels anytime soon.
You may have hit on a bug in the OS4 kernel, at least OS4USER is aware of your crash.
Would still be interesting to know what function was crashing in libavcodec though I wouldn't be surprised if something just wasn't aligned correctly. Interesting that the AVX enabled Firefox didn't run for you as well. Did it generate a trp?
Exceptq could also use an update to correctly disassemble AVX opcodes. Luckily Lars can spot them.

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 43
  • Posts: 427
    • View Profile
Re: OS/4 (technical details only)
« Reply #65 on: March 05, 2019, 08:09:47 am »
Hi David, that crash looks like one I get now and again, I believe font related.
Have you tested with the Firefox build that OS4USER mentioned? Perhaps with the AVX enabled kernel? You can get a list of CPU capabilities with this program, http://hobbes.nmsu.edu/download/pub/os2/util/misc/cpuinfo.zip
If needed, I could build FFmpeg with AVX disabled. Be nice to know which function it is crashing in too.

If you sent me the MAP file for AVCODE65.DLL it would be a piece of cake to find the failing routine. We have the trap location ...

As I said, the "something" not aligned correctly seems to be a 32-byte (AVX) constant (read only) directly encoded in the code segment.
Where do I find the code for AVCODE65.DLL ?
I looked at:
https://github.com/FFmpeg/FFmpeg/tree/master/libavcodec
but there is no assembler code there, only plain "C" code. Which makes me wonder why we do not use plain "C" code and let GCC do all the gory stuff like data alignment (once GCC aligns SSE and AVX data the way it should ...). I would expect a good "C" compiler to automatically parallelize data accesses (and therefore making good use of the SIMD capabilities of the CPU). At least the Intel compiler does that ...


By the way: since the OS/2 kernel does not support AVX, wouldn't it be better to NOT build with AVX capability in general ?
I don't have AVX (only SSE) and therefore I am not affected but we can already see that with more modern systems that do support AVX or even AVX2 (with 512-bit registers), we now run into a whole lot of problems with AVX (data not properly aligned, no OS support for saving away AVX registers on a thread switch, with exception of OS/4 kernel).
Note: OS/2 does have support to save and restore SSE registers on a thread swith.

For me, OS/2 is falling more and more apart.


Lars
« Last Edit: March 05, 2019, 08:46:39 am by Lars »

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #66 on: March 05, 2019, 12:08:19 pm »
There's already one open about looking into the feasibility of adding AVX support to the IBM kernel, which you probably can't access. Not much there besides a description of the needed feature.
The problem is that during a context switch, the AVX registers need to be preserved. Those registers can be up to 512 bits wide. Think of what happens if two programs are using AVX when the OS switches between them. I doubt that we'll see AVX support in the official kernels anytime soon.
You may have hit on a bug in the OS4 kernel, at least OS4USER is aware of your crash.
Would still be interesting to know what function was crashing in libavcodec though I wouldn't be surprised if something just wasn't aligned correctly. Interesting that the AVX enabled Firefox didn't run for you as well. Did it generate a trp?
Exceptq could also use an update to correctly disassemble AVX opcodes. Luckily Lars can spot them.

Dave, I just tried the SandyBridge version with the lastest OS/4 kernel and FF works now.  Don't know why it did not start before.  Cannot test further since I am at work.

OS4User

  • Full Member
  • ***
  • Thank You
  • -Given: 28
  • -Receive: 6
  • Posts: 216
    • View Profile
Re: OS/4 (technical details only)
« Reply #67 on: March 05, 2019, 04:45:39 pm »
I just tried the SandyBridge version with the lastest OS/4 kernel and FF works now

try this http://hobbes.nmsu.edu/download/pub/incoming/freerdp-wpi-20190301.zip
it also requires AVX

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: OS/4 (technical details only)
« Reply #68 on: March 05, 2019, 06:09:11 pm »
Hi David, that crash looks like one I get now and again, I believe font related.
Have you tested with the Firefox build that OS4USER mentioned? Perhaps with the AVX enabled kernel? You can get a list of CPU capabilities with this program, http://hobbes.nmsu.edu/download/pub/os2/util/misc/cpuinfo.zip
If needed, I could build FFmpeg with AVX disabled. Be nice to know which function it is crashing in too.

If you sent me the MAP file for AVCODE65.DLL it would be a piece of cake to find the failing routine. We have the trap location ...

I don't have the map files for the Netlabs build of FFmpeg. I can build one after work if David is interested in testing.

Quote
As I said, the "something" not aligned correctly seems to be a 32-byte (AVX) constant (read only) directly encoded in the code segment.
Where do I find the code for AVCODE65.DLL ?
I looked at:
https://github.com/FFmpeg/FFmpeg/tree/master/libavcodec
but there is no assembler code there, only plain "C" code. Which makes me wonder why we do not use plain "C" code and let GCC do all the gory stuff like data alignment (once GCC aligns SSE and AVX data the way it should ...). I would expect a good "C" compiler to automatically parallelize data accesses (and therefore making good use of the SIMD capabilities of the CPU). At least the Intel compiler does that ...

Start here for the assembler code, https://git.ffmpeg.org/gitweb/ffmpeg.git/tree/HEAD:/libavcodec/x86 there's also some in libavutil.
As for using plain C, building FFmpeg with --disable-assembler results in code that is so slow it is unusable. GCC is quite crappy at optimizing compared to hand written assembly by experts.
Also need assembler to dynamically optimize based on CPU, which simd instructions it supports, how many registers are available, even things like whether using CMOV is a good idea or if it is a really slow implementation.
GCC is still calling the assembly functions so I guess that is where alignment comes in.

Quote
By the way: since the OS/2 kernel does not support AVX, wouldn't it be better to NOT build with AVX capability in general ?
I don't have AVX (only SSE) and therefore I am not affected but we can already see that with more modern systems that do support AVX or even AVX2 (with 512-bit registers), we now run into a whole lot of problems with AVX (data not properly aligned, no OS support for saving away AVX registers on a thread switch, with exception of OS/4 kernel).
Note: OS/2 does have support to save and restore SSE registers on a thread swith.

Lots of code uses AVX assembler and dynamically loads it if the OS and CPU support it. Firefox's JIT, libvpx, libx264, even flac just of the top of my head. Most I don't have control over.
It does seem to help using a newer GCC. Hopefully when Bitwise moves to GCC 8 (soon), things will improve.
Quote
For me, OS/2 is falling more and more apart.


Lars
:)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: OS/4 (technical details only)
« Reply #69 on: March 05, 2019, 06:12:39 pm »
Dave, I just tried the SandyBridge version with the lastest OS/4 kernel and FF works now.  Don't know why it did not start before.  Cannot test further since I am at work.

I take it you are using the AVX enabled build of the OS4 kernel. Is that bad web page now working for you with avcod56 and the Sandybridge Firefox?
If not I can build some test builds of FFmpeg this evening.

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #70 on: March 05, 2019, 06:43:32 pm »
Dave, I won't know until I get home from work to test it and yes it is the AVX enabled OS/4 latest kernel.

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #71 on: March 05, 2019, 11:51:09 pm »
Dave, I just tried the SandyBridge version with the lastest OS/4 kernel and FF works now.  Don't know why it did not start before.  Cannot test further since I am at work.

I take it you are using the AVX enabled build of the OS4 kernel. Is that bad web page now working for you with avcod56 and the Sandybridge Firefox?
If not I can build some test builds of FFmpeg this evening.

That SandyBridge version with the latest AVX OS/4 kernel is working fine.   That bad web page is working fine.  Everything loads fine.  No crashes.  This may be the best so far.  Only time will tell.

I spoke too soon.  It appears to crash every time I go to youtube videos and it tries to load a video.  Attached are the trap messages.  ffturbo does not work with this version. It won't start.
« Last Edit: March 06, 2019, 12:39:21 am by David Graser »

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #72 on: March 06, 2019, 12:00:22 am »
I just tried the SandyBridge version with the lastest OS/4 kernel and FF works now

try this http://hobbes.nmsu.edu/download/pub/incoming/freerdp-wpi-20190301.zip
it also requires AVX

OS2user, I am not that savvy with programs like this.  I installed it, but don't know how to set it up or what I would use it for.
« Last Edit: March 06, 2019, 12:09:13 am by David Graser »

Dariusz Piatkowski

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 10
  • Posts: 602
    • View Profile
Re: OS/4 (technical details only)
« Reply #73 on: March 06, 2019, 12:29:44 am »
David,

OS2user, I am not that savvy with programs like this.  I installed it, but don't know how to set it up or what I would use it for.

That is a RDP (Remote DeskTop) client, which allows you to connect to a remote Desktop / PC somewhere over the network. Typically that might be a WINx machine that you need to connect to in order to do some action/work on that remote box.

I am using this client on my LAN to ease the maintenance of all the PCs in the house. I occasionally use the remote WINx boxes to do stuff that my local OS/2 box does not allow me to do (lack of apps with specific support, etc.).

Do you have a WINx box on your LAN/network that you could try connecting to?

David Graser

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 515
    • View Profile
Re: OS/4 (technical details only)
« Reply #74 on: March 06, 2019, 12:37:53 am »
David,

OS2user, I am not that savvy with programs like this.  I installed it, but don't know how to set it up or what I would use it for.

Do you have a WINx box on your LAN/network that you could try connecting to?

Hi Dariusz

I have no network set up.  I essentially use just one machine.