Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing GL version error on docker windows container while running pyvista #2

Open
IrakozeFD opened this issue May 10, 2022 · 9 comments

Comments

@IrakozeFD
Copy link

Hi,

I am trying to build a docker image based on windows container (mcr.microsoft.com/windows:20H2) to run on it a python project, and I am getting issues running pyvista in the built container. In fact I have used this repository script to set up OpenGL related features like headless displays in my windows container, but when trying to run tests involving Pyvista I am getting windows fatal exception error which I think it is related to this below :
image

Here the pyvista report about the windows container:

Date: Tue May 10 11:17:18 2022 Paris, Madrid (heure d’été)

            OS : Windows
        CPU(s) : 2
       Machine : AMD64
  Architecture : 64bit
   Environment : Python
   GPU Details : error

Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit
(AMD64)]

       pyvista : 0.34.1
           vtk : 9.0.3
         numpy : 1.22.3
       imageio : 2.19.0
       appdirs : 1.4.4
        scooby : 0.5.12
    matplotlib : 3.5.1
     pyvistaqt : 0.5.0
         PyQt5 : 5.15.6
         scipy : 1.8.0
        meshio : 5.3.4

Docker version 20.10.14, build a224086.

Thank you,

@banesullivan
Copy link
Member

Do you have a repo where this CI is running?

@IrakozeFD
Copy link
Author

The docker image that I want to build will be in fact used for CI in Pyleecan.

@banesullivan
Copy link
Member

Can you point me to the source for that docker image? i.e., the Dockerfile?

@IrakozeFD
Copy link
Author

Please find it here
Thank you.

@banesullivan
Copy link
Member

So what exactly are you trying to do, where are you using this Action, and how can we reproduce the error you are encountering?

@banesullivan
Copy link
Member

I'm not sure how you plan on using the mcr.microsoft.com/windows:20H2 image in GitHub Actions CI unless you have self-hosted runners?

@banesullivan
Copy link
Member

Maybe just adding something like the following to your docker image would work?

Copy https://github.com/pyvista/setup-headless-display-action/blob/main/windows/install_opengl.ps1

COPY install_opengl.ps1 install_opengl.ps1
RUN Set-StrictMode -Version Latest \
    $ErrorActionPreference = "Stop" \
    $PSDefaultParameterValues['*:ErrorAction']='Stop' \
    powershell install_opengl.ps1

@IrakozeFD
Copy link
Author

The docker file does not reflect, as it is right now, how I want to use the image but the testing process can be done with the following lines:

  • clone pyleecan repository
  • install all the requiremeents : python -m pip install -r pyleecan/requirements.tct
  • run Tests with Pytest from the working Dir: python -m pytest pyleecan/Tests

I was just creating the environment and testing with the container CLI on docker desktop to validate the process.

@FelipeCybis
Copy link

Maybe just adding something like the following to your docker image would work?

Copy https://github.com/pyvista/setup-headless-display-action/blob/main/windows/install_opengl.ps1

COPY install_opengl.ps1 install_opengl.ps1
RUN Set-StrictMode -Version Latest \
    $ErrorActionPreference = "Stop" \
    $PSDefaultParameterValues['*:ErrorAction']='Stop' \
    powershell install_opengl.ps1

BTW, I had the same issue in a self-hosted windows container.

I am using FROM mcr.microsoft.com/windows/server:ltsc2022 and even the administrator profile cannot remove opengl32.dll.

My workaround (maybe I should say chatgpt's workaround :P) is downloading install-opengl.ps1 and using in my Dockerfile as you suggested, but changing this (commented lines are the current code)

    # takeown /F $filepath /A
    # icacls $filepath /grant "${env:ComputerName}\${env:UserName}:F"
    $acl = Get-Acl $filepath
    $acl.SetAccessRuleProtection($false, $false)
    $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users", "FullControl", "Allow")
    $acl.AddAccessRule($rule)
    Set-Acl $filepath $acl

Maybe this comment #5 (comment) is also related to this in the first place and not directly to the old OSMesa version.

I am still using the action just for the part where it sets up the PYVISTA_OFF_SCREEN env variable and I am curious if this change would actually work in the action stage (instead of the docker build stage).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants