Advanced search

Message boards : Wish list : Make Quantum Chemistry working on WSL

Author Message
makracz
Send message
Joined: 9 May 24
Posts: 3
Credit: 2,575,362,888
RAC: 22,692,109
Level
Phe
Scientific publications
wat
Message 61916 - Posted: 27 Oct 2024 | 16:35:29 UTC
Last modified: 27 Oct 2024 | 16:47:38 UTC

Over the weekend I've been playing around with Windows WSL (Windows Subsystem for Linux) using Ubuntu 24.04. I managed to get BOINC running and detect NVIDIA GPU. Einstein's GPU tasks (BRP7) ran without any problems and were validated successfully. Unfortunately, Quantum Chemistry tasks fail to compute under those conditions. They threw an error in less than a minute.
My questions are:
- is there a way to run the current QC application on WSL?
- have the developers ever tried to run QC in this environment? Do you think it would be possible to update the QC app to make it run on WSL?

From a user’s perspective setting up the WSL and BOINC installation isn't very challenging. As the QC isn't portable to Windows, this could potentially allow for more hosts to crunch QC tasks.

Erich56
Send message
Joined: 1 Jan 15
Posts: 1139
Credit: 10,830,818,340
RAC: 23,666,077
Level
Trp
Scientific publications
watwatwatwatwatwatwatwatwat
Message 61917 - Posted: 27 Oct 2024 | 17:12:13 UTC

my suggestion is: instead of going the WLS detour, QC should be made available for Windows.

Keith Myers
Send message
Joined: 13 Dec 17
Posts: 1354
Credit: 7,875,512,546
RAC: 7,898,770
Level
Tyr
Scientific publications
watwatwatwatwat
Message 61918 - Posted: 27 Oct 2024 | 18:34:49 UTC - in response to Message 61917.
Last modified: 27 Oct 2024 | 18:42:43 UTC

Been explained elsewhere here multiple times. The science app uses external libraries that DON'T HAVE ANY Windows compiled libraries, only Linux ones.

https://www.gpugrid.net/forum_thread.php?id=5429&nowrap=true#61245

So unless the application is completely rewritten to use some other sources that have Windows libraries, this app is never going to be available for Windows hosts.

Ian&Steve C.
Avatar
Send message
Joined: 21 Feb 20
Posts: 1077
Credit: 40,231,533,983
RAC: 40
Level
Trp
Scientific publications
wat
Message 61919 - Posted: 27 Oct 2024 | 22:36:23 UTC - in response to Message 61917.

my suggestion is: instead of going the WLS detour, QC should be made available for Windows.


its kind of out of the control of the GPUGrid devs. one piece of required software for the app is not available to Windows. the devs do not maintain this 3rd party software so they cannot just make it work.

they did release a code bounty for anyone capable to port it to Windows. they WANT to have the app available for Windows, but they do not have the ability.

https://github.com/gpugrid/gpugrid/issues/1

the fact that QC doesnt work under WSL is likely a limitation of the Windows nvidia driver. there are some features that only work on the linux driver, and WSL actually uses the Windows driver shared from the Windows environment and not the full Linux driver.
____________

makracz
Send message
Joined: 9 May 24
Posts: 3
Credit: 2,575,362,888
RAC: 22,692,109
Level
Phe
Scientific publications
wat
Message 61920 - Posted: 27 Oct 2024 | 22:49:15 UTC
Last modified: 27 Oct 2024 | 23:01:43 UTC

Thanks Keith for pointing to the relevant topic. When I did search for "WSL" I wasn't aware that a regular search on this forum is limited to posts that are no older than 30 days. Should have clicked on the advanced one, my bad.

It seems that although in theory a Linux Distro on WSL should run any Linux native library, there are some problems in this particular case.

the fact that QC doesnt work under WSL is likely a limitation of the Windows nvidia driver. there are some features that only work on the linux driver, and WSL actually uses the Windows driver shared from the Windows environment and not the full Linux driver.

Let's hope that something will change in the future on the WSL/NVIDIA driver end.

[BAT] Svennemans
Send message
Joined: 27 May 21
Posts: 53
Credit: 896,876,000
RAC: 1,519,753
Level
Glu
Scientific publications
wat
Message 61921 - Posted: 28 Oct 2024 | 12:16:24 UTC - in response to Message 61920.
Last modified: 28 Oct 2024 | 12:18:34 UTC

Thanks Keith for pointing to the relevant topic. When I did search for "WSL" I wasn't aware that a regular search on this forum is limited to posts that are no older than 30 days. Should have clicked on the advanced one, my bad.

It seems that although in theory a Linux Distro on WSL should run any Linux native library, there are some problems in this particular case.

the fact that QC doesnt work under WSL is likely a limitation of the Windows nvidia driver. there are some features that only work on the linux driver, and WSL actually uses the Windows driver shared from the Windows environment and not the full Linux driver.

Let's hope that something will change in the future on the WSL/NVIDIA driver end.


WSL runs native Linux apps 'in theory', yes, and for the most part you would be correct. For example, the ATM Linux app runs flawlessly on WSL.
However, WSL is translating native linux systemcalls into Windows systemcalls - unlike a VM which runs as if it were a baremetal linux install - and therein lies the difference between 'in theory' and 'in practice'.
The more deeply an app leverages very specific features of Linux in order to squeeze the last drop of performance from the OS, the more you risk running into cases where a linux syscall doesn't have a 100% windows-supported implementation.
Speaking from experience, in trying to get the QC 3rd-party libraries compiled for windows, I can assure you that these math libraries scrape the absolute bottom of the barrel of what linux can do. As well as leveraging just about every trick in the C99 standard that is not supported by Visual C++.
So that is why they are not supported by WSL, and that is why they're not easily crosscompiled for windows.

Else I would have cashed in that bounty long ago - believe my I tried ;-)

Ian&Steve C.
Avatar
Send message
Joined: 21 Feb 20
Posts: 1077
Credit: 40,231,533,983
RAC: 40
Level
Trp
Scientific publications
wat
Message 61922 - Posted: 28 Oct 2024 | 13:32:07 UTC - in response to Message 61921.

Thanks Keith for pointing to the relevant topic. When I did search for "WSL" I wasn't aware that a regular search on this forum is limited to posts that are no older than 30 days. Should have clicked on the advanced one, my bad.

It seems that although in theory a Linux Distro on WSL should run any Linux native library, there are some problems in this particular case.

the fact that QC doesnt work under WSL is likely a limitation of the Windows nvidia driver. there are some features that only work on the linux driver, and WSL actually uses the Windows driver shared from the Windows environment and not the full Linux driver.

Let's hope that something will change in the future on the WSL/NVIDIA driver end.


WSL runs native Linux apps 'in theory', yes, and for the most part you would be correct. For example, the ATM Linux app runs flawlessly on WSL.
However, WSL is translating native linux systemcalls into Windows systemcalls - unlike a VM which runs as if it were a baremetal linux install - and therein lies the difference between 'in theory' and 'in practice'.
The more deeply an app leverages very specific features of Linux in order to squeeze the last drop of performance from the OS, the more you risk running into cases where a linux syscall doesn't have a 100% windows-supported implementation.
Speaking from experience, in trying to get the QC 3rd-party libraries compiled for windows, I can assure you that these math libraries scrape the absolute bottom of the barrel of what linux can do. As well as leveraging just about every trick in the C99 standard that is not supported by Visual C++.
So that is why they are not supported by WSL, and that is why they're not easily crosscompiled for windows.

Else I would have cashed in that bounty long ago - believe my I tried ;-)


great reply, thanks for the added context/info. I was wondering if you had ever tried to port things!

____________

[VENETO] boboviz
Send message
Joined: 10 Sep 10
Posts: 160
Credit: 388,132
RAC: 0
Level

Scientific publications
wat
Message 62002 - Posted: 5 Dec 2024 | 15:06:17 UTC - in response to Message 61922.

Boinc are implementing Docker for Windows (with access to gpu)

Ian&Steve C.
Avatar
Send message
Joined: 21 Feb 20
Posts: 1077
Credit: 40,231,533,983
RAC: 40
Level
Trp
Scientific publications
wat
Message 62004 - Posted: 5 Dec 2024 | 15:20:20 UTC - in response to Message 62002.

Boinc are implementing Docker for Windows (with access to gpu)


wont matter. Docker for Windows still uses WSL as the backend and the same limitations apply. It wont change the situation with Quantum Chem apps.
____________

[BAT] Svennemans
Send message
Joined: 27 May 21
Posts: 53
Credit: 896,876,000
RAC: 1,519,753
Level
Glu
Scientific publications
wat
Message 62007 - Posted: 6 Dec 2024 | 10:58:54 UTC - in response to Message 62004.

Boinc are implementing Docker for Windows (with access to gpu)


wont matter. Docker for Windows still uses WSL as the backend and the same limitations apply. It wont change the situation with Quantum Chem apps.


Are you sure about that? VM's can go bare-metal, at least in principle. Did you read this somewhere?

Ian&Steve C.
Avatar
Send message
Joined: 21 Feb 20
Posts: 1077
Credit: 40,231,533,983
RAC: 40
Level
Trp
Scientific publications
wat
Message 62008 - Posted: 6 Dec 2024 | 13:15:29 UTC - in response to Message 62007.
Last modified: 6 Dec 2024 | 13:23:24 UTC

Boinc are implementing Docker for Windows (with access to gpu)


wont matter. Docker for Windows still uses WSL as the backend and the same limitations apply. It wont change the situation with Quantum Chem apps.


Are you sure about that? VM's can go bare-metal, at least in principle. Did you read this somewhere?


I don't know exactly what you mean by "VMs can go bare-metal". that sounds contradictory to me since a VM is inherently NOT bare-metal.

Docker uses the base OS/kernel to run on and does not provide a complete environment within the docker itself. So for a Linux docker, you need a Linux OS to run on. On windows, you do this with WSL, there's not really a way around that.

if you have a Windows-based docker, you can run that directly on your base Windows OS.

when i said that the docker setup in BOINC wont matter, I meant in regards to Quantum Chemistry working. you found the issues trying to run QC in WSL due to the supported features in the Windows Nvidia GPU driver. I can't see how that will be any different when using Docker, since the container is still running on WSL.

https://docs.docker.com/desktop/features/gpu/
Currently GPU support in Docker Desktop is only available on Windows with the WSL2 backend.

____________

[BAT] Svennemans
Send message
Joined: 27 May 21
Posts: 53
Credit: 896,876,000
RAC: 1,519,753
Level
Glu
Scientific publications
wat
Message 62009 - Posted: 6 Dec 2024 | 21:48:35 UTC - in response to Message 62008.


I don't know exactly what you mean by "VMs can go bare-metal". that sounds contradictory to me since a VM is inherently NOT bare-metal.

Docker uses the base OS/kernel to run on and does not provide a complete environment within the docker itself. So for a Linux docker, you need a Linux OS to run on. On windows, you do this with WSL, there's not really a way around that.

if you have a Windows-based docker, you can run that directly on your base Windows OS.

when i said that the docker setup in BOINC wont matter, I meant in regards to Quantum Chemistry working. you found the issues trying to run QC in WSL due to the supported features in the Windows Nvidia GPU driver. I can't see how that will be any different when using Docker, since the container is still running on WSL.

https://docs.docker.com/desktop/features/gpu/
Currently GPU support in Docker Desktop is only available on Windows with the WSL2 backend.


I meant that a proper VM can connect directly to the underlying hardware without going through a host OS. VMWare for example doesn't need WSL to run a Linux VM.

I'm not so familiar with Docker, so wasn't aware that this does use the host OS.

So if that is the case, then you're right, it likely won't help.

Post to thread

Message boards : Wish list : Make Quantum Chemistry working on WSL

//