Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PolarNick

Pages: 1 2 3 [4] 5
46
Python and Java API / Re: import cv2 causes photoscan crash
« on: January 18, 2018, 06:19:15 PM »
You can build OpenCV from sources with this script (tested on Ubuntu 16.04):

Code: [Select]
# Configure path to photoscan:
PHOTOSCAN_PATH=<.../photoscan-pro>
PYTHON_PATH=${PHOTOSCAN_PATH}/python

OPENCV_VERSION=3.4.0
INSTALLATION_PATH=/opt/opencv-${OPENCV_VERSION}
sudo mkdir -p ${INSTALLATION_PATH}

# Install numpy (OpenCV requires it)
CPPFLAGS=-I${PYTHON_PATH}/include/python3.5m LDFLAGS=-L${PYTHON_PATH}/lib ${PYTHON_PATH}/bin/python3.5 -m pip install numpy==1.08

# # If you see error like "ImportError: cannot import name 'HTTPSHandler'" - you need to execute these lines and after that try to install numpy again:
#
# wget http://snapshot.debian.org/archive/debian/20110406T213352Z/pool/main/o/openssl098/libssl0.9.8_0.9.8o-7_amd64.deb
# sudo dpkg -i libssl0.9.8_0.9.8o-7_amd64.deb
# rm libssl0.9.8_0.9.8o-7_amd64.deb

wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip
unzip ${OPENCV_VERSION}.zip
rm ${OPENCV_VERSION}.zip
cd opencv-${OPENCV_VERSION}

# # Alternatively you can get the hole git repository (this is slower):
# git clone https://github.com/opencv/opencv
# cd opencv
# git checkout tags/${OPENCV_VERSION}

mkdir build
cd build

sudo apt update
sudo apt install -y cmake

# Configure opencv build:
#
# You can compile opencv_contrib with this option:
#      -D OPENCV_EXTRA_MODULES_PATH=.../opencv_contrib/modules \
# If you have CUDA SDK installed - you can speedup compilation by disabling CUDA support:
#      -D WITH_CUDA=OFF \

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=${INSTALLATION_PATH} \
      -D PYTHON3_EXECUTABLE=${PYTHON_PATH}/bin/python3.5 \
      ..
make -j8
# Installing OpenCV library w.r.t. INSTALLATION_PATH variable
sudo make install
cd ..

# Now you can cleanup build dir with:
# rm -rf build
# You can even cleanup opencv source code dir:
# cd ..
# rm -rf opencv-${OPENCV_VERSION}

# Add cv2 package to photoscan's bundled python
ln -s ${INSTALLATION_PATH}/lib/python3.5/site-packages/cv2.cpython-35m-x86_64-linux-gnu.so ${PYTHON_PATH}/lib/python3.5/site-packages/cv2.cpython-35m-x86_64-linux-gnu.so

47
Python has very big overhead.

Simple example:

Code: [Select]
x = 0
for i in range(10000000):
    x += (x + i) % 239

This will take 1.05s in Python.

Code: [Select]
int x = 0;
for (int i = 0; i < 10000000; ++i) {
    x += (x + i) % 239;
}

This will take 0.044s and 0.065s in C++ compiled with and without optimizations respectively.

The Python performance is acceptable, until you need to do something in loops thousands of times.

48
General / Re: Tesla P100 and virtualgl
« on: January 10, 2018, 02:33:29 PM »
Quote
M40/M60/K80/V100 driver version is: 387.34´╝îit's FREE.

P100 requires special drivers included with NV Grid 5.1. This driver needs to pay. Free drivers do not have OpenGL features.
Interesting. I didn't know that. I was thinking that V100 is a successor of P100, and so I expected driver politics to be the same.

Quote
Measure the performance of OpenGL, I use the most stupid way.
Download doll.zip to generate a model to compare the time consumed by different GPUs.
For the sake of clarity:
Such measurements are useful to represent total performance of computer: both CPU and GPU computations. And GPU computations are using OpenCL/CUDA. OpenGL is used only for GUI rendering.

49
General / Re: Tesla P100 and virtualgl
« on: January 09, 2018, 07:42:08 PM »
What is a special driver for P100? And how do you measure OpenGL performance?

I tested K80 and V100 with driver downloaded like this (note that driver version variable was configured above: NVIDIA_DRIVER=384.59).

Have you tried this driver?

50
General / Re: Tesla P100 and virtualgl
« on: January 09, 2018, 02:02:40 PM »
https://github.com/agisoft-llc/cloud-scripts were updated with p2 and p3 EC2 instances support (Tesla K80 and Tesla V100) - OpenGL works well (works for any application).

These scripts supposed to be used on clean Ubuntu 16.04, but you can try to manually execute only required commands in script one by one.

51
General / Re: Problems with installation of Photoscan 1.3.4
« on: November 10, 2017, 11:40:55 AM »
Shaders support was introduced in OpenGL 2.0, and so PhotoScan requires at least OpenGL 2.0, but your configuration provides only OpenGL 1.4 :(

52
General / Re: Problems with installation of Photoscan 1.3.4
« on: November 08, 2017, 05:56:20 PM »
GPU is not required in headless mode (in case of network processing or running python scripts), but GUI require some version of OpenGL.

glxgears runs fine? What is output of glxinfo? I am not sure about mesa, but output of glxinfo will show available version of OpenGL and other helpful info.

53
General / Re: Problems with installation of Photoscan 1.3.4
« on: November 08, 2017, 12:56:29 PM »
What is your GPU, driver version, are you using X11 forwardnig, can you run glxgears/other OpenGL applications, what is your output of glxinfo?

54
General / Re: Texture buffer
« on: November 07, 2017, 07:29:52 PM »
Looks fine to me. ~60% fill ratio is typical. There is no way to decrease blank space easily.

But like Smallpoly mentioned - you can export model, create UV atlas in external application (may be with manual intervention), then import it back to PhotoScan and build texture with Keep UV option.

55
General / Re: Photoscan crash when using GPU
« on: November 07, 2017, 07:20:27 PM »
About computations without GUI (via python script or network processing):

Warning: cudaStreamDestroy failed: all CUDA-capable devices are busy or unavailable (46)

Welcome to the club! This problem pops up sometimes and I encountered it too. I can only suggest you to try these things:
 - Update/downgrade drivers
 - Test some simple cuda application (something like GPU-Z or deviceQuery)

56
General / Re: Photoscan crash when using GPU
« on: November 07, 2017, 07:14:17 PM »
Even for glxgears, after stopping it, an error occurred: "XIO: fatal IO error 11 (Resource temporarily unavailable) on X server". Would this indicate anything?

This is looks similar to this (fix?). But this is not reproduces with PhotoScan, so I think that this doesn't indicate anything :(

I also attached the glxinfo screen snapshot, and it seems that the server glx version (1.2) is different from my local machine (1.4). Would this be a possible reason?

Yes, this seems to be the reason. Because at least GLX 1.3 is required. I don't know can GLX 1.3 be supported somehow with mesa. I don't know how to fix this.

57
General / Re: Problems with installation of Photoscan 1.3.4
« on: November 07, 2017, 01:37:06 PM »
May be your libGL.so points to mesa GL? If this is the case - libGL.so should point at the same library as libGL.so.1. (I find this suggestion here)

58
General / Re: Texture buffer
« on: November 07, 2017, 01:22:49 PM »
Can you post output of Tools->Mesh->View Mesh UVs?

Can you try to re-texture with pre-release 1.4.0 build 5310 and  post Tools->Mesh->View Mesh UVs again?

59
General / Re: Photoscan crash when using GPU
« on: November 07, 2017, 01:05:14 PM »
Can you please post logs like Alexey suggested (they can be accessed in GUI)? Logs contain information about OpenGL version available. And it looks like it is too low on your configuration, there is similar problem - https://github.com/Ultimaker/Cura/issues/784

Also I am not sure that Tesla supports any OpenGL.

60
General / Re: Photoscan crash when using GPU
« on: November 02, 2017, 02:22:55 PM »
You can try to run glxgears and glxinfo to check that OpenGL correctly works over your connection configuration.

Pages: 1 2 3 [4] 5