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

black (blank) plot on ubuntu #54

Open
AndrewAnnex opened this issue Sep 2, 2020 · 22 comments
Open

black (blank) plot on ubuntu #54

AndrewAnnex opened this issue Sep 2, 2020 · 22 comments

Comments

@AndrewAnnex
Copy link

on ubuntu, with a recent install of anaconda in a new environment I just get a black screen for the plotting window, if I use the file menu in the background plotter menu to save a screenshot I can view a rendering but otherwise the screen is blank. I installed via the conda-forge, and I can see some differences in the dependencies in the environment yml in this repo and the feedstock, but not sure if that is the issue.

>>> pv.Report()                                                                                                                                            
                                                                                                                                                           
--------------------------------------------------------------------------------                                                                           
  Date: Wed Sep 02 18:32:22 2020 EDT                                                                                                                       
                                                                                                                                                           
                OS : Linux                                                                                                                                 
            CPU(s) : 16                                                                                                                                    
           Machine : x86_64                                                                                                                                
      Architecture : 64bit                                                                                                                                 
               RAM : 62.8 GB                                                                                                                               
       Environment : Python                                                                                                                                
NVIDIA Corporation : GPU Vendor                                                                                                                            
GeForce GTX 1080 Ti/PCIe/SSE2 : GPU Renderer                                                                                                               
4.5.0 NVIDIA 435.21 : GPU Version                                                                                                                          
                                                                                                                                                           
  Python 3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 02:25:08)                                                                                
  [GCC 7.5.0]                                                                                                                                              
                                                                                                                                                           
           pyvista : 0.25.3                                                                                                                                
               vtk : 9.0.1                                                                                                                                 
             numpy : 1.19.1
           imageio : 2.9.0
           appdirs : 1.4.3
            scooby : 0.5.6
            meshio : 4.1.1
        matplotlib : 3.3.1
         pyvistaqt : 0.2.0
             PyQt5 : 5.12.3
           IPython : 7.18.1
             scipy : 1.5.2
              tqdm : 4.48.2

  Intel(R) Math Kernel Library Version 2019.0.5 Product Build 20190808 for
  Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

error when calling disable_eye_dome_lighting()

>>> plotter.disable_eye_dome_lighting()
2020-09-02 18:33:32.815 (  85.569s) [        1750E740]      vtkEDLShading.cxx:97     ERR| vtkEDLShading (0x56159871d580): FrameBufferObject should have been deleted in ReleaseGraphicsResources().
ERROR:root:FrameBufferObject should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.816 (  85.570s) [        1750E740]      vtkEDLShading.cxx:102    ERR| vtkEDLShading (0x56159871d580): ColorTexture should have been deleted in ReleaseGraphicsResources().
ERROR:root:ColorTexture should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.816 (  85.570s) [        1750E740]      vtkEDLShading.cxx:107    ERR| vtkEDLShading (0x56159871d580): DepthTexture should have been deleted in ReleaseGraphicsResources().
ERROR:root:DepthTexture should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.816 (  85.570s) [        1750E740]      vtkEDLShading.cxx:112    ERR| vtkEDLShading (0x56159871d580): FrameBufferObject should have been deleted in ReleaseGraphicsResources().
ERROR:root:FrameBufferObject should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.816 (  85.570s) [        1750E740]      vtkEDLShading.cxx:117    ERR| vtkEDLShading (0x56159871d580): ColorTexture should have been deleted in ReleaseGraphicsResources().
ERROR:root:ColorTexture should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.816 (  85.570s) [        1750E740]      vtkEDLShading.cxx:122    ERR| vtkEDLShading (0x56159871d580): FrameBufferObject should have been deleted in ReleaseGraphicsResources().
ERROR:root:FrameBufferObject should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.817 (  85.570s) [        1750E740]      vtkEDLShading.cxx:127    ERR| vtkEDLShading (0x56159871d580): ColorTexture should have been deleted in ReleaseGraphicsResources().
ERROR:root:ColorTexture should have been deleted in ReleaseGraphicsResources().
2020-09-02 18:33:32.817 (  85.570s) [        1750E740]      vtkEDLShading.cxx:132    ERR| vtkEDLShading (0x56159871d580): ColorTexture should have been deleted in ReleaseGraphicsResources().
ERROR:root:ColorTexture should have been deleted in ReleaseGraphicsResources().
@AndrewAnnex
Copy link
Author

AndrewAnnex commented Sep 3, 2020

I am wondering if this is due to pyqt/pyqt5 as pyqt installs some packages like sip from pypi and not the conda-forge

pyqt5 5.11.x are not available on the forge

@akaszynski
Copy link
Member

Could you try installing vtk==8.1.2? That's been causing some issues and it might be part of the problem. Installing it through vtk should work.

Also, pyqt5==5.11.x has been the most successful for us, so we've gone with that, but you're free to choose a different version.

@AndrewAnnex
Copy link
Author

AndrewAnnex commented Sep 3, 2020 via email

@akaszynski
Copy link
Member

That might be part of the issue then. I've found pyqt5 to be incredibly finicky version to version, and I think you'll have better luck outside the conda releases. If you're using Ubuntu (as am I), the python wheels tend to be quite stable (at least with the right versions).

@AndrewAnnex
Copy link
Author

@akaszynski I think there is a typo in either the pyvista or pyvistaqt conda forge yamls where "pyqt" and "qt" is being installed along with pyqt5, pyqt5-sip, pyqtchart, pyqtwebengine that are installed by pip in one or the other recipe. I wasn't able to get a working conda environment until I used pip only to install pyvista and pyvistaqt and necessary dependencies (see below), and when I did I didn't see any additional "qt" dependencies from the conda forge in the environment.

creating a new environment and then running "pip install pyqt5==5.11.3 pyvista pyvistaqt vtk==8.1.2" worked for me,

however this issue will need to be fixed because vtk 8.1.2 is not available for python 3.8 or forward

I think some version pinning or TLC for the conda forge feedstocks are needed

@AndrewAnnex
Copy link
Author

@akaszynski I should amend this to say, that in this environment I want to be able to run jupyter which requires qt/pyqt. So although you can get a working environment it would be difficult to resolve a functioning environment without careful editing. The end solution is to fix whatever is wrong with pyvista/pyvistaqt

@GuillaumeFavelier
Copy link
Contributor

The environment.yml config file was updated recently so I think it's worth trying again on master(a0babd5) @AndrewAnnex. Do not hesitate to let us know how it goes for you.

@AndrewAnnex
Copy link
Author

@GuillaumeFavelier I am actually still running into this issue, annoyingly I cannot downgrade vtk because 8.2 and 8.1.2 does not support python 3.8 so I am stuck with vtk 9.0.1unless I can safely downgrade the python version

@GuillaumeFavelier
Copy link
Contributor

So you upgraded pyvista and pyvistaqt? Can you share a minimal snippet of the code that reproduces the issue?

@AndrewAnnex
Copy link
Author

code snippet:

import pyvista as pv                         
import pyvistaqt as pvqt                     
p = pvqt.BackgroundPlotter()                 
p.add_mesh(pv.Sphere())                      
p.show() 

as some amount of time has passed here is an updated run of pv.Report:

--------------------------------------------------------------------------------
  Date: Tue Jun 22 09:15:50 2021 EDT

                OS : Linux
            CPU(s) : 16
           Machine : x86_64
      Architecture : 64bit
               RAM : 62.8 GB
       Environment : IPython
        GPU Vendor : NVIDIA Corporation
      GPU Renderer : GeForce GTX 1080 Ti/PCIe/SSE2
       GPU Version : 4.5.0 NVIDIA 460.80

  Python 3.8.5 (default, Sep  4 2020, 07:30:14)  [GCC 7.3.0]

           pyvista : 0.31.2
               vtk : 9.0.1
             numpy : 1.19.5
           imageio : 2.9.0
           appdirs : 1.4.4
            scooby : 0.5.6
            meshio : 4.1.1
        matplotlib : 3.3.0
         pyvistaqt : 0.5.0
             PyQt5 : 5.12.3
           IPython : 7.17.0
          colorcet : 1.0.0
             scipy : 1.6.3
        itkwidgets : 0.32.0
              tqdm : 4.61.1
