Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2021-11-26 14:32:05

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Salome Meca 2021 on WSL2

We have noticed a lot of deception from the community relating to the configuration and run of salome_meca 2021 LGPL based on the singularity (.sif) container.

For that reason, we have prepared the following WSL2 distro (based on OpenSUSE) and which contains the prerequisites for launching any salome meca container file.

To download the WSL2 distro:

code-aster.org/FICHIERS/wsl/smeca-lgpl-wsl2-opensuse.tar

To install the distro in windows WSL2 :

wsl --import SalomeMeca2021 <install_path> <path_to_downloaded_tar>

For example

wsl --import SalomeMeca2021 C:\Data  C:\Downloads\smeca-lgpl-wsl2-opensuse.tar

To run (after install)

wsl --distribution SalomeMeca2021 --user user

Login details in the WSL2 linux system:

username : user
pwd: password

To be able to launch salome_meca_2021, first download the singularity .sif file and then run

salome_meca

in the same folder as the sif file (salome_meca-lgpl-2021.0.0-0-20210601-scibian-9.sif).


Other information
----------------------

To turn off WSL distros

wsl --shutdown

To unregister the SalomeMeca2021 distro from WSL2

wsl --unregister SalomeMeca2021


Let us know how it works for you.

Best regards

HB from the salome_meca EDF Team

Last edited by hberro (2021-12-11 08:06:37)

Offline

#2 2021-11-26 18:50:36

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

Dear HB,

thanks for you work.
I download correctly you package, but when I run:


wsl --install SalomeMeca2021 C:\  C:\Downloads\smeca-lgpl-wsl2-opensuse.tar

I give this message (of course my zip file reference folder is different).


PS C:\Windows\system32> wsl --install --SalomeMeca2021 C:\ C:\Users\Calcolo\Downloads\smeca-lgpl-wsl2-opensuse.tar
--install: unrecognized option: SalomeMeca2021
Copyright (c) Microsoft Corporation. Tutti i diritti sono riservati.

Sintassi: wsl.exe [Argument] [Options...] [CommandLine]

Argomenti per l’esecuzione di file binari di Linux:

    Se non viene specificata alcuna riga di comando, wsl.exe avvia la shell predefinita.

    --exec, -e <CommandLine>
        Esegue il comando specificato senza usare la shell di Linux predefinita.

    --
        Passa la riga di comando rimanente così com’è.

Opzioni:
    --distribution, -d <Distro>
        Esegue la distribuzione specificata.

    --user, -u <UserName>
        Esegue come l’utente specificato.

Argomenti per la gestione del sottosistema Windows per Linux:

    --help
        Visualizza informazioni sull’utilizzo.

    --install [Opzioni]
        Installa ulteriori distribuzioni del sottosistema di Windows per Linux.
        Per una lista di distribuzioni valide, usa 'wsl --list --online'.

        Opzioni:
            --distribution, -d [Argomento]
                Scarica e installa una distribuzione per nome.

                Argomenti:
                    Un valido identificatore di distribuzione (senza distinzione tra maiuscole e minuscole).

                Esempi:
                    wsl --install -d Ubuntu
                    wsl --install --distribution Debian

    --set-default-version <Versione>
        Modifica la versione di installazione predefinita per le nuove distribuzioni.

    --shutdown
       Termina immediatamente tutte le distribuzioni in esecuzione e della macchina virtuale leggera
        WSL 2.

    --status
        Mostra lo stato del sottosistema Windows per Linux.

    --update [Opzioni]
        Se non vengono specificate opzioni, il kernel WSL 2 verrà aggiornato
        all'ultima versione.

        Opzioni:
            --rollback
                Ripristina la versione precedente del kernel WSL 2.

Argomenti per la gestione delle distribuzioni nel sottosistema Windows per Linux:

    --export <Distro> <Nomefile>
        Esporta la distribuzione in un file tar.
        Il nome del file può essere - per l'output standard.

    --import <Distro> <PercorsoInstallazione> <Nomefile> [Opzioni]
        Importa il file tar specificato come una nuova distribuzione.
        Il nome del file può essere - per l'input standard.

        Opzioni:
            --version <Versione>
                Specifica la versione da utilizzare per la nuova distribuzione.

    --list, -l [Options]
        Elenchi di distribuzioni.

        Opzioni:
            --all
                Elenco di tutte le distribuzioni, incluse quelle
                attualmente installate o disinstallate.

            --running
                Solo gli elenchi di distribuzioni che sono in esecuzione.

            --quiet, -q
                Mostra solo i nomi delle distribuzioni.

            --verbose, -v
                Mostra informazioni dettagliate su tutte le distribuzioni.

            --online,-o
                Visualizza un elenco di distribuzioni disponibili per l'installazione con 'wsl--install'.

    --set-default,-s <Distro>
        Imposta la distribuzione come predefinita.

    --set-version <Distro><Version>
        Modifica la versione della distribuzione specificata.

    --terminate, -t <Distro>
         Termina la distribuzione specificata.

    --unregister <Distro>
       Annulla la registrazione della distribuzione ed elimina il file system radice.

