[Wine] How to run KITModelViewer and IFCCheckingTool on Linux?
KITModelViewer and IFCCheckingTool are both Freeware from the Karlsruhe Institute of Technology
Institute for Automation and Applied Informatics (Germany). Unfortunately, these two tools are only available for Windows. KITModelViewer is a versatile application that can view different files, for example IFC with supporting CRS! And IFCCheckingTool can check the IFC File locally.
Here is the download link: KIT - IAI - Downloads
I have therefore downloaded the flatpak bottles to my Linux system and created a Wine environment there.
The application has the following dependencies:
- VisualStudio 2022 (Plattform Toolset 14.3)
- dotnet 4.8 (installed with Bottles)
After completing the installation of the aforementioned dependencies, I was able to execute the KITModelViewer:
Nonetheless, upon clicking within the window, error messages are displayed both in the graphical user interface and in the terminal, resulting in a crash.
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -r" (2).
00c8:err:xrandr:xrandr14_get_adapters Failed to get adapters
0114:err:ole:CoGetContextToken apartment not initialised
0024:err:oledb:get_data_source provider L"Microsoft.ACE.OLEDB.16.0" not registered
0024:err:ole:marshal_object Failed to create an IRpcStubBuffer from IPSFactory for {6d5140c1-7436-11ce-8034-00aa006009fa} with error 0x80004002
0024:err:ole:marshal_object Failed to create an IRpcStubBuffer from IPSFactory for {6d5140c1-7436-11ce-8034-00aa006009fa} with error 0x80004002
0024:err:ole:marshal_object Failed to create an IRpcStubBuffer from IPSFactory for {6d5140c1-7436-11ce-8034-00aa006009fa} with error 0x80004002
I contacted the developer at KIT. But they couldn’t find a solution, so I’m writing here. I also wrote a post last week in the forum from bottles, however no response until yet.
Comments
xrandr:xrandr14_get_adapters Failed to get adapters
suggests some GL/EGL/GPU issues. Do you have an nvidia card? What are your drivers version (and what distro are you using - it looks like Ubuntu)?Maybe try wine without bottles? I haven't heard about neither of these programs, but I got Rhino 7 to run (which uses dotnet48) with winetricks:
winetricks -q dotnet48
you may also find useful some of these packages useful:
winetricks -q corefonts pptfonts vcrun2005 vcrun2010 vcrun2013 vcrun2019 vcrun6 vcrun6sp6 gdiplus dxvk
as well as:
winetricks renderer=gdi
Often the installer provides a lot of these libraries (which are usually more compatible than the ones wine provides).
If this doesn't work maybe try older versions? Rhino 7 works fine for example, but every Rhino 8 version release after January this year doesn't work.
Wine isn't guaranteed to work for "business applications" in my experience. Games seem to be much more supported these days (thanks to Valve). If Wine doesn't work consider using a Windows virtual machine (via KVM/virt-manager) instead? It can be complicated to setup (especially on a laptop), but is guaranteed to work.
Thanks for the swift response!
Presently, I am using MX Linux 23 (Debian 12) on my laptop and yes, I got an nvidia card. Installed driver for nvidia: NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0
I used bottles since it's running from the get go in a sandboxed area. I don't have experience with winetricks. I will research a bit.
Both Freeware doesn't have an “installer”. Theses are just two zip files with the EXE and the DLL.
Could you run
ls -lah /dev/dri/
to confirm that nvidia correctly creates a render/display node? It may be also worth checking that nvidia driver is using the card:lspci -nnk -d 10de:
(look forKernel driver in use:
lines).On Debian I'm not sure how to get other packages for wine like wine-mono, wine-gecko, vkd3d or dxvk, which seemed to have made my experience with Rhino 7 smoother. I believe that they are needed to be installed by the host, but the wiki says that some of them may not be available.
It was a good idea to start with bottles (I did so too, as well as Lutris), because if it works it's easier to configure it. If it doesn't work however then wine is your second best choice.
If the program doesn't have an installer you would need to provide it with the necessary packages manually. Just running
wine path/to/executable.exe
will create a "virtual windows filesystem" in your home called ~/.wine. It will create bare bones environment with basic registry keys, dos devices, and simple C: drive folder structure. By default it's only 200-300MB or so. You can add other components with winetricks. On Debian I hope that you can justsudo apt install winetricks
(if not winehq wiki may have a solution) .I assume that you don't even need to run
wine path/to/executable.exe
and just run the above commands (e.g.winetricks -q dotnet48
) and it will create~/.wine
for you.Tips:
kill -9 $(ps aux |grep -i '\.exe' |awk '{print $2}'|tr '\n' ' ')
(it kills all processes that end with .exe) and remove the .wine folder (rm -rf ~/.wine
).winetricks list-all
to take my test with wine, and also be reproducible, I installed gnome boxes with flatpak and installed Debian there with the express installation
and create a bash script with all my steps
These steps require sudo and the repo contrib must be enabled
These steps do not require sudo:
The last step starts the program, but when I open IFC files, I don't see any geometry in the 3D view
Tes Ifc File: https://github.com/buildingSMART/IFC4.3.x-sample-models/blob/main/models/basic-geometric-shape/csg-primitive/csg-primitive.ifc
hmm, I wouldn't recommend that. If the issue is with graphics Gnome boxes most likely won't pass your GPU through and will use some "paravirtualized" graphics adapter (QML/virtio-gpu), so the results may be different than running it directly on your host...
and these "paravirtual GPUs" often don't have all GL capabilities, so this might the reason why 3D view doesn't work
could you post (via pastebin.com for example) logs from that wine command?
It's true though that installing extra packages, PPAs for wine may make your system a little bit messy. I don't suppose that you have zfs (or btrfs) installed to "roll it back"?
oh, I edited my previous post to add the logs from wine
thanks, this indicates an issue:
what's the output of
glxinfo | grep "OpenGL version string"
(in your virtual machine).First:
So I did:
apt-get install mesa-utils -y
And after that:
Is that in the virtual machine? It's quite good actually (it's
4.6 Mesa 23.2.1
here), but sorry I would still recommend trying on the host directly without a Gnome Box.Yes
You can also try changing the renderer:
winetricks renderer=vulkan
I thought it was some problem with the Debian packages of wine, so I installed wine through the winehq repo, like described at this website https://wiki.winehq.org/Debian:
And i installed a wine env with the following bash script:
And now i got errors of missing DLL :(
This may be a really dumb question, but are you sure that you have winetricks installed? It seems to belong to "contrib" packages that you also need to add in the
/etc/apt/sources.list
.Yes, see previous comment:
And here the output from cat:
And winetricks version:
And wine version:
I think there is some problem with the WINEPREFIX usage in the bash script, and I did change it to use absolute path:
However, the problem remains. Instead of only creating stuff in the folder /home/test/Wine/KIT, some process also created /home/test/.wine folder.
Edit: I forgot to add in the last line also the WINEPREFIX...
This is how I installed it this time:
And run the application:
You can see the Gizamo in the 3D view, but not yet the object. It is still in the virtual system.
nice, I haven't spotted that last missing WINEPREFIX. Maybe try adding extra debug channels for Direct3D and the windowing system to expand on these Shader errors?
WINEDEBUG=+wgl,+d3d
to theWINEPREFIX=$HOME/Wine/$FOLDER wine $APP.exe
. This may give (much) more information (the relevant parts most likely will be at the end). I'm afraid though that it'd still may turn out to be necessary to run it without virtualization (or with a GPU passthrough). If you just want to sandbox it you can always use firejail.Here is the log, it is now quite long, so i did stub it:
I heard of apparmor and firejail, but did not use it and therefore have no experience. I will try later on wine on my host machine, if there is no solution with the virtual machine variant.
hmm, so it uses CPU instead of GPU (llvmpipe), that explains why OpenGL is as high 4.5. I've never run wine this way, but maybe you can try to add
LIBGL_ALWAYS_SOFTWARE=1
to the wine command (Archwiki)? It's just a wild guess, even if it works expect much higher CPU usage (which may be okay if you won't use it frequently). If you go with running it on the host I recommend installing firejail (sandbox) and opensnitchd (outbound connections firewall) when running untrusted applications. Firejail can be complicated, but opensnitch is very easy to use (and comes in handy also with gnome boxes).Oh, that explains why the CPU usage was that high. If I use wine on my host, can KITModelViewer use the GPU to render?
Yeah, on host it will use a hardware GPU (Nvidia card by default on my laptop at least). Llvmpipe is used in Gnome Box most likely to provide full OpenGL capabilities, but some operations (like shader compilation) maybe aren't supported.
I did now install wine on my host machine. This I did with the package installer from MX Linux:

This installed the following package:
I also installed winetricks and did the following:
Now i started the programm with nvidia card:
WINEPREFIX=/home/USER/Wine/KIT nvidia-run-mx wine KITModelViewer.exe
and it use the nvida card for the rendering of the 3d view:
When I open a model now, the upper half of the 3D view flickers. I don't know what the problem is.
Oh so Boxes do provide GPU passthrough now. Cool.
Nice, on Arch they are separate packages and I didn't know that there is such a "package group" on MX Linux. As you probably already know
gecko
is a web rendering engine and can be used to support internet explorer and many other windows programs,mono
allows you to run .NET (C#) programs on Linux (and Mac). They are useful, because wine can use them as its "backend" to run windows applications. It can also use native windows DLLs, which application installer often ship, but AFAIK "linux native" versions are recommended.wine-staging
often has more recent fixes than wine-stable.What if you tried now changing renderer to vulkan?
WINEPREFIX=/home/USER/Wine/KIT winetricks renderer=vulkan
?I also experienced some flickering and other visual artifacts on nvidia, but sadly never quite got to solving them. If you can downgrade packages on MX Linux maybe try different combinations of previous versions of wine-stable/wine-staging, wine-dxvk and nvidia drivers? If you do, make sure to close all wine processes (e.g.
kill -9 $(ps aux |grep -i '\.exe' |awk '{print $2}'|tr '\n' ' ')
) and if changing nvidia drivers reboot the VM.Congratulations on the progress though! Others would definitely find it useful as well.
No, I am using now Wine (Staging) native on my optimus laptop. This time, no boxes and no bottles. I got an intel GPU and an nvidia dGPU and the command nvidia-run-mx is a wrapper from MX Linux for the environmental variable that needed to set, if one wants to start the program with NVIDIA support.
Still the same behaviour, the bottom half has no problem, only the upper half. Perplexing. I also switched from X11 (KDE) to Wayland (KDE) Session, no change.
There is the possibitly to download the wine version package by debian stable instead from MX Linux:

And when i start the programm, there is nothing in the 3D Vew:

So wine version 8.0 is not the way.
There is a way to install newer stuff from the MX Linux Test Repo

Now i got:
There is the cube like in the version 8.12 in the 3D View.
But the issue of flickering is not solved. Do I need to delete my old WINEPREFIX and install it new, since my WINEPREFIX was installed with the older version of wine (Version 8.12)? Would there be any difference?
Oops sorry, I read "now" as "not"...
Thanks, that's interesting, there used to be a
prime-run
command wrapper in some nvidia-utils packages, which added environmental variables that I've modified into:to offload rendering to the Nvidia card (I'm also on an Optimus laptop - 81YT Lenovo Legion 7 15IMH05 ). The first variable is the pci number of your nvidia card (which you can get with the
lspci -nnk -d 10de:
command for example). You may want to try and add the first two variables along the ones you already have and maybe that would help with the flickering.Have you considered running it on Intel's iGPU? Although it's slower it may be more stable.
Could you share the output from your wine command now? Specifically does it print anything when you orbit the viewport (when it flickers)? If not, how about adding either one of the
WINEDEBUG=+wgl,+d3d
again?I would recommend testing first on X11 - Wayland's support for wine and nvidia prime is still under development.
If you do try later running it on Wayland try something else than KDE - I've never managed to run wine on KDE Wayland with Nvidia prime render offload. It did work out-of-the-box though on wlroots-based compositors. It worked on Hyprland at least (without nvidia's patch). KDE6 is coming out soon and they were developing wlroots-backend as well, so it may change.
Hmm, I was thinking of switching to something closer to wine-staging 8.20, like 8.19 or even the latest 8.21 (if available). You could also consider compiling from source, but that can get much much more tricky for uncertain benefit, especially if you say that...
In terms of:
I'm not 100% sure, so I would recommend starting from scratch. You definitely shouldn't have
wineserver
running from different version than the one starting the application (that's why it's good to runkill -9 $(ps aux |grep -i '\.exe' |awk '{print $2}'|tr '\n' ' ')
after each test), but obviously I've been hopping from version to version for the past few months (from wine 8.14 to 8.21) on the same prefix and it's been running fine (once initially configured).