Skip to content

Configure OpenMP for Windows#1931

Open
illwieckz wants to merge 1 commit intofor-0.56.0/syncfrom
illwieckz/openmp-mingw
Open

Configure OpenMP for Windows#1931
illwieckz wants to merge 1 commit intofor-0.56.0/syncfrom
illwieckz/openmp-mingw

Conversation

@illwieckz
Copy link
Member

@illwieckz illwieckz commented Mar 15, 2026

Configure OpenMP for Windows

@illwieckz illwieckz changed the title Enable OpenMP on MinGW Enable OpenMP on MinGW by default Mar 15, 2026
@illwieckz illwieckz changed the title Enable OpenMP on MinGW by default Configure OpenMP for Windows Mar 17, 2026
@illwieckz illwieckz force-pushed the illwieckz/openmp-mingw branch from ba86fc3 to 733f83b Compare March 17, 2026 23:17
@illwieckz
Copy link
Member Author

I tested OpenMP with the MinGW build on a real Windows 10, and it worked. Actually, it was a 4-cores CPU and I could use all cores (while on Linux on the same machine, I have to use half cores…).

I notice that on Wine on Linux, on a 16-core/32-threads CPU, I would lose performance above 4 threads.

I have not tested yet a Windows machine with more than 4 cores, but at least we can confidently enable 4 OpenMP cores on MinGW.

@illwieckz illwieckz force-pushed the illwieckz/openmp-mingw branch from 733f83b to a6bfe60 Compare March 18, 2026 03:57
@illwieckz
Copy link
Member Author

illwieckz commented Mar 18, 2026

I wanted to test the MTT S80 on Windows, as running Dæmon on this GPU is known to benefit greatly from OpenMP, but unfortunately the motherboard the MTT S80 was plugged in did not enabled ReBAR for it and the Windows driver for the MTT-s80 requires ReBAR.

But I could test OpenMP running the engine on Windows using another GPU and temporarily disabling vbo models.

Copy link
Member

@slipher slipher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo comments

- 4 threads on high-end 16-cores/32-threads Ryzen Threadripper PRO 3955WX.

Performance regression has been observed above 4 threads on Wine on Linux. */
static constexpr int threadDivisor = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to remove static from each case of static constexpr.

#else
/* On Linux, using half threads than available is known to work best with:

- 2 threads on low-end 4-core (no SMP) Ryzen 3 3200G,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you meant 'hyperthreading' instead of SMP (which would refer to any multi-thread capability at all). Apparently AMD calls it SMT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants