Windows 10
wxPython 4.1.1
Python 3.9.4
When using wx.FileDialog to select image files in a directory, I am seeing the following set of messages appear in my console window:
Number of logical processors = 8
IppInit(): AVX NOT supported
pFeaturesMask = 3295
IppInit(): Number of IPP default threads = 1,
After some web searching, I’ve concluded these are probably related to an Intel software library component called “Integrated Performance Primitives” (Intel IPP). As best I can tell, this library takes advantage of special CPU instructions (if available) such as AVX, AVX2 etc. to provide advanced vector processing of image and media files. I have verified that my CPU (high-end circa 2012 workstation) does NOT support the AVX instruction.
In my application, the files I’m selecting are indeed image files, mostly JPEG and TIFF files. The messages get generated even before I click on any file(s) in the FileDialog window. If I just hover over a TIFF file, the messages appear in the console window. Once they appear, they don’t appear again during the same script execution. So far, I don’t believe I’ve seen this happen on JPEG files (but I’m still testing). With TIFF files, it seems this happens almost every time, but not always.
Here’s a very simple wxPython script using wx.FileDialog and a screen capture that illustrates what is happening:
import wx
class MyPanel(wx.Panel):
def __init__(self, parent):
super().__init__(parent)
# Button
self.getfilesID = wx.NewIdRef()
self.getfilesB = wx.Button(self, self.getfilesID, label = 'Get Files')
# Sizer
psizer = wx.BoxSizer(wx.VERTICAL)
psizer.AddSpacer(12)
psizer.Add(self.getfilesB, 0, wx.LEFT | wx.RIGHT, border = 12)
self.SetSizer(psizer)
self.Layout()
class MyFrame(wx.Frame):
def __init__(self, parent, title=""):
super().__init__(parent, title=title)
# Create panel
self.panel = MyPanel(self)
# Bind to button event
self.Bind(wx.EVT_BUTTON, self.onButton, self.panel.getfilesB)
def onButton(self, event):
if event.Id == self.panel.getfilesID:
# Open file dialog
with wx.FileDialog(self, 'Select files to process',
wildcard = 'All files (*.*)|*.*',
style=wx.FD_MULTIPLE | wx.FD_CHANGE_DIR) as fileDialog:
if fileDialog.ShowModal() == wx.ID_CANCEL:
# Context manager will destroy the dialog, no need to do it explicitly here
return
else:
pass
else:
event.Skip()
class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, title='WX Testing')
self.frame.Show()
return True
if __name__ == "__main__":
app = MyApp(False)
app.MainLoop()
The behavior suggests that somewhere in the chain of code in wx.FileDialog or wxWidgets or Windows itself there is use of Intel’s IPP library to “pre-process” image files, even when just hovering on the files…maybe to generate a thumbnail or something similar. In any case, I’m stumped on how to proceed to eliminate these spurious messages. The good news is that it does not seem to affect wx.FileDialog’s functionality as far as I can tell, and I’m guessing the messages are probably just informational. Nevertheless, I don’t think this should be happening.
Does wx use IPP directly? Does wxWidgets? Any clues on where this is coming from?
Thanks,
Dave