How could I solve it?

All the best,
Stefano

Offline

#3 2021-11-26 19:02:12

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Hi Stefano,

Are you sure that you have WSL2 ?

Offline

#4 2021-11-26 19:04:01

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

My bad, the command is --import

Offline

#5 2021-11-26 19:08:23

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

No problem HB.

Now I receive this:

C:\Windows\system32>wsl --import SalomeMeca2021 C:\ C:\Users\Calcolo\Downloads\smeca-lgpl-wsl2-opensuse.tar
Accesso negato.

then no access. I suppose that is "sudo" user problem...any idea?

All the best
S

Offline

#6 2021-11-26 19:12:21

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Maybe you don't have write access to the root of C: ?

Try to create a folder, say C:\Data and use that...

In my case I had a 2nd disk in F:\ where I had write access.





stefano89 wrote:

No problem HB.

Now I receive this:

C:\Windows\system32>wsl --import SalomeMeca2021 C:\ C:\Users\Calcolo\Downloads\smeca-lgpl-wsl2-opensuse.tar
Accesso negato.

then no access. I suppose that is "sudo" user problem...any idea?

All the best
S

Offline

#7 2021-11-26 19:20:34

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

Ok now I pass to the next step.

I'll update you about it.

All the best,
S

Offline

#8 2021-11-26 20:46:17

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

Dear HB,

I've follow all steps, and I arrived to the end, but I give this error message:


user@Z4-CALCOLO:/mnt/c/Data> salome_meca
INFO: Running salome_meca on wslg display (rdp implementation)
[sudo] password for root:
*****************************************************
INFO : Running salome_meca in software rendering mode
*****************************************************
runSalome running on Z4-CALCOLO
Searching for a free port for naming service: 2815 - OK
Searching Naming Service  + found in 0.1 seconds
Searching /Kernel/Session in Naming Service  +++++++++++++++++++Traceback (most recent call last):
  File "/opt/salome_meca/Salome-V2021-s9/modules/KERNEL_V9_7_0/bin/salome/orbmodule.py", line 181, in waitNSPID
    os.kill(thePID,0)
ProcessLookupError: [Errno 3] No such process

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/salome_meca/appli_V2021/bin/salome/runSalome.py", line 694, in useSalome
    clt = startSalome(args, modules_list, modules_root_dir)
  File "/opt/salome_meca/appli_V2021/bin/salome/runSalome.py", line 639, in startSalome
    session=clt.waitNSPID("/Kernel/Session",mySessionServ.PID,SALOME.Session)
  File "/opt/salome_meca/Salome-V2021-s9/modules/KERNEL_V9_7_0/bin/salome/orbmodule.py", line 183, in waitNSPID
    raise RuntimeError("Process %d for %s not found" % (thePID,theName))
RuntimeError: Process 890 for /Kernel/Session not found


--- Error during Salome launch ---


Do you have any idea?

All the best,
S

Offline

#9 2021-11-26 20:50:26

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Can you tell me what you get if you launch

xclock

In the wsl system, do you see a clock appear ?

Offline

#10 2021-11-26 21:00:54

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

I give this error

user@Z4-CALCOLO:/mnt/c/Windows/system32> xclock
Error: Can't open display:
user@Z4-CALCOLO:/mnt/c/Windows/system32>

Thanks HB

Offline

#11 2021-11-26 21:09:51

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Ok it seems hence that your version of wsl2 does not include a native display driver, called wslg.

But there is a solution for your version consisting of installing an x server on windows.

Search for vcxsrv in google, this is the lightest server and it's easy to setup.

Once you install vcxsrv, run Xlaunch in windows and choose the default options except "Disable Access Control" (page 3 I think) which must be checked (access control disabled), otherwise the internal windows firewall might block your wsl.

Now go back to your wsl, and run

salome_meca_xlaunch

(Yes the distro already includes a specific launcher for that).

Finally please note that these steps which may seem complicated are not at all due to salome_meca. Wslg which will be rolled in future updates of wsl2 (I already have it and it seems to be out for a while now) will make user skip the last step of installing xserver in windows.

Best of luck

Offline

#12 2021-11-26 21:33:30

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

Dear HB,

is a pleasure to tell you that now it work.
Thank you very much for your assistance.

I have a last question: with this server the graphics is not particulary good (graphics update delay etc): do you know any other windows server that could be use?

I understood however that Wslg will be implemented in the next wsl2 release, but I would like to understand if is possible to improve graphics.

All the best and thanks again,
S

Offline

#13 2021-11-26 21:47:29

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Unfortunately it will not be possible for you to use gpu, at least not until you switch to a newer version of wsl2 including wslg.

Microsoft announced gpu compatibility for different cards manufacturers through wsl2, and singularity containers support nvidia gpu acceleration.

So theoretically if you have a nvidia cuda card and update wsl2, you might be able to activate gpu through wsl2 and then through singularity.

Again, this is how it should work on paper, and Microsoft is indeed actively developing and improving the performance of WSL. Running a 3d graphical application was really not imaginable a few years back on WSL so we are already living the revolution.

Best regards

Offline

#14 2021-11-28 21:45:51

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

Dear HB,

I would like to update you about the main news of this installation.

I've upgrade the OS to windows 11 to use wsl2, and I confirm you that in this case Xserver is not needed and Salome Meca works correctly.
I continue however to have the same problem with my graphics card: infact salome work in rendering mode and not in GPU mode, and also "mesa error message" is generated after aster study opening.

This very strange, infact I have a QUADRO P2200 (good card).
I addition salome is quite instable (blocks, crashes, etc)

Do you have any suggestion  to solve my problem?
Is very important for my company to solve this problem, to planning the investment for the next years.

All the best
S

Offline

#15 2021-11-29 19:47:53

piyushverma
Member
Registered: 2021-11-29
Posts: 3

Re: Salome Meca 2021 on WSL2

Hi HB,

Thanks a ton for this thread. I followed the installation steps and also came across the errors faced by stefano. I installed xserver as well and I still have the same error.

*****************************************************
INFO : Running salome_meca in software rendering mode
*****************************************************
runSalome running on PiyushVerma
Searching for a free port for naming service: 2820 - OK
Searching Naming Service  ++ found in 0.2 seconds
Searching /Kernel/Session in Naming Service  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Traceback (most recent call last):
  File "/opt/salome_meca/Salome-V2021-s9/modules/KERNEL_V9_7_0/bin/salome/orbmodule.py", line 181, in waitNSPID
    os.kill(thePID,0)
ProcessLookupError: [Errno 3] No such process

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/salome_meca/appli_V2021/bin/salome/runSalome.py", line 694, in useSalome
    clt = startSalome(args, modules_list, modules_root_dir)
  File "/opt/salome_meca/appli_V2021/bin/salome/runSalome.py", line 639, in startSalome
    session=clt.waitNSPID("/Kernel/Session",mySessionServ.PID,SALOME.Session)
  File "/opt/salome_meca/Salome-V2021-s9/modules/KERNEL_V9_7_0/bin/salome/orbmodule.py", line 183, in waitNSPID
    raise RuntimeError("Process %d for %s not found" % (thePID,theName))
RuntimeError: Process 888 for /Kernel/Session not found


--- Error during Salome launch ---
user@PiyushVerma:/mnt/c/Windows/system32> xclock
Error: Can't open display: 172.29.112.1:0

I also ran xclock and that was the result, can you please help me out with this?
thanks a ton.

Offline

#16 2021-11-29 20:17:29

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Hi piyushverma,

When you start the x server, did you check "Disable Access Control" ?

Offline

#17 2021-11-30 03:52:23

piyushverma
Member
Registered: 2021-11-29
Posts: 3

Re: Salome Meca 2021 on WSL2

Yes, I have disabled access control

Offline

#18 2021-11-30 09:42:13

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

you need to select it: see attached figure.

All the best
S


Attachments:
Screenshot_1.png, Size: 86.68 KiB, Downloads: 289

Offline

#19 2021-11-30 10:32:16

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

@piyushverma : yes it seems that you have a configuration problem with X server on the windows side... Please check again as Stefano has suggested or lookup in google (WSL xserver configuration) for more detailed help... Your issue is really independant of salome_meca.

@stefano89 : yes I have noticed too that the viewer in Asterstudy looks translucent and has a size issue upon activation of the module (software graphics mode). Switching back and forth to SMESH and then moving the viewer around helps refresh the graphics.

Performance wise, I think we should expect that this salome_meca is slower than what you can have natively in linux (we are using 2 virtualisation levels with Windows > WSL > Singularity). You will have much better performance if you use double boot for example and then use singularity. However, in my opinion, this way of using salome_meca can still be useful for occasional users who do not want to change the OS.

For the GL errors, I found that adding :

export MESA_GL_VERSION_OVERRIDE=3.2

just before launching salome_meca helps reduce the messages...


We will continue testing this method to try to figure out of other optimizations are possible and will let you guys know.

Offline

#20 2021-11-30 10:39:10

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

Thanks for your reply HB.
I confirm that with export MESA_GL_VERSION_OVERRIDE=3.2 no errors appear.

Keep in touch regarding WSL2 improvements.

All the best,
S

Offline

#21 2021-11-30 11:27:38

piyushverma
Member
Registered: 2021-11-29
Posts: 3

Re: Salome Meca 2021 on WSL2

Hey HB and Stefano,
I configured xserver and salome meca now works. How can I access files on my windows in salome meca in wsl? Using wsl for the first time, so would appreciate the help.
Thanks again.

Offline

#22 2021-11-30 11:33:23

stefano89
Member
Registered: 2018-04-16
Posts: 49

Re: Salome Meca 2021 on WSL2

if you're windows 10, you need to copy that by "cp" or"mv" command.
In win 11 this is quite simple because linux is implemented well in windows folder.

Windows folder is typical in mnt/C/Users/....

All the best
S

Offline

#23 2021-12-01 17:43:01

carv
Member
Registered: 2021-10-14
Posts: 8

Re: Salome Meca 2021 on WSL2

Please some help.

LAPTOP-AR95KVN1:/home/user # singularity run salome_meca-lgpl-2021.0.0-0-20210601-scibian-9.sif

*****************************************************
INFO : Running salome_meca in software rendering mode
*****************************************************
runSalome running on LAPTOP-AR95KVN1
ERROR:salomeContext:Unexpected error:
Traceback (most recent call last):
  File "/opt/salome_meca/Salome-V2021-s9/modules/KERNEL_V9_7_0/bin/salome/salomeContext.py", line 278, in _startSalome
    res = getattr(self, command)(options) # run appropriate method
  File "/opt/salome_meca/Salome-V2021-s9/modules/KERNEL_V9_7_0/bin/salome/salomeContext.py", line 357, in _runAppli
    runSalome.runSalome()
  File "/opt/salome_meca/appli_V2021/bin/salome/runSalome.py", line 925, in runSalome
    clt,args = main()
  File "/opt/salome_meca/appli_V2021/bin/salome/runSalome.py", line 851, in main
    searchFreePort(args, save_config, args.get('useport'))
  File "/opt/salome_meca/appli_V2021/bin/salome/searchFreePort.py", line 116, in searchFreePort
    queue = Queue()
  File "/opt/python/3.6.5/lib/python3.6/multiprocessing/context.py", line 102, in Queue
    return Queue(maxsize, ctx=self.get_context())
  File "/opt/python/3.6.5/lib/python3.6/multiprocessing/queues.py", line 42, in __init__
    self._rlock = ctx.Lock()
  File "/opt/python/3.6.5/lib/python3.6/multiprocessing/context.py", line 67, in Lock
    return Lock(ctx=self.get_context())
  File "/opt/python/3.6.5/lib/python3.6/multiprocessing/synchronize.py", line 163, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
  File "/opt/python/3.6.5/lib/python3.6/multiprocessing/synchronize.py", line 60, in __init__
    unlink_now)
FileNotFoundError: [Errno 2] No such file or directory

I tested "xclock" and the clock shows me.

What am I doing wrong?

Offline

#24 2021-12-10 18:22:16

guillegiraldo
Member
Registered: 2010-05-05
Posts: 31

Re: Salome Meca 2021 on WSL2

Hello, and thanks for this valuable contribution!

I tried to download the distro, but WeTransfer says the link is no longer valid.

Is there other way to get the image?

Offline

#25 2021-12-11 07:49:34

hberro
Member
From: Palaiseau, France
Registered: 2011-07-05
Posts: 135

Re: Salome Meca 2021 on WSL2

Hi Guille,

I will try to upload the file to another location and will let you know when it's ready.

HB

Update, here is a new (permanent) link :

code-aster.org/FICHIERS/wsl/smeca-lgpl-wsl2-opensuse.tar

Last edited by hberro (2021-12-11 08:07:20)

Offline