--------------------------------------------------------------------------------

@akaszynski
Copy link
Member

You can update to the latest dev wheels with pip install vtk==9.0.20210612.dev0. We're working on a few bug fixes regarding these wheels, but it's quite stable outside of Mesa OpenGL in Windows.

@AndrewAnnex
Copy link
Author

@akaszynski yay it works!

Note for others the steps were to:

  1. uninstall pyvista/pyvistaqt/vtk first with mamba/conda
  2. pip install vtk==9.0.20210612.dev0
  3. mamba install pyvista pyvistaqt --no-deps (otherwise it tries to install vtk from conda-forge)

Although my immediate issue is solved, eventually I would like to be able to continue to rely on the conda-forge distribution to make my conda env easier to share. If fixes can't be worked into the feedstock for vtk, maybe the docs for pyvistaqt/pyvista could be updated to include the fix(es) for this issue? I'm not sure how commonly this issue is run into but judging by the repo maybe I just have a strange conda environment

@akaszynski
Copy link
Member

Thanks for posting the steps to your workaround.

maybe the docs for pyvistaqt/pyvista could be updated to include the fix(es) for this issue?

We're going to wait some time until VTK either releases stable wheels or, should that take longer than a month or two, add in notes regarding the workaround you noted.

@Xiaoyuew
Copy link

Xiaoyuew commented Mar 7, 2022

I encountered same problem, could you please help me? I have:
Python 3.8.10
vtk==9.1.0
PyQt5==5.15.6
pyvistaqt==0.7.0
pyvista==0.33.3
I tried the above solutions but didn't help. I cannot find vtk==9.0.20210612.dev0.
The strange thing is the above versions work on my Windows system but do not work on Ubuntu. Any idea of why is that?

@Xiaoyuew
Copy link

Xiaoyuew commented Mar 7, 2022

I solved the black screen problem by cancelling anti-aliasing, but I don't understand why

@GuillaumeFavelier
Copy link
Contributor

GuillaumeFavelier commented Mar 7, 2022

I solved the black screen problem by cancelling anti-aliasing, but I don't understand why

Thanks for reporting here @Xiaoyuew. We discovered in some cases that anti-aliasing, when not supported by the renderer, produces a black screen. I am not entirely sure of the reason but I have some guesses. Do you use MESA?

One way to know is to look at the GPU Renderer section of python -c "import pyvista; print(pyvista.Report())"

@Xiaoyuew
Copy link

Xiaoyuew commented Mar 7, 2022

Yes I use MESA. If it is a problem of GPU I could probably solve it. I will be changing my GPU tomorrow.

@Xiaoyuew
Copy link

Xiaoyuew commented Mar 8, 2022

I have changed to a NVIDIA card and the anti-aliasing no longer causes black screen. Thank you! @GuillaumeFavelier

@JacobBumgarner
Copy link

@Xiaoyuew Could you elaborate on how you configured pyvista to recognize your NVIDIA card on Ubuntu? I'm in WSL2 and am having some trouble getting it configured. Thanks!

@Xiaoyuew
Copy link

It's some time ago, but I think it is just a matter of GPU driver. If you get the correct driver then pyvista can recognize it. @JacobBumgarner

@Xiaoyuew Could you elaborate on how you configured pyvista to recognize your NVIDIA card on Ubuntu? I'm in WSL2 and am having some trouble getting it configured. Thanks!

@JacobBumgarner
Copy link

I appreciate your response. I'm guessing that I would need to recompile VTK with the appropriate GPU configurations. Does that seem right to you? No worries if you don't remember, I know it's been a long time 😄

Thanks, @Xiaoyuew

@Xiaoyuew
Copy link

Xiaoyuew commented Apr 1, 2024

No need to recompile. Just download and install the correct GPU driver should be enough. @JacobBumgarner

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

5 participants