GPU acceleration under WSL - Ubuntu 22.04 and 1.8.9-2/1597

rbotero

Well-known member
Following the excellent thread by Lblock: https://pixinsight.com/forum/index....ro-tools-eg-starxterminator-or-starnet.22163/ to get GPU acceleration under Linux, I had another go at getting not only PxI running under WSL but also GPU acceleration following his instructions.

I had tried this previously in 2022 and it worked but getting there was convoluted: https://pixinsight.com/forum/index....ning-well-in-wsl-cuda-next.17977/#post-110796. Ajay Narayanan made the instructions a lot simpler here: https://pixinsight.com/forum/index....cuda-and-libtensorflow-gpu-under-linux.18180/ for native Linux users but I didn't play much more with it as I got a newer, faster computer and PxI seemed fast enough under Win11.

I still wanted to test the new version of PxI (1.8.9-2 / Build 1597) in WSL to check if there was significant performance improvement versus Win11. After the steps below I got an improvement of around 25-30% in the benchmark score, with particular CPU out performance.

Before running the Linux specific steps set out in Lblock's tutorial, I ran the following commands prior to installing the NVDIA driver:
wsl --install -d Ubuntu-22.04​
  • Reboot your PC, create a password for the user chosen and exit WSL. Shutdown the engine (again from the command prompt):
wsl --shutdown​
followed by​
wsl --update​
A folder named Ubuntu-22.04 should be visible in File Explorer in your PC whenever WSL is running. You should be able to access the file structure of Linux using Explorer or any other file browser (see Nautilus below).

Before installing PxI, I loaded some Qt6 packages (just in case) and installed X11 apps to make sure everything was working, so from the command prompt:

Followed by the following in bash:
sudo apt-get install qt6-base && qt6-base-dev -y
sudo apt-get install x11-apps && nautilus -y

Then went back to Lblock's tutorial from this point onwards: https://pixinsight.com/forum/index....have booted into it, open the Ubuntu terminal I actually installed the latest driver available (545) which seemed to work fine.

Once PxI was installed, it became visible in the "Recent apps" section of Win11's start menu. I can now run it from there without having to start WSL from the command window (it triggers WSL automatically, as do any X11 apps installed).

There is no need to install KDE or any desktop environment as WSL handles their appearance under Windows.

I got confirmation of GPU acceleration for PxI processes through Task Manager under Windows. For some reason nvtop under WSL didn't run but I am sure WSL is benefiting from the GPU acceleration. See here: https://pixinsight.com/forum/index....-starxterminator-or-starnet.22163/post-144907

index.php


Roberto
 
I have PixInsight running under Kubuntu with GPU acceleration. I wanted to try it out under WSL in Windows 11. I was able to install it in my Windows partition ( I have dual boot laptop for Kubuntu and Windows 11 with the GRUB menu) and install GPU acceleration, but PixInsight will not start . The error log is:

PixInsight 1.8.9-2 - Critical Signal Backtrace
Received signal 11 (SIGSEGV)
Module: /opt/PixInsight/bin/PixInsight(+0x1a54f09) [0x55efe7556f09]
================================================================================
17: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7feb56a09520]
16: /usr/lib/wsl/lib/libd3d12core.so(+0x486b4c) [0x7feb4942cb4c]
15: /usr/lib/wsl/lib/libd3d12core.so(+0x486eb5) [0x7feb4942ceb5]
14: /usr/lib/wsl/lib/libd3d12core.so(+0x4871df) [0x7feb4942d1df]
13: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0xbd303a) [0x7feb4a2f703a]
12: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0xbfd383) [0x7feb4a321383]
11: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0xbb9d74) [0x7feb4a2ddd74]
10: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0x66c169) [0x7feb49d90169]
9: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0x169217) [0x7feb4988d217]
8: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0x29e7c2) [0x7feb499c27c2]
7: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0x18021b) [0x7feb498a421b]
6: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0xbbfd0) [0x7feb497dffd0]
5: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so(+0xbfa32) [0x7feb497e3a32]
4: /lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x34993) [0x7feb5106e993]
3: /lib/x86_64-linux-gnu/libGLX.so.0(+0x14492) [0x7feb555b0492]
2: /lib/x86_64-linux-gnu/libGLX.so.0(+0x1b1b0) [0x7feb555b71b0]
1: /opt/PixInsight/bin/lib/libQt6WebEngineCore.so.6(+0x48e8d96) [0x7feb5dc31d96]
================================================================================


PixInsight 1.8.9-2 - Critical Signal Backtrace
Received signal 11 (SIGSEGV)
Module: /opt/PixInsight/bin/PixInsight(+0x1a54f09) [0x55efe7556f09]
================================================================================
1: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7feb56a09520]
================================================================================
terminate called after throwing an instance of 'pcl::EUnixSegmentationViolation'
/opt/PixInsight/bin/PixInsight.sh: line 45: 653 Aborted /opt/PixInsight/bin/PixInsight

It seems a SIGSEGV signal 11 error is WSL stopping the program due to a memory access violation. The PixInsight Library (PCL) reports a EUnix Segmentation violation. I also posted this in the support forum. Any ideas?
 
PixInsight 1.8.9-2 - Critical Signal Backtrace
Received signal 11 (SIGSEGV)
Module: /opt/PixInsight/bin/PixInsight(+0x1a54f09) [0x55efe7556f09]
================================================================================
1: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7feb56a09520]
================================================================================
terminate called after throwing an instance of 'pcl::EUnixSegmentationViolation'
/opt/PixInsight/bin/PixInsight.sh: line 45: 653 Aborted /opt/PixInsight/bin/PixInsight

I am having the same issue since "upgrading" under WSL to the latest release. Same error message under signal 11.
 
I am having the same issue since "upgrading" under WSL to the latest release. Same error message under signal 11.
when you upgraded did you enter
sudo rm /opt/PixInsight/bin/lib/libtensorflow* before you restarted PixInsight? You need to do that to maintain GPU acceleration. It might affect the signal 11 error.
I haven't been able to resolve the issue with WSL so I am not using it. I am using PixInsight under Kubuntu.
 
Last edited:
So what you are saying is that you have to reconfigure PixInsight again as in your original description

The tensorflow libraries that come with PixInsight are in /opt/PixInsight/bin/lib folder
Move them to a temp folder so that PixInsight uses the new Tensorflow libraries that work with CUDA 11.8
sudo mkdir /opt/temp
cd /opt/PixInsight/bin/lib
sudo mv libtensorflow* /opt/temp
 
I just tested this. Once you install the new version of PixInsight using the bash prompt in the Ubuntu terminal all you have to do is enter this line before restarting PixInsight:
sudo rm /opt/PixInsight/bin/lib/libtensorflow*
You can then restart PixInsight and GPU acceleration will continue to work.

explanation:

This removes the tensorflow libraries (libtensorflow*) PixInsight creates which are located in the /opt/PixInsight/bin/lib. Once these files are removed PixInsight will continue to use the 2.14.0 tensorflow libraries located in /usr/local/lib. The ~/.bashrc file has already been configured and does not need to be edited again. What the above instructions you are referring to do is create a temp directory in /opt, and move the tensorflow libraries created by PixInsight to the /opt/temp directory. I got this information from another source, but I suppose all you really need to do is simply delete the tensorflow libraries from /opt/PixInsight/bin/lib. Perhaps the original source wanted to preserve those libtensorflow* files in case something went wrong. In that case you could move them back into /opt/PixInsight/bin/lib and PixInsight would continue to work (without GPU acceleration of course).
Also, any updates you do in PixInsight do not affect this. You only need to do this when you install a new version of PixInsight using the bash prompt.
 
Last edited:
PixInsight under WSL is significantly faster than my native Windows 11 installation. Swap and CPU scores are much higher, particularly swap which is rather strange as it all lives within the same SDD.
 
Back
Top