Using conda python to run the trace script does not work, while using pvpython it works

Dear gurus,

I met a problem which maybe easy for you. It is strange to get following error:

ERROR: In /home/conda/feedstock_root/build_artifacts/paraview_1543153320890/work/VTK/Rendering/OpenGL2/ vtkOpenGLRenderWindow.cxx, line 736
vtkOSOpenGLRenderWindow (0x5597aa41fcb0): GLEW could not be initialized.
Segmentation fault (core dumped)

While if I use pvpython from the paraview/bin to run the script, it works perfect (of course, the paraview itself do the job perfect when doing the tracing ). Is this related to my installation of vtk/paraview? I installed vtk/paraview using conda and the other modules/functions works well so far. This seems related to opengl, too. Not very sure.

Could you bring me some light on this?

Thanks in advance.

Looks like a conda packaging issue. You may want to ask conda about that.
What is your GPU ?

I am not very sure about my GPU ( NVIDIA GK106GLM [Quadro K2100M] ? ). Below is the information when run lspci:

    ~$ lspci
    00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
    00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
    00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
    00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
    00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
    00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
    00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
    00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
    00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)
    00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d4)
    00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d4)
    00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d4)
    00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d4)
    00:1c.6 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #7 (rev d4)
    00:1c.7 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #8 (rev d4)
    00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)
    00:1f.0 ISA bridge: Intel Corporation QM87 Express LPC Controller (rev 04)
    00:1f.2 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode] (rev 04)
    00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 04)
    01:00.0 VGA compatible controller: NVIDIA Corporation GK106GLM [Quadro K2100M] (rev a1)
    01:00.1 Audio device: NVIDIA Corporation GK106 HDMI Audio Controller (rev ff)
    03:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4352 802.11ac Wireless Network Adapter (rev 03)
    11:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)

Is there some information may helpful?

Your card should be supported.
How do you setup your paths to be able to load paraview.simple ?
Can you share a minimal script that reproduce the error ?

Below is my script code:

#!/usr/bin/env python3

# -*- coding: UTF-8 -*-

import sys

import json

import math

import time

import base64

from paraview.simple import *

nowtime = lambda: int(round(time.time() * 1000))

rawFileUrl = sys.argv[1]

imgSize = json.loads(sys.argv[2])

# index = json.loads(sys.argv[3])

##### snapshot the 3D picture

#### disable automatic camera reset on 'Show'

paraview.simple._DisableFirstRenderCameraReset()

# create a new 'Image Reader'

rawReader = ImageReader(FileNames=[rawFileUrl])

# rawReader = ImageReader(FilePrefix=rawFileUrl)

# Properties modified on a15704801455411_wholeCore_210x210x365_0p4947x0p4947x0p625mm_8bitraw

rawReader.ReadAsImageStack = 1

rawReader.DataScalarType = 'unsigned char'

rawReader.DataExtent = [0, imgSize['width']-1, 0, imgSize['height']-1, 0, imgSize['pages']-1]

# get active view

renderView1 = GetActiveViewOrCreate('RenderView')

# renderView1.ViewSize = [1216, 808]

# show data in view

rawReaderDisplay = Show(rawReader, renderView1)

# trace defaults for the display properties.

rawReaderDisplay.Representation = 'Outline'

rawReaderDisplay.ColorArrayName = ['POINTS', '']

rawReaderDisplay.OSPRayScaleArray = 'ImageFile'

rawReaderDisplay.OSPRayScaleFunction = 'PiecewiseFunction'

rawReaderDisplay.SelectOrientationVectors = 'ImageFile'

rawReaderDisplay.ScaleFactor = imgSize['pages']/10

rawReaderDisplay.SelectScaleArray = 'ImageFile'

rawReaderDisplay.GlyphType = 'Arrow'

rawReaderDisplay.GlyphTableIndexArray = 'ImageFile'

rawReaderDisplay.DataAxesGrid = 'GridAxesRepresentation'

rawReaderDisplay.PolarAxes = 'PolarAxesRepresentation'

rawReaderDisplay.ScalarOpacityUnitDistance = 1.8646893247972678

# rawReaderDisplay.IsosurfaceValues = [127.5]

rawReaderDisplay.Slice = imgSize['pages']//2

# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'

rawReaderDisplay.ScaleTransferFunction.Points = [0.0, 0.0, 0.5, 0.0, 255.0, 1.0, 0.5, 0.0]

# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'

rawReaderDisplay.OpacityTransferFunction.Points = [0.0, 0.0, 0.5, 0.0, 255.0, 1.0, 0.5, 0.0]

# reset view to fit data

renderView1.ResetCamera()

# # get the material library

# materialLibrary1 = GetMaterialLibrary()

# update the view to ensure updated data information

renderView1.Update()

# set scalar coloring

ColorBy(rawReaderDisplay, ('POINTS', 'ImageFile'))

# rescale color and/or opacity maps used to include current data range

rawReaderDisplay.RescaleTransferFunctionToDataRange(True, True)

# change representation type

rawReaderDisplay.SetRepresentationType('Volume')

# get color transfer function/color map for 'ImageFile'

imageFileLUT = GetColorTransferFunction('ImageFile')

imageFileLUT.RGBPoints = [0.0, 0.231373, 0.298039, 0.752941, 127.5, 0.865003, 0.865003, 0.865003, 255.0, 0.705882, 0.0156863, 0.14902]

imageFileLUT.ScalarRangeInitialized = 1.0

# get opacity transfer function/opacity map for 'ImageFile'

imageFilePWF = GetOpacityTransferFunction('ImageFile')

imageFilePWF.Points = [0.0, 0.0, 0.5, 0.0, 139.78915405273438, 0.5073529481887817, 0.5, 0.0, 255.0, 1.0, 0.5, 0.0]

imageFilePWF.ScalarRangeInitialized = 1

# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.

imageFileLUT.ApplyPreset('Grayscale', True)

# show color bar/color legend

# rawReaderDisplay.SetScalarBarVisibility(renderView1, True)

# current camera placement for renderView1

renderView1.CameraPosition = [-553.2213163882634, 1225.361636475504, 1340.9145427277479]

renderView1.CameraFocalPoint = [imgSize['width']/2, imgSize['height']/2, imgSize['pages']/2]

renderView1.CameraViewUp = [0.2719455703783571, 0.8080929324180035, -0.5225240849259124]

renderView1.CameraParallelScale = (imgSize['width'] + imgSize['height'])/2.2

# reset view to fit data

renderView1.ResetCamera()

# save screenshot

threeDSnapUrl = str(nowtime()) + '_3d.png'

SaveScreenshot('/tmp/'+ threeDSnapUrl, renderView1, ImageResolution=[800, 800])

This script works if I use pvpython to run it. While if I run it using the conda included python, it will give the error shown in my original post.
As you mentioned, it may be related to conda when they packed the vtk or paraview(I guess)

Indeed, you will have to ask conda about that.