Git Product home page Git Product logo

plotoptix's Introduction

PlotOptiX

Latest PlotOptiX version PlotOptiX downloads by pip install Become a Patron!

Data visualisation and ray tracing in Python based on NVIDIA OptiX framework.

PlotOptiX is a 3D ray tracing package for Python, aimed at easy and aesthetic visualization of large datasets (and small as well). Data features can be represented in images as a position, size/thickness and color of primitives of several basic shapes, or projected onto surfaces of objects in form of a color textures and displacement maps. Triangular meshes, generated in the code or loaded from a file, are supported as well. All is finished with a photorealistic lighting, depth of field, and many other physically based effects simulated with a high quality.

No need to write shaders, intersection algorithms, handle 3D scene technicalities. Basic usage is even more simple than with matplotlib:

import numpy as np
from plotoptix import TkOptiX

n = 1000000                                  # 1M points, better not try this with matplotlib
xyz = 3 * (np.random.random((n, 3)) - 0.5)   # random 3D positions
r = 0.02 * np.random.random(n) + 0.002       # random radii

plot = TkOptiX()
plot.set_data("my plot", xyz, r=r)
plot.show()

... but PlotOptiX is much faster on large data, and, with all the raytraced shades and DoF, more readable and eye catching.

Check examples on GitHub for practical code samples and documentation pages for a complete API reference.

PlotOptiX is a set of CUDA shaders by R&D Team wrapped in C#/C++ libraries with a Python API. It is based on NVIDIA OptiX 7.7 framework and makes use of RTX-capable GPU's.

You can quickly display data in a simple plot:

PlotOptiX screenshots, scatter and line plots ray tracing

or prepare complex scenes, combining your generated data with meshes modeled elsewhere:

PlotOptiX screenshots, ray tracing for generative art

Features

  • progressive path tracing with explicit light sampling
  • cameras: orthographic, pinhole, thin-lens and fisheye with depth of field and chromatic aberration simulation, panoramic camera for making 360 deg environment maps, user-defined projection for shooting rays at any angle, and from any origin
  • geometries: particles (spheres), parallelepipeds, parallelograms, tetrahedrons, linear segments, bezier curves, b-splines; meshes: shaded surface or wireframe, automatically generated from a parametric surface or f(x,y) data, or defined with vertices and faces, e.g. created with pygmsh, or loaded from a file, e.g. supported by trimesh, or loaded from a Wavefront .obj file with a native loader
  • materials: flat, diffuse, reflective, refractive; including: light dispersion, surface roughness and metalness, volume scattering, and nested volumes
  • light sources: spherical and parallelogram, light emission in volumes, uniform environmental light or environment map
  • post-processing: tonal correction curves, levels adjustment, apply mask/overlay, AI denoisers and upsampler (OptiX native and Intel Open Image models)
  • callbacks: at the scene initialization, start and end of each frame raytracing, end of progressive accumulation
  • 8/16/32bps(hdr) image output to numpy array, or save to popular image file formats
  • zero-copy access to GPU buffers wrapped in ndarrays: 8/32bpc image, hit and object info, albedo, normals
  • direct access to CuPy and PyTorch tensors data stored on GPU (and CPU as well) for texture and geometry updates
  • GPU acceleration using RT Cores and everything else what comes with OptiX
  • hardware accelerated video output to MP4 file format using NVENC 9.0
  • Tkinter based simple GUI window or a headless raytracer
  • configurable multi-GPU support

System Requirements

  • a CUDA-enabled GPU with compute capability 5.0 (Maxwell) to latest (Ada Lovelace);
    • NVIDIA driver >= r530;
  • Python 3 64-bit
  • Windows:
    • Framework .NET >= 4.8 (present in all modern Windows)
  • Linux:

What's Included

  • RnD.SharpOptiX and RnD.SharpEncoder libraries
  • all other supporting 3'rd party libraries: FFmpeg (Windows only), LibTiff, Newtonsoft.Json
  • Python examples

Installation

Note, at this point, PlotOptiX binaries are tested in: Windows 10/11 (any Python 3), and Linux (Python 3.8-3.10 recommended): Ubuntu 22.04, CentOS 7.

PlotOptiX was also successfully tested on the Google Cloud Platform, using Compute Engine instance with 2x V100 GPU's and Ubuntu 18.04 image. Here are the installation steps so you can save some precious seconds (FFmpeg not included).

If you'd like to work on Colab, it is possible as well. Here is a notebook with all the setup and a simple image generated with PlotOptiX. Note: Colab drivers usually are not up to date and the most recent PlotOptiX release may not be compatible with what Colab provides. The sample notebook is configured to install release wich works with the available driver.

Windows should be ready to go in most cases. You need to do some more typing in Linux.

Windows prerequisites

.NET Framework:

You have it built in your Windows. Go ahead and install PlotOptiX.

Linux prerequisites

Mono runtime:

Check if / which Mono release is present in your system:

mono -V

Mono JIT compiler version 5.18.1.3 (tarball Tue Apr  9 16:16:30 UTC 2019)
   Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
   ... (output cropped for clarity) ...

If mono command is not available, or the reported version is < 6.6, visit Mono download page and follow instructions related to your Linux distribution. You want to install mono-complete package.

pythonnet:

The pythonnet package is available from PyPI, however, you might need some prerequisities. Instuctions below are based on APT, replace apt with yum depending on your OS:

apt update
apt install clang libglib2.0-dev python-dev

You may also need to install development tools, if not already present in your system, e.g. in Ubuntu:

apt install build-essential

or in CentOS:

yum group install "Development Tools"

Then, update required packages and install pythonnet:

pip install -U setuptools wheel pycparser
pip install -U pythonnet

After successful installation you should be able to do python's import:

import clr
print(clr.__version__)

FFmpeg:

FFmpeg shared libraries >= 4.1 are required to enable video encoding features in PlotOptiX. Uninstall older version first. Visit FFmpeg site and download the most recent release sources. Unpack it to a new folder, cd to it. Configure, compile and install as below:

./configure --enable-shared
make
sudo make install

Add FFmpeg's shared library path to your config:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo ldconfig

PlotOptiX

Using pip:

pip install -U plotoptix

From GitHub sources:

git clone https://github.com/rnd-team-dev/plotoptix.git
cd plotoptix
python setup.py install

Then, try running code from the top of this readme, or one of the examples. You may also need to install tkinter and/or PyQt packages, if not shipped with your Python environment.

Development path

This is still an experimental version in many aspects.

PlotOptiX is basically an interface to RnD.SharpOptiX library which we are developing and using in our Studio. RnD.SharpOptiX offers much more functionality than it is now available through PlotOptiX. We progressively add more to PlotOptiX based mostly on the interest of our patrons and applications that this project supports.

Download, star, and become our Patron if you like the project. Get in touch, share your use case, we are always happy to help and take part in exciting ideas of our users.

Examples

Looking at examples is the best way to get started and explore PlotOptiX features. Have a look at the readme and sample codes here.

Examples in the repository head may use features not yet available in the PyPI release. In order to download examples compatible with PyPI release install the package:

python -m plotoptix.install examples

This will create a folder with examples in the current directory.

Surface plot ray tracing with PlotOptiX

plotoptix's People

Contributors

robertsulej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plotoptix's Issues

Synchronization with PlotOptiX

Code #1 - Synchronization with the threading library

I have the following code.

import  numpy               as      np
from    plotoptix           import  NpOptiX
import  matplotlib.pyplot   as      plt
import  threading

class params:
    done = threading.Event()

verticesTriangles   = np.array([[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, -1, 0], [1, 1, 0], [-1, 1, 0]])
faceTriangles       = np.array([[0, 1, 2], [3, 4, 5]])

rt                  = NpOptiX(width = 20, height = 20)

rt.set_mesh("Mesh", verticesTriangles, faceTriangles)

rt.setup_camera("Cam", eye = [0, 0, 2], fov = 25)

rt.start()

# --- https://superfastpython.com/thread-event-object-in-python/
if params.done.wait(3):
    print("Waiting for event to be set.-.")
else:
    print("Event set. Continue.")
    
hitPositionsData = rt._hit_pos
xHitPositions = hitPositionsData[:, :, 0]
yHitPositions = hitPositionsData[:, :, 1]
zHitPositions = hitPositionsData[:, :, 2]
dHitPositions = hitPositionsData[:, :, 3]

hitTriangle   = rt._geo_id[:, :, 1].reshape(rt._height, rt._width)
    
print("Shape of rays array is {}.".format(xHitPositions.shape))

xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]

print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

plt.plot(xHitPositions, yHitPositions, 'bo')
plt.show()

plt.imshow(dHitPositions)
plt.colorbar()
plt.show()

rt.close()

The code works correctly. The threading library is used to wait 3 seconds for the device to complete and then move the results of the computation to the host.

Code #2 - Synchronization with on_launch_finished

I have modified the above code to enforce synchronization with on_launch_finished.

import  numpy               as      np
from    plotoptix           import  NpOptiX
import  matplotlib.pyplot   as      plt
import  threading

class params:
    done = threading.Event()

def wait_for_gpu(rt: NpOptiX) -> None:
    print("gpu done")
    params.done.set()

verticesTriangles   = np.array([[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, -1, 0], [1, 1, 0], [-1, 1, 0]])
faceTriangles       = np.array([[0, 1, 2], [3, 4, 5]])

rt                  = NpOptiX(on_launch_finished = wait_for_gpu, width = 20, height = 20)

rt.set_mesh("Mesh", verticesTriangles, faceTriangles)

rt.setup_camera("Cam", eye = [0, 0, 2], fov = 25)

rt.start()
    
hitPositionsData = rt._hit_pos
xHitPositions = hitPositionsData[:, :, 0]
yHitPositions = hitPositionsData[:, :, 1]
zHitPositions = hitPositionsData[:, :, 2]
dHitPositions = hitPositionsData[:, :, 3]

hitTriangle   = rt._geo_id[:, :, 1].reshape(rt._height, rt._width)
    
print("Shape of rays array is {}.".format(xHitPositions.shape))

xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]

print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

plt.plot(xHitPositions, yHitPositions, 'bo')
plt.show()

plt.imshow(dHitPositions)
plt.colorbar()
plt.show()

rt.close()

The code is not working.

Code #3 - Synchronization with the threading library and with on_launch_finished

In this last code, I'm using both, the threading library and the on_launch_finished.

import  numpy               as      np
from    plotoptix           import  NpOptiX
import  matplotlib.pyplot   as      plt
import  threading

class params:
    done = threading.Event()

def wait_for_gpu(rt: NpOptiX) -> None:
    print("gpu done")
    params.done.set()

verticesTriangles   = np.array([[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, -1, 0], [1, 1, 0], [-1, 1, 0]])
faceTriangles       = np.array([[0, 1, 2], [3, 4, 5]])

rt                  = NpOptiX(on_launch_finished = wait_for_gpu, width = 20, height = 20)

rt.set_mesh("Mesh", verticesTriangles, faceTriangles)

rt.setup_camera("Cam", eye = [0, 0, 2], fov = 25)

rt.start()

# --- https://superfastpython.com/thread-event-object-in-python/
if params.done.wait(3):
    print("Waiting for event to be set.-.")
else:
    print("Event set. Continue.")
    
hitPositionsData = rt._hit_pos
xHitPositions = hitPositionsData[:, :, 0]
yHitPositions = hitPositionsData[:, :, 1]
zHitPositions = hitPositionsData[:, :, 2]
dHitPositions = hitPositionsData[:, :, 3]

hitTriangle   = rt._geo_id[:, :, 1].reshape(rt._height, rt._width)
    
print("Shape of rays array is {}.".format(xHitPositions.shape))

xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]

print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

plt.plot(xHitPositions, yHitPositions, 'bo')
plt.show()

plt.imshow(dHitPositions)
plt.colorbar()
plt.show()

rt.close()

Surprisingly, the code is again not working.

Question - Could you explain such a behavior?

Thank you for any help.

Shadow catcher and images save

Hi,
I have three questions:

  1. I was wondering if at the moment there is a way to have a Shadow catcher surface, i.e. a plane that shows only the shadows but fully transparent to have infinite scenes.
  2. There is a way to do not show the rendering window, i.e. to do the image rendering in "background"?
  3. There is a way to save the figure when the "max_accumulation_frames" has been reached? I tried to set the min_accumulation_step == max_accumulation_frames, but it does not work (it saves a black image). The only trick I was able to figure out was an infinite while loop that wait for no more changes in the rendering process:
tmp = rt.get_rt_output()
while 1:
   time.sleep(1)
    tmp_new = rt.get_rt_output()
    if not(np.sum(tmp - tmp_new)):
        rt.save_image('out.png')
        break
    a = a1

Thanks!

Dark ringing in redering with layer of plastic spheres

Hi,
I've been rendering some simulations data that I have using this code and things look really great in general! I've run into a problem recently where dark rings can be seen when rendering a long layer of plastic spheres. (Hopefully the attached pic goes through). I've tried a few things with the camera angle and the aperture radius but nothing seems to help much. I was wondering if you had any ideas? I can also post the data and a minimal example.

Thank you for any help you can provide!

sed_lub_0

Meaning of max_accumulation_frames parameter

Good day,
I'm using the following code:

import  numpy               as      np
from    plotoptix           import  NpOptiX
import  matplotlib.pyplot   as      plt

def displayResults(rt):

    print("Launch finished.")

    hitPositionsData = rt._hit_pos
    xHitPositions = hitPositionsData[:, :, 0]
    yHitPositions = hitPositionsData[:, :, 1]
    zHitPositions = hitPositionsData[:, :, 2]
    dHitPositions = hitPositionsData[:, :, 3]

    hitTriangle   = rt._geo_id[:, :, 1].reshape(rt._height, rt._width)
    
    print("Shape of rays array is {}.".format(xHitPositions.shape))

    xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
    yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]

    print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

    plt.plot(xHitPositions, yHitPositions, 'bo')
    plt.show()

    plt.imshow(dHitPositions)
    plt.colorbar()
    plt.show()

    plt.draw()

verticesTriangles   = np.array([[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, -1, 0], [1, 1, 0], [-1, 1, 0]])
faceTriangles       = np.array([[0, 1, 2], [3, 4, 5]])

rt                  = NpOptiX(on_rt_accum_done = displayResults, width = 20, height = 20)
 
rt.set_mesh("Mesh", verticesTriangles, faceTriangles)

rt.setup_camera("Cam", eye = [0, 0, 2], fov = 25)

rt.set_param(max_accumulation_frames = 1)
rt.start()

The code uses the max_accumulation_frames parameter which is initially set to 1. With such a setting, I the code returns the following image representing the intersection points over the scattering surface:

max_accumulation_frames_1

It seems that the impinging rays are launched in an ordered grid.

If the max_accumulation_frames parameter is set to 2, then the result is the following:

max_accumulation_frames_2

and randomization occurs, as expected. We have however lost the old, ordered intersection points.

I have three questions about this behavior:

  1. Does this mean that the ordered ray buffer is replaced by the randomized one?
  2. Any time one increases the max_accumulation_frames parameter above 2, is the ray buffer replaced by a new one?
  3. What is the reason for replacing the ray buffer and so what is the reason for dealing with the max_accumulation_frames parameter?

Thank you very much for your help.

Following rays along the way of their multiple intersections

Good day,
I need to follow a ray along its path and acquire information of all its multiple intersections. To this end, I'm considering the following example involving the scattering from a corner reflector:

import numpy as np
from plotoptix import TkOptiX
from plotoptix import NpOptiX
import matplotlib.pyplot as plt

nu = 7
nv = 7
    
def displayResults(rt):

    print("Launch finished.")

    hitPositionsData = rt._hit_pos
    xHitPositions = hitPositionsData[:, :, 0]
    yHitPositions = hitPositionsData[:, :, 1]
    zHitPositions = hitPositionsData[:, :, 2]
    dHitPositions = hitPositionsData[:, :, 3]

    hitTriangle   = rt._geo_id[:, :, 1].reshape(rt._height, rt._width)

    print("Shape of rays array is {}.".format(xHitPositions.shape))

    xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
    yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]
    dHitPositions[np.where(hitTriangle >= 0xFFFFFFFF)] = -1
    hitTriangle[np.where(hitTriangle >= 0xFFFFFFFF)] = 10

    print(dHitPositions)
    
    print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

    plt.plot(xHitPositions, yHitPositions, 'bo')
    plt.show()

    plt.imshow(dHitPositions)
    plt.colorbar()
    plt.show()

    plt.imshow(hitTriangle)
    plt.colorbar()
    plt.show()

    plt.draw()


#verticesTriangle    = np.array([[-2, -2, 0], [2, -2, 0], [-2, 2, 0], [2,  2, 0]])
#faceTriangle        = np.array([[0, 1, 2], [1, 2, 3]])
#verticesTriangles   = np.array([[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, 1, 0], [-1, 1, 2], [1, 1, 2]])
#faceTriangles       = np.array([[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5]])
verticesTriangles   = np.array([[0, 1, 0], [0, -1, 0], [0.5 * np.sqrt(2), 1, 0.5 * np.sqrt(2)], [0.5 * np.sqrt(2), -1, 0.5 * np.sqrt(2)], [-0.5 * np.sqrt(2), 1, 0.5 * np.sqrt(2)], [-0.5 * np.sqrt(2), -1, 0.5 * np.sqrt(2)]])
faceTriangles       = np.array([[0, 1, 2], [1, 2, 3], [0, 1, 4], [1, 4, 5]])

rt                  = NpOptiX(on_rt_accum_done = displayResults, width = nu, height = nv)
#rt                  = NpOptiX(width = nu, height = nv)

rt.set_mesh("Mesh", verticesTriangles, faceTriangles)

u                   = np.linspace(-1.9, 2.1, nu)
v                   = np.linspace(-2, 2, nv)
V, U                = np.meshgrid(v, u)
W                   = np.full((nu, nv), -1)
originsTexture      = np.stack((U, V, W, np.zeros((nu, nv)))).T

rt.set_texture_2d("origins", originsTexture)
 
cx                  = np.zeros((nu, nv))
cy                  = np.zeros((nu, nv))
cz                  = np.ones((nu, nv))
r                   = np.full((nu, nv), 200)
directionsTexture   = np.stack((cx, cy, cz, r)).T

rt.set_texture_2d("directions", directionsTexture)
 
rt.setup_camera("custom_cam", cam_type = "CustomProjXYZtoDir", textures = ["origins", "directions"])

rt.set_param(max_accumulation_frames = 1)

rt.set_uint("path_seg_range", 1, 4)

rt.start()

#rt.close()

I have the following questions:

  1. I'm setting path_seg_range to enable multiple reflections. However, it seems the line does not have an effect. If I comment it out, the results seem to be the same.
  2. I access the hit positions and hit distances by the rt._hit_pos array. However, for my purposes, I need to know all the hit positions and distances per ray. Is that possible by PlotOptiX?

Question about project feasibility

Hello,

I wasn't sure what the best way to ask questions was so I am posting an issue. Feel free to let me know if I should be contacting the developers in a different way.

I am currently working on a project that involves creating a set of rectangle objects (pv modules) that all rotate about an axis together (horizontal single axis tracker). I then take rays coming from the sun and decide if one tracker shades the next tracker, I change the angle of the tracker so that no shading occur. Is this something that I could be doing with plotoptix? There can be a very large amount of trackers in a given scene which makes my current implementation in python very slow.

The main output of this program is the angles at which all trackers do not shade one another. The image output is just a nice to have.

image

COMPILE ERROR: Malformed input

Is version 0.17.1 Maxwell (sm_50) compatible (940MX)?
On linux env I got the following:

Video encoding library initialization failed, encoding features are not available.

CUDA error on synchronize with error 'no kernel image is available for execution on the device'

[ 2][ COMPILER]: COMPILE ERROR: Malformed input. See compile details for more information.
Warning: Requested debug level "OPTIX_COMPILE_DEBUG_LEVEL_MINIMAL", but input module does not include any debug information.
Error: Invalid target architecture. Maximum feasible for current context: sm_50, found: sm_60

OPTIX_ERROR_INVALID_INPUT: Optix call optixModuleCreate( m_context, &m_module_compile_options, m_pipeline_compile_options, ptx.data(), ptx.size(), log, &sizeof_log, &mnew )failed: Modules.cpp:49)

On Windows with a 920MX (sm_52) same error
Thanks

Plane-Wave with PlotOptiX

Hello, I am trying to simulate an electromagnetic scattering situation using PlotOptiX. In particular, I would like to make the source produce plane waves instead of optical rays. Is this possible?

Set number of bounces

Hi,

is there a way to control the number of bounces used by the raytracer? The motivation is, that I would like to get a completely unshaded plot by setting ambient to 1.0 and bounces to 0 (so only direct hits count).

Thanks in advance!

Custom ray origins

Is it possible to cast rays with different origins and directions? The CustomProj camera mode handles custom directions, but all the rays have the same origin.

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast

hello everyone, i am new in linux centos 7. there are some error for running idl code in my system. the errors are:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

and this is my system information:

[root@erlm0 ehsan]# lspci | grep -i vga
03:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. Integrated Matrox G200eW3 Graphics Controller (rev 04)
[root@erlm0 ehsan]# lshw -C display
*-display
description: VGA compatible controller
product: Integrated Matrox G200eW3 Graphics Controller
vendor: Matrox Electronics Systems Ltd.
physical id: 0
bus info: pci@0000:03:00.0
version: 04
width: 32 bits
clock: 66MHz
capabilities: pm vga_controller bus_master cap_list rom
configuration: driver=mgag200 latency=0 maxlatency=32 mingnt=16
resources: irq:16 memory:91000000-91ffffff memory:92808000-9280bfff memory:92000000-927fffff
*-display
description: 3D controller
product: TU104GL [Tesla T4]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:3b:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm bus_master cap_list
configuration: driver=nouveau latency=0
resources: iomemory:382f0-382ef iomemory:382f0-382ef irq:126 memory:ab000000-abffffff memory:382fe0000000-382fefffffff memory:382ff0000000-382ff1ffffff
[root@erlm0 ehsan]# glxinfo | grep "OpenGL renderer"
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
OpenGL renderer string: GDI Generic

plese help me to handle this problem. because i am one of the users in server i can't modify and change freely.

Adding fluid effect

I'm not sure if this is a little specific. But I am using the package to render scenes / videos of bacteria and micro-robot simulations and I want to add this effect of the particles being in a fluid. I have seen on the portfolio website that this has been done but I am far from an expert in this kind of design. Do you have some pointers on what sort of effects to look at in order to make it look like my system is in a fluid?

ModuleNotFoundError: No module named 'System'

I tried to install plotoptix denoiser, but this happends.
It can't find system module.

asv@kata:~$ sudo python3.8 -m plotoptix.install denoiser
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.8/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.8/site-packages/plotoptix/__init__.py", line 24, in <module>
    from plotoptix.npoptix import NpOptiX
  File "/usr/local/lib/python3.8/site-packages/plotoptix/npoptix.py", line 16, in <module>
    from plotoptix._load_lib import load_optix, load_denoiser, PARAM_NONE_CALLBACK, PARAM_INT_CALLBACK
  File "/usr/local/lib/python3.8/site-packages/plotoptix/_load_lib.py", line 18, in <module>
    from System import IntPtr, Int64
ModuleNotFoundError: No module named 'System'
asv@kata:~$

The same happens when i try to install examples.

asv@kata:~$ sudo python3.8 -m plotoptix.install examples
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.8/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.8/site-packages/plotoptix/__init__.py", line 24, in <module>
    from plotoptix.npoptix import NpOptiX
  File "/usr/local/lib/python3.8/site-packages/plotoptix/npoptix.py", line 16, in <module>
    from plotoptix._load_lib import load_optix, load_denoiser, PARAM_NONE_CALLBACK, PARAM_INT_CALLBACK
  File "/usr/local/lib/python3.8/site-packages/plotoptix/_load_lib.py", line 18, in <module>
    from System import IntPtr, Int64
ModuleNotFoundError: No module named 'System'

I am using python3.8. Linux Mint 19.1 Tessa

works with cuda 10.1?

im on ubuntu 16.01, i just installed cuda 10.1

after monkey patching import IntEnum as IntFlag, which was causing an import error, i get another error:

Traceback (most recent call last):
  File "/home/patrick/.local/lib/python3.5/site-packages/plotoptix/_load_lib.py", line 344, in __init__
    c_rnd = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), BIN_PATH, "librndSharpOptiX.so"))
  File "/usr/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libnvrtc.so.10.0: cannot open shared object file: No such file or directory

it looks like it its looking for the 10.0 version of a file that i have a 10.1 version of (i verfied its presence looking in the cuda directory)

do you have a suggestion for what to do? thank you!

Moon Example

Is the moon example working? Does it run locally or only in a notebook?
Thanks!

benchmarking

Is there some sort of benchmarking?
A scene with some geometry, image size of HxW, and the time to render?
I would like to compare with other libraries.

Loading multiple meshes from file.

I have a setup where I load in one mesh and assign to it a material and then load in another with a different material like this:

rt.load_mesh_obj(
    "colloid_meshes/export_mesh_1997.obj", 
    c=np.array([100., 141., 229.])/255, 
    mat="matt_plastic_2", 
    make_normals=True
)
rt.load_mesh_obj(
    "rod_meshes/export_mesh_1997.obj",
     c=10.0, 
    mat="matt_plastic",
     make_normals=True
)

However, when I run this I receive the following error:

[ERROR] (MainThread) Mesh loading failed.

	Selected devices: [0]
	Primary device: 0
[Py-C# interop]
An item with the same key has already been added. Key: mesh
done

and only one mesh is displayed, namely, the first one I added. What is the best method for loading multiple meshes in like this?

Errors raised when loading Tiff file

I have a tiff file, which displays correctly but also leads to many errors popping up:

ReadDirectory: Warning, C:\Users\image.tif: unknown field with tag 33550 (0x830e) encountered

Is this because I'm using geotiff RGBA files?

Setup Error: PathTracer destructor failed.

Hi there!

I seem to be running into an issue when trying to run the example in README.md on Windows with CUDA 10.1.

I'm running a dual GPU setup, first GPU is an RX 480 (display) and the other is an RTX 2080 (which I intend to use for rendering). Could this be the issue?

Here's the code I've run and the resulting error:

C:\****\****>python
Python 3.7.5 (default, Oct 31 2019, 15:18:51) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> from plotoptix import TkOptiX
>>>
>>> n = 1000000                                  # 1M points, better not try this with matplotlib
>>> xyz = 3 * (np.random.random((n, 3)) - 0.5)   # random 3D positions
>>> r = 0.02 * np.random.random(n) + 0.002       # random radii
>>>
>>> plot = TkOptiX()
[Py-C# interop]
PathTracer destructor failed.
[ERROR] (MainThread) Initial setup failed, see errors above.
>>> plot.set_data("my plot", xyz, r=r)
[ERROR] (MainThread) Geometry setup failed.
>>> plot.show()
[ERROR] (MainThread) Camera setup failed.
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\jszym\Anaconda3\envs\pytorch\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Users\jszym\Anaconda3\envs\pytorch\lib\site-packages\plotoptix\npoptix.py", line 262, in run
    assert self._is_scene_created, "Scene is not ready, see initialization messages."
AssertionError: Scene is not ready, see initialization messages.

[ERROR] (MainThread) Raytracing output startup timed out.
>>>

Here's the CUDA version

C:\****\****>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:12:52_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.1, V10.1.243

Here are some details about my system

Field Value
OS Name Microsoft Windows 10 Pro
OS Manufacturer Microsoft Corporation
System Manufacturer Micro-Star International Co., Ltd.
System Model MS-7B09
System Type x64-based PC
Processor AMD Ryzen Threadripper 1950X 16-Core Processor, 3400 Mhz, 32 Logical Processor(s)
BaseBoard Manufacturer Micro-Star International Co., Ltd.
BaseBoard Product X399 GAMING PRO CARBON AC (MS-7B09)
BaseBoard Version 1.0
Installed Physical Memory (RAM) 32.0 GB

GPU 1 details

Field Value
Name Radeon (TM) RX 480 Graphics
Adapter Type AMD Radeon Graphics Processor (0x67DF), Advanced Micro Devices, Inc. compatible
Adapter Description Radeon (TM) RX 480 Graphics
Adapter RAM (1,048,576) bytes
Driver Version 26.20.15002.61

GPU 2 details

Field Value
Name NVIDIA GeForce RTX 2080
Adapter Type GeForce RTX 2080, NVIDIA compatible
Adapter Description NVIDIA GeForce RTX 2080
Adapter RAM (1,048,576) bytes
Driver Version 26.21.14.3200

Also wanted to thank you so much for your work, this is a fantastic project.

Misleading documentation for `utils.simplex`

The summary for utils.simplex claims "simplex noise" when it actually makes OpenSimplex noise. The two algorithms are distinct from each other despite the visual similarity of the output.

OptiX initialization failed.

`
CUDAOutputBuffer destructor caught exception: CUDA call (cudaFreeHost(reinterpret_cast<void*>(m_host_zcopy_pixels)) ) failed with error: 'the provided PTX was compiled with an unsupported toolchain.' (c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\cudaoutputbuffer.h:87)

CUDAOutputBuffer destructor caught exception: CUDA call (cudaFreeHost(reinterpret_cast<void*>(m_host_zcopy_pixels)) ) failed with error: 'the provided PTX was compiled with an unsupported toolchain.' (c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\cudaoutputbuffer.h:87)

CUDAOutputBuffer destructor caught exception: CUDA call (cudaFreeHost(reinterpret_cast<void*>(m_host_zcopy_pixels)) ) failed with error: 'the provided PTX was compiled with an unsupported toolchain.' (c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\cudaoutputbuffer.h:87)

CUDAOutputBuffer destructor caught exception: CUDA call (cudaFreeHost(reinterpret_cast<void*>(m_host_zcopy_pixels)) ) failed with error: 'the provided PTX was compiled with an unsupported toolchain.' (c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\cudaoutputbuffer.h:87)

CUDAOutputBuffer destructor caught exception: CUDA call (cudaFreeHost(reinterpret_cast<void*>(m_host_zcopy_pixels)) ) failed with error: 'the provided PTX was compiled with an unsupported toolchain.' (c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\cudaoutputbuffer.h:87)

[ERROR] (MainThread) Initial setup failed, see errors above.
[ERROR] (MainThread) Geometry setup failed.
[ERROR] (MainThread) Geometry setup failed.
[ERROR] (MainThread) Geometry setup failed.
[Py-C# interop]
OptiX initialization failed.
Unknown OptixResult code: Compatible device(s) not found / OptiX not initialized.
PathTracer destructor failed.
[ERROR] (MainThread) Camera setup failed.
[ERROR] (MainThread) Current camera is not set.
[ERROR] (MainThread) Need 3D coordinates for the new light.
[ERROR] (MainThread) Camera setup failed.
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\rajas\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\work\personal\plotoptix\venv\lib\site-packages\plotoptix\npoptix.py", line 390, in run
assert self._is_scene_created, "Scene is not ready, see initialization messages."
AssertionError: Scene is not ready, see initialization messages.
`
Os Windows 10

image

Windows Error 0xe0434352 with Anaconda3 in fresh environment

When I try to import plotoptix or try any example I get following error:

----> 1 import plotoptix

~\Anaconda3\lib\site-packages\plotoptix\__init__.py in <module>
     22 # import PlotOptiX modules ###############################################
     23 from plotoptix.enums import *
---> 24 from plotoptix.npoptix import NpOptiX
     25 from plotoptix.tkoptix import TkOptiX
     26

~\Anaconda3\lib\site-packages\plotoptix\npoptix.py in <module>
     15 from plotoptix.singleton import Singleton
     16 from plotoptix._load_lib import load_optix, load_denoiser, PARAM_NONE_CALLBACK, PARAM_INT_CALLBACK
---> 17 from plotoptix.utils import _make_contiguous_vector, _make_contiguous_3d
     18 from plotoptix.enums import *
     19

~\Anaconda3\lib\site-packages\plotoptix\utils.py in <module>
     12 from plotoptix.enums import GpuArchitecture, ChannelOrder
     13
---> 14 _optix = load_optix()
     15
     16

~\Anaconda3\lib\site-packages\plotoptix\_load_lib.py in load_optix()
   1010
   1011     package_dir = os.path.dirname(__file__)
-> 1012     optix.set_library_dir(os.path.join(package_dir, BIN_PATH))
   1013     optix.set_include_dir(os.path.join(package_dir, BIN_PATH, "cuda"))
   1014     sharp_optix = optix

OSError: [WinError -532462766] Windows Error 0xe0434352

I can reproduce this on my system with a fresh anaconda evironment only installing plotoptix with pip. The versions of everything actually look good, don't they? :

Windows Version: 1903 Build 18362.418

python --version
Python 3.7.4

nVidia driver version:
436.48 DCH

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\full" /v version

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\full
    version    REG_SZ    4.8.03752

pip freeze

certifi==2019.9.11
cycler==0.10.0
kiwisolver==1.1.0
matplotlib==3.1.1
numpy==1.17.2
packaging==19.2
Pillow==6.2.0
plotoptix==0.5.1
pyparsing==2.4.2
python-dateutil==2.8.0
six==1.12.0
wincertstore==0.2

conda list

# Name                    Version                   Build  Channel
ca-certificates           2019.8.28                     0
certifi                   2019.9.11                py37_0
cycler                    0.10.0                   pypi_0    pypi
kiwisolver                1.1.0                    pypi_0    pypi
matplotlib                3.1.1                    pypi_0    pypi
numpy                     1.17.2                   pypi_0    pypi
openssl                   1.1.1d               he774522_2
packaging                 19.2                     pypi_0    pypi
pillow                    6.2.0                    pypi_0    pypi
pip                       19.2.3                   py37_0
plotoptix                 0.5.1                    pypi_0    pypi
pyparsing                 2.4.2                    pypi_0    pypi
python                    3.7.4                h5263a28_0
python-dateutil           2.8.0                    pypi_0    pypi
setuptools                41.4.0                   py37_0
six                       1.12.0                   pypi_0    pypi
sqlite                    3.30.0               he774522_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wheel                     0.33.6                   py37_0
wincertstore              0.2                      py37_0

Running on CentOS 7

Hi there,

Is CentOS 7 officially supported? The README includes some steps specific to CentOS 7, but only says that it has been tested in Windows 10 and Ubuntu 18.04. However, I see in another issue that you've tested the installation process in CentOS 7: #1 (comment)

The reason I'm asking is that I'm having trouble getting PlotOptiX working on my systems, after a seemingly successful installation. Here's what happens when I try to run it, first on a machine with a couple of Turing architecture cards:

(plotoptix-test) [awerner@cuda2 ~]$ cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
(plotoptix-test) [awerner@cuda2 ~]$ mono --version
Mono JIT compiler version 5.20.1.27 (tarball Wed Jun 12 14:06:50 EDT 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          supported, not enabled.
	Suspend:       hybrid
	GC:            sgen (concurrent by default)
(plotoptix-test) [awerner@cuda2 ~]$ ffmpeg -version
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --prefix=/home/awerner/ffmpeg-install
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
(plotoptix-test) [awerner@cuda2 ~]$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
(plotoptix-test) [awerner@cuda2 ~]$ lspci | grep VGA
09:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. G200eR2 (rev 01)
83:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
84:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
(plotoptix-test) [awerner@cuda2 ~]$ python3
Python 3.7.2 (default, Mar  6 2019, 15:40:52) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
p>>> print(clr.__version__)
2.4.0
>>> import numpy as np
>>> from plotoptix import TkOptiX
**********************************************************************************
**********************************************************************************
Video encoding library initialization failed, encoding features are not available.
**********************************************************************************
**********************************************************************************
>>> 
>>> n = 1000000                                  # 1M points, better not try this with matplotlib
>>> xyz = 3 * (np.random.random((n, 3)) - 0.5)   # random 3D positions
>>> r = 0.02 * np.random.random(n) + 0.002       # random radii
>>> 
>>> plot = TkOptiX()
[Py-C# interop]
OptiX initialization failed.
Parse error (Details: Function "RTresult _rtProgramCreateFromPTXString(RTcontext, const char*, const char*, RTprogram_api**)" caught exception: (api input string): error: Failed to parse input PTX string
(api input string), line 10; fatal   : Unsupported .target 'sm_75'
Cannot parse input PTX string
)
[ERROR] (MainThread) Initial setup failed, see errors above.
>>> 

and then with another system--same OS and same exact installation of CUDA, mono, pythonnet, etc., but different hardware (Maxwell)--

(plotoptix-test) [awerner@cuda3 ~]$ lspci | grep VGA
03:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. Integrated Matrox G200eW3 Graphics Controller (rev 04)
3b:00.0 VGA compatible controller: NVIDIA Corporation GV100 [TITAN V] (rev a1)
d8:00.0 VGA compatible controller: NVIDIA Corporation GV100 [TITAN V] (rev a1)
(plotoptix-test) [awerner@cuda3 ~]$ python3
Python 3.7.2 (default, Mar  6 2019, 15:40:52) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> from plotoptix import TkOptiX
**********************************************************************************
**********************************************************************************
Video encoding library initialization failed, encoding features are not available.
**********************************************************************************
**********************************************************************************
>>> n = 1000000                                  # 1M points, better not try this with matplotlib
>>> xyz = 3 * (np.random.random((n, 3)) - 0.5)   # random 3D positions
>>> r = 0.02 * np.random.random(n) + 0.002       # random radiiplot.set_data("my plot", xyz, r=r)
>>> plot = TkOptiX()
>>> plot.set_data("my plot", xyz, r=r)
>>> plot.show()
>>> terminate called after throwing an instance of 'APIError'

=================================================================
	Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
/proc/self/maps:
00400000-00401000 r-xp 00000000 00:5f 19772441                           /misc/linux/centos7/x86_64/local/stow/python-3.7/bin/python3.7
00600000-00601000 r--p 00000000 00:5f 19772441                           /misc/linux/centos7/x86_64/local/stow/python-3.7/bin/python3.7
00601000-00602000 rw-p 00001000 00:5f 19772441                           /misc/linux/centos7/x86_64/local/stow/python-3.7/bin/python3.7
01055000-076f5000 rw-p 00000000 00:00 0                                  [heap]
404d7000-404e7000 rwxp 00000000 00:00 0 
4171d000-41800000 rwxp 00000000 00:00 0 
200000000-200200000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
200200000-200600000 ---p 00000000 00:00 0 
200600000-200800000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
200800000-200a00000 rw-s 00000000 00:05 132586                           /dev/nvidia0
200a00000-206200000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
206200000-206400000 rw-s 00000000 00:05 132586                           /dev/nvidia0
206400000-207400000 ---p 00000000 00:00 0 
207400000-207600000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
207600000-207800000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
207800000-207a00000 rw-s 207800000 00:05 167990                          /dev/nvidia-uvm
207a00000-207c00000 ---p 00000000 00:00 0 
207c00000-207e00000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
207e00000-208000000 rw-s 00000000 00:04 660733                           /dev/zero (deleted)
208000000-208200000 ---p 00000000 00:00 0 
208200000-208400000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
208400000-208800000 ---p 00000000 00:00 0 
208800000-208a00000 rw-s 00000000 00:05 132585                           /dev/nvidiactl
208a00000-208c00000 rw-s 00000000 00:05 132597                           /dev/nvidia1
208c00000-20e400000 rw-s 00000000 00:05 132585                           /dev/nvidiactl

=================================================================
	Basic Fault Adddress Reporting
=================================================================
Memory around native instruction pointer (0x7fe5f76cc207):0x7fe5f76cc1f7  48 63 d7 48 63 f6 48 63 f9 b8 ea 00 00 00 0f 05  Hc.Hc.Hc........
0x7fe5f76cc207  48 3d 00 f0 ff ff 77 1e f3 c3 0f 1f 80 00 00 00  H=....w.........
0x7fe5f76cc217  00 85 c9 7f db 89 c8 f7 d8 81 e1 ff ff ff 7f 0f  ................
0x7fe5f76cc227  44 c6 89 c1 eb ca 48 8b 15 3c fc 38 00 f7 d8 64  D.....H..<.8...d

=================================================================
	Native stacktrace:
=================================================================
	0x7fe5eda8da75 - /home/awerner/mono-install/lib/libmonosgen-2.0.so.1 : (null)
	0x7fe5eda251f9 - /home/awerner/mono-install/lib/libmonosgen-2.0.so.1 : (null)
	0x7fe5f817b5d0 - /lib64/libpthread.so.0 : (null)
	0x7fe5f76cc207 - /lib64/libc.so.6 : gsignal
	0x7fe5f76cd8f8 - /lib64/libc.so.6 : abort
	0x7fe5e03e77d5 - /lib64/libstdc++.so.6 : _ZN9__gnu_cxx27__verbose_terminate_handlerEv
	0x7fe5e03e5746 - /lib64/libstdc++.so.6 : (null)
	0x7fe5e03e5773 - /lib64/libstdc++.so.6 : (null)
	0x7fe5e03e5993 - /lib64/libstdc++.so.6 : (null)
	0x7fe5dd7736bb - /home/awerner/plotoptix-test/lib/python3.7/site-packages/plotoptix/bin/librndSharpOptiX.so : (null)
	0x417f6d36 - Unknown

=================================================================
	Telemetry Dumper:
=================================================================
Pkilling 0x7fe584992700 from 0x7fe570264700
Pkilling 0x7fe5bd704700 from 0x7fe570264700
Pkilling 0x7fe470917700 from 0x7fe570264700
Pkilling 0x7fe5bd503700 from 0x7fe570264700
Pkilling 0x7fe560223700 from 0x7fe570264700
Pkilling 0x7fe57f990700 from 0x7fe570264700
Pkilling 0x7fe5f8aac740 from 0x7fe570264700
Entering thread summarizer pause from 0x7fe570264700
Finished thread summarizer pause from 0x7fe570264700.

Waiting for dumping threads to resume

Debug info from gdb:

[snip]

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at RnD.SharpOptiX.Dll:ReadImageDataBuffer <0x000a5>
	  at RnD.SharpOptiX.SceneRaytracer:Launch <0x0026b>
	  at RnD.SharpOptiX.Py.PyImageOptiX:<Timer_Tick>b__164_0 <0x00037>
	  at System.Threading.Tasks.Task`1:InnerInvoke <0x00066>
	  at System.Threading.Tasks.Task:Execute <0x0003b>
	  at System.Threading.Tasks.Task:ExecutionContextCallback <0x00057>
	  at System.Threading.ExecutionContext:RunInternal <0x001b2>
	  at System.Threading.ExecutionContext:Run <0x00047>
	  at System.Threading.Tasks.Task:ExecuteWithThreadLocal <0x000fb>
	  at System.Threading.Tasks.Task:ExecuteEntry <0x000c7>
	  at System.Threading.Tasks.Task:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem <0x0002b>
	  at System.Threading.ThreadPoolWorkQueue:Dispatch <0x002e2>
	  at System.Threading._ThreadPoolWaitCallback:PerformWaitCallback <0x00063>
	  at <Module>:runtime_invoke_bool <0x0007a>
=================================================================
Aborted (core dumped)
(plotoptix-test) [awerner@cuda3 ~]$ 

Full text of the second crash

Any suggestions? Let me know if there's any information that I didn't provide that could be useful. Thanks!

Compile error on calling raytracing start function

When I try to start the raytracing framework, my console gets flooded by the error down below.
My code used to work before, so maybe its due to an issue with the newest NVIDIA driver.
I am using a RTX 3080 + driver 471.11.

OPTIX_ERROR_PIPELINE_LINK_ERROR: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2722)
Log:
COMPILE ERROR:
Info: Pipeline has 4 module(s), 4 entry function(s), 3 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 150 basic block(s) in entry functions, 2358 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions      
Error: Symbol '__closesthit__mesh_occlusion_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_occlusion_transparency_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__blurred_dot_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__cos_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__diffuse_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__diffuse_masked_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__flat_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__glass_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__radio_scatter_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__radio_target_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__reflective_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__reflective_masked_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__shadow_catcher_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'

[ 2][COMPILE FEEDBACK]: COMPILE ERROR: 
Info: Pipeline has 4 module(s), 4 entry function(s), 3 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 150 basic block(s) in entry functions, 2358 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions      
Error: Symbol '__closesthit__mesh_occlusion_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_occlusion_transparency_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__blurred_dot_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__cos_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__diffuse_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__diffuse_masked_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__flat_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__glass_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__radio_scatter_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__radio_target_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__reflective_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__reflective_masked_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'
Error: Symbol '__closesthit__mesh_radiance__shadow_catcher_1_0xf2552e3c2bff9d8c' was defined multiple times. First seen in: '__closesthit__mesh_occlusion_and_12_more_139482679971784184'

Module compilation failed

Hi,

I am facing a new error. I do not know why, but suddenly today even with the simplest example the interpreter returns this error:


OPTIX_ERROR_INTERNAL_COMPILER_ERROR: Optix call 'optixModuleCreateFromPTX( m_context, &m_module_compile_options, &m_pipeline_compile_options, ptx.c_str(), ptx.size(), log, &sizeof_log, &mnew )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\modules.cpp:23)
Log:
COMPILE ERROR: Module compilation failed
Info: Pipeline parameter "params" size is 280 bytes
Info: Module uses 4 payload values. Pipeline configuration: 4.
Info: Module uses 6 attribute values. Pipeline configuration: 6.
Info: Entry function "__closesthit__occlusion" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 2 basic block(s), 8 instruction(s)
Info: Entry function "__closesthit__occlusion_transparency" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 7 basic block(s), 78 instruction(s)
Info: Entry function "__anyhit__occlusion" with semantic type ANYHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 2 basic block(s), 9 instruction(s)
Info: Entry function "__closesthit__radiance__flat" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 41 basic block(s), 504 instruction(s)
Info: Entry function "__closesthit__radiance__cos" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 41 basic block(s), 528 instruction(s)
Info: Entry function "__closesthit__radiance__blurred_dot" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 46 basic block(s), 563 instruction(s)
Info: Entry function "__closesthit__radiance__diffuse_masked" with semantic type CLOSESTHIT has 1 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 86 basic block(s), 1249 instruction(s)
Info: Entry function "__closesthit__radiance__diffuse" with semantic type CLOSESTHIT has 1 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 81 basic block(s), 1187 instruction(s)
Info: Entry function "__closesthit__radiance__glass" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 124 basic block(s), 1235 instruction(s)
Info: Entry function "__closesthit__radiance__reflective_masked" with semantic type CLOSESTHIT has 2 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 141 basic block(s), 2052 instruction(s)
Info: Entry function "__closesthit__radiance__reflective" with semantic type CLOSESTHIT has 2 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 136 basic block(s), 1998 instruction(s)
Info: Entry function "__closesthit__radiance__light_soft" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 47 basic block(s), 561 instruction(s)
Info: Entry function "__closesthit__radiance__light_hard" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 45 basic block(s), 542 instruction(s)
Info: Entry function "__closesthit__radiance__shadow_catcher" with semantic type CLOSESTHIT has 1 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 77 basic block(s), 1129 instruction(s)
Info: 7 non-entry function(s) have 42 basic block(s), 647 instruction(s)


[ 2][COMPILE FEEDBACK]: COMPILE ERROR: Module compilation failed
Info: Pipeline parameter "params" size is 280 bytes
Info: Module uses 4 payload values. Pipeline configuration: 4.
Info: Module uses 6 attribute values. Pipeline configuration: 6.
Info: Entry function "__closesthit__occlusion" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 2 basic block(s), 8 instruction(s)
Info: Entry function "__closesthit__occlusion_transparency" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 7 basic block(s), 78 instruction(s)
Info: Entry function "__anyhit__occlusion" with semantic type ANYHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 2 basic block(s), 9 instruction(s)
Info: Entry function "__closesthit__radiance__flat" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 41 basic block(s), 504 instruction(s)
Info: Entry function "__closesthit__radiance__cos" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 41 basic block(s), 528 instruction(s)
Info: Entry function "__closesthit__radiance__blurred_dot" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 46 basic block(s), 563 instruction(s)
Info: Entry function "__closesthit__radiance__diffuse_masked" with semantic type CLOSESTHIT has 1 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 86 basic block(s), 1249 instruction(s)
Info: Entry function "__closesthit__radiance__diffuse" with semantic type CLOSESTHIT has 1 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 81 basic block(s), 1187 instruction(s)
Info: Entry function "__closesthit__radiance__glass" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 124 basic block(s), 1235 instruction(s)
Info: Entry function "__closesthit__radiance__reflective_masked" with semantic type CLOSESTHIT has 2 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 141 basic block(s), 2052 instruction(s)
Info: Entry function "__closesthit__radiance__reflective" with semantic type CLOSESTHIT has 2 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 136 basic block(s), 1998 instruction(s)
Info: Entry function "__closesthit__radiance__light_soft" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 47 basic block(s), 561 instruction(s)
Info: Entry function "__closesthit__radiance__light_hard" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 45 basic block(s), 542 instruction(s)
Info: Entry function "__closesthit__radiance__shadow_catcher" with semantic type CLOSESTHIT has 1 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 77 basic block(s), 1129 instruction(s)
Info: 7 non-entry function(s) have 42 basic block(s), 647 instruction(s)

I already tried to delete the cache and re-install the library but it still the same. Any idea on how to solve this?

Thanks again!

Customized UI

Is it possible to add some customized UI (buttons, sliders) into this framework so the user can interact with the object? This can be helpful if the user wants to add/delete objects or change color/size.

Color the faces directly

Thanks again for this really fast ray tracing package.

I was wondering if there is a way to color the faces directly instead of coloring via the vertices.
In other words, we can update the color of the mesh by running:
rt.update_mesh(c=np.array(n, 3))

However, this requires an array of colors for the vertices, is there a similar approach where c is a color for each face id?

mesh smoothening not working

Hi!

First of all amazing work making this library! :)

I am trying to load an obj file using load_merged_mesh_obj. My obj file is Desk, and the legs of the desk are cylindrical.

I tried loading the obj file in three ways:

  1. using make_normals = True
  2. using make_normals = False
  3. parsing the obj file for normals -> creating a normals array -> feeding that normals array to the mesh using update_mesh

However, I observe no change in the way the object is rendered, the legs of the desk still look jagged.
Attaching pictures from the three cases:

case1:
mntrue

case2:
mnfalse

case3:
normalsprovided

My questions are:

  1. Is this expected behavior?
  2. If yes, is there any API I can use to smoothen the edges?
  3. Do we have control over the smoothing angle used to smoothen surfaces?

Thanks! :)
Here's my source code:

import numpy as np
from plotoptix import TkOptiX
from obj_parser import get_uvmap
from plotoptix.materials import m_diffuse

def main():

    obj_file = "Desk.obj"
    texture_file = "Desk_AlbedoTransparency.png"
    rt = TkOptiX()
    rt.set_param(max_accumulation_frames=500)
    rt.set_background(0)
    
    # rt.setup_light("light1", pos=[10, -9, -8], color=[9, 8, 7], radius=4)
    rt.set_ambient([0.7, 0.8, 0.9])

    uv_map, normal_map = get_uvmap(obj_file)
    rt.load_merged_mesh_obj(obj_file, 'desk')
    
    #case3
    rt.update_mesh('desk', c=1, uvmap=uv_map, normals=normal_map)

    rt.load_texture('desktexture', texture_file)
    m_diffuse["ColorTextures"] = ["desktexture"]
    rt.update_material("diffuse", m_diffuse)

    rt.setup_camera("cam1")
    rt.get_camera_target()
    d = np.linalg.norm(rt.get_camera_target() - rt.get_camera_eye())
    rt.setup_light("light1", color=[9, 8, 7], radius=0.3 * d)
    rt.show()

if __name__ == "__main__":
    main()

Plot freezes after few seconds and instantly on Jupyter

I'm facing a problem with plotoptix in a Ubuntu 18.04 with CUDA 10.2, FFMPEG 4.2 and Mono 5.20.1 in my system and CUDA 10.1, FFMPEG 4.2 and pythonnet 2.4 in a conda environment.

All seems to work well running the code on a terminal, but after few seconds the plot freezes and I'm forced to kill the thread to close the window.

In Jupyterlab, for example, the plot window open but freezes almost immediately after opening.

Is there anything I'm doing wrong here? lol
I did the Windows step on my personal laptop and all worked pretty amazingly ;)

Here is some information about the system and conda environment.

System:

Ubuntu 18.04

NVIDIA Titan X (Pascal)

ffmpeg/bionic,now 7:4.2.1-0york0~18.04 amd64 [installed]

Mono JIT compiler version 5.20.1.34 (tarball Tue Jul 16 22:52:32 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: hybrid
GC: sgen (concurrent by default)

packages in environment at /home/joao/miniconda3/envs/volume:
Name Version Build Channel
_libgcc_mutex 0.1 main
asn1crypto 0.24.0 py37_1003 conda-forge
attrs 19.1.0 py_0 conda-forge
backcall 0.1.0 py_0 conda-forge
bleach 3.1.0 py_0 conda-forge
bzip2 1.0.8 h516909a_1 conda-forge
ca-certificates 2019.9.11 hecc5488_0 conda-forge
certifi 2019.9.11 py37_0 conda-forge
cffi 1.12.3 py37h8022711_0 conda-forge
chardet 3.0.4 py37_1003 conda-forge
cloudpickle 1.2.1 py_0 conda-forge
cryptography 2.7 py37h72c5cf5_0 conda-forge
cudatoolkit 10.1.168 0
cycler 0.10.0 py_1 conda-forge
cytoolz 0.10.0 py37h516909a_0 conda-forge
dask-core 2.3.0 py_0 conda-forge
dbus 1.13.6 he372182_0 conda-forge
decorator 4.4.0 py_0 conda-forge
defusedxml 0.5.0 py_1 conda-forge
entrypoints 0.3 py37_1000 conda-forge
expat 2.2.5 he1b5a44_1003 conda-forge
ffmpeg 4.2 h167e202_0 conda-forge
fontconfig 2.13.1 he4413a7_1000 conda-forge
freetype 2.10.0 he983fc9_1 conda-forge
gettext 0.19.8.1 hc5be6a0_1002 conda-forge
glib 2.58.3 h6f030ca_1002 conda-forge
gmp 6.1.2 hf484d3e_1000 conda-forge
gnutls 3.6.5 hd3a4fd2_1002 conda-forge
gst-plugins-base 1.14.5 h0935bb2_0 conda-forge
gstreamer 1.14.5 h36ae1b5_0 conda-forge
icu 58.2 hf484d3e_1000 conda-forge
idna 2.8 py37_1000 conda-forge
imageio 2.5.0 py37_0 conda-forge
ipydatawidgets 4.0.1 py_0 conda-forge
ipykernel 5.1.2 py37h5ca1d4c_0 conda-forge
ipyscales 0.3.0 py_0 conda-forge
ipython 7.7.0 py37h5ca1d4c_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipyvolume 0.5.2 py37_0 conda-forge
ipywebrtc 0.5.0 py37_0 conda-forge
ipywidgets 7.5.1 py_0 conda-forge
jedi 0.15.1 py37_0 conda-forge
jinja2 2.10.1 py_0 conda-forge
jpeg 9c h14c3975_1001 conda-forge
json5 0.8.5 py_0 conda-forge
jsonschema 3.0.2 py37_0 conda-forge
jupyter 1.0.0 py_2 conda-forge
jupyter_client 5.3.1 py_0 conda-forge
jupyter_console 6.0.0 py_0 conda-forge
jupyter_core 4.4.0 py_0 conda-forge
jupyterlab 1.0.6 py37_0 conda-forge
jupyterlab_server 1.0.6 py_0 conda-forge
kiwisolver 1.1.0 py37hc9558a2_0 conda-forge
lame 3.100 h14c3975_1001 conda-forge
libblas 3.8.0 12_openblas conda-forge
libcblas 3.8.0 12_openblas conda-forge
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 9.1.0 hdf63c60_0
libgfortran-ng 7.3.0 hdf63c60_0
libiconv 1.15 h516909a_1005 conda-forge
liblapack 3.8.0 12_openblas conda-forge
libopenblas 0.3.7 h6e990d7_1 conda-forge
libpng 1.6.37 hed695b0_0 conda-forge
libsodium 1.0.17 h516909a_0 conda-forge
libstdcxx-ng 9.1.0 hdf63c60_0
libtiff 4.0.10 h57b8799_1003 conda-forge
libuuid 2.32.1 h14c3975_1000 conda-forge
libxcb 1.13 h14c3975_1002 conda-forge
libxml2 2.9.9 h13577e0_2 conda-forge
lz4-c 1.8.3 he1b5a44_1001 conda-forge
markupsafe 1.1.1 py37h14c3975_0 conda-forge
matplotlib 3.1.0 py37h5429711_0
mistune 0.8.4 py37h14c3975_1000 conda-forge
nbconvert 5.6.0 py_0 conda-forge
nbformat 4.4.0 py_1 conda-forge
ncurses 6.1 he6710b0_1
nettle 3.4.1 h1bed415_1002 conda-forge
networkx 2.3 py_0 conda-forge
nodejs 11.14.0 he1b5a44_1 conda-forge
notebook 6.0.0 py37_0 conda-forge
numpy 1.17.0 py37h95a1406_0 conda-forge
olefile 0.46 py_0 conda-forge
openh264 1.8.0 hdbcaa40_1000 conda-forge
openssl 1.1.1c h516909a_0 conda-forge
packaging 19.2 pypi_0 pypi
pandoc 2.7.3 0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.5.1 py_0 conda-forge
pcre 8.41 hf484d3e_1003 conda-forge
pexpect 4.7.0 py37_0 conda-forge
pickleshare 0.7.5 py37_1000 conda-forge
pillow 6.1.0 py37h34e0f95_0
pip 19.2.2 py37_0
plotoptix 0.5.0 pypi_0 pypi
prometheus_client 0.7.1 py_0 conda-forge
prompt_toolkit 2.0.9 py_0 conda-forge
pthread-stubs 0.4 h14c3975_1001 conda-forge
ptyprocess 0.6.0 py_1001 conda-forge
pycparser 2.19 py37_1 conda-forge
pygments 2.4.2 py_0 conda-forge
pyopenssl 19.0.0 py37_0 conda-forge
pyparsing 2.4.2 py_0 conda-forge
pyqt 5.9.2 py37hcca6a23_2 conda-forge
pyrsistent 0.15.4 py37h516909a_0 conda-forge
pysocks 1.7.0 py37_0 conda-forge
python 3.7.4 h265db76_1
python-dateutil 2.8.0 py_0 conda-forge
pythonnet 2.4.0 pypi_0 pypi
pythreejs 2.1.1 py_0 conda-forge
pytz 2019.2 py_0 conda-forge
pywavelets 1.0.3 py37hd352d35_1 conda-forge
pyzmq 18.0.2 py37h1768529_2 conda-forge
qt 5.9.7 h52cfd70_2 conda-forge
qtconsole 4.5.3 py_0 conda-forge
readline 7.0 h7b6447c_5
requests 2.22.0 py37_1 conda-forge
scikit-image 0.15.0 py37he6710b0_0
scipy 1.3.1 py37h921218d_2 conda-forge
send2trash 1.5.0 py_0 conda-forge
setuptools 41.0.1 py37_0
sip 4.19.8 py37hf484d3e_1000 conda-forge
six 1.12.0 py37_1000 conda-forge
sqlite 3.29.0 h7b6447c_0
terminado 0.8.2 py37_0 conda-forge
testpath 0.4.2 py_1001 conda-forge
tk 8.6.8 hbc83047_0
toolz 0.10.0 py_0 conda-forge
tornado 6.0.3 py37h516909a_0 conda-forge
traitlets 4.3.2 py37_1000 conda-forge
traittypes 0.2.1 py_1 conda-forge
urllib3 1.25.3 py37_0 conda-forge
wcwidth 0.1.7 py_1 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.33.4 py37_0
widgetsnbextension 3.5.1 py37_0 conda-forge
x264 1!152.20180806 h14c3975_0 conda-forge
xorg-libxau 1.0.9 h14c3975_0 conda-forge
xorg-libxdmcp 1.1.3 h516909a_0 conda-forge
xz 5.2.4 h14c3975_4
zeromq 4.3.2 he1b5a44_2 conda-forge
zlib 1.2.11 h7b6447c_3
zstd 1.4.0 h3b9ef0a_0 conda-forge

If needed, I can provide more information, just sent me a command example.
I'm just a beginner on the linux world.

Camera module

Good day,
Could the project support the opencv camera module (i.e., camera matrix and distortion module) to save the image?
Thanks for help.

Best Regards

Material Compile Error: Symbol defined multiple times

Hi,
I am trying to run the example about materials and glass colors. However it rise a compilation error.

Here is the code:

import numpy as np
from plotoptix import TkOptiX
from plotoptix.materials import m_clear_glass, m_mirror, m_plastic  # predefined materials
from plotoptix.utils import map_to_colors  # map variable to matplotlib color map

n = 6
a = 8
s = a / n
xyz = np.mgrid[0:a:s, 0:a:s, 0:a:s].reshape(3,-1).T
rnd = np.random.uniform(0, 1, xyz.shape[0])

# most cubes with the standard material:
xyz_c_diffuse = xyz[((xyz[:,0] == 0) | (xyz[:,1] == 0) | (xyz[:,2] == 0)) & (rnd < 0.7)]
# the rest made of mirror walls:
xyz_c_mirror = xyz[((xyz[:,0] == 0) | (xyz[:,1] == 0) | (xyz[:,2] == 0)) & (rnd >= 0.7)]

# most particles made of glass:
xyz_p_glass = xyz[(xyz[:,0] > 0) & (xyz[:,1] > 0) & (xyz[:,2] > 0) & (rnd < 0.4)]
# some plastic-like particles:
xyz_p_plastic = xyz[(xyz[:,0] > 0) & (xyz[:,1] > 0) & (xyz[:,2] > 0) & (rnd > 0.9)]

optix = TkOptiX(start_now=False) # no need to open the window yet
optix.set_param(min_accumulation_step=4,     # set more accumulation frames
                max_accumulation_frames=500, # to get rid of the noise
                light_shading="Hard")        # use "Hard" light shading for the best caustics and "Soft" for fast convergence

optix.set_uint("path_seg_range", 15, 30)


optix.setup_material("glass", m_clear_glass)
optix.setup_material("plastic", m_plastic)
optix.setup_material("mirror", m_mirror)


optix.set_data("particles_g", pos=xyz_p_glass + np.array([0.5*s, 0.5*s, 0.5*s]), r=0.4*s,
               geom="ParticleSet",     # set the geometry of data points to particles
               mat="glass",            # use the glass material
               c=10)                   # and set the color to transparent, neutral
# optix.set_data("particles_p", pos=xyz_p_plastic + np.array([0.5*s, 0.5*s, 0.5*s]), r=0.4*s,
#                geom="ParticleSet",     # set geometry of to particles
#                mat="plastic",          # slightly reflective, plastic look
#                c=0.95)                 # white color

# optix.set_data("cubes_d", pos=xyz_c_diffuse, u=[0.9*s, 0, 0], v=[0, 0.9*s, 0], w=[0, 0, 0.9*s],
#                geom="Parallelepipeds", # cubes, actually default geometry
#                mat="diffuse",          # opaque, mat, default
#                c=0.95)                 # white color

# optix.set_data("cubes_m", pos=xyz_c_mirror, u=[0.9*s, 0, 0], v=[0, 0.9*s, 0], w=[0, 0, 0.9*s],
#                geom="Parallelepipeds", # cubes, same default geometry
#                mat="mirror")           # 100% reflective mirror, no color

optix.setup_camera("cam1", eye=[20, 10, 10], target=[0.5*a, 0.4*a, 0.5*a], fov=35)
optix.set_background(0)
optix.set_ambient(0)

optix.set_float("tonemap_exposure", 0.5)
optix.set_float("tonemap_gamma", 2.2)

optix.add_postproc("Gamma")      # apply gamma correction postprocessing stage, or
#optix.add_postproc("Denoiser")  # use AI denoiser (exposure and gamma are applied as well)

optix.setup_light("light1", pos=[5, 20, 5], color=10*np.array([1.0, 0.97, 0.7]), radius=4)
optix.setup_light("light2", pos=[7, 7, 20], color=15*np.array([0.7, 0.85, 1.0]), radius=3)
optix.setup_light("light3", pos=[15, 2, 2], color=15, radius=1)

optix.start()

Here is the running log:

 	[0]: GeForce RTX 2080 Ti
	Selected devices: [0]
	Primary device: 0
[ 2][COMPILE FEEDBACK]: COMPILE ERROR: 
Error: Symbol '__anyhit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_transparency_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__blurred_dot_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__cos_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__flat_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__glass_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_hard_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_soft_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'

OPTIX_ERROR_PIPELINE_LINK_ERROR: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2588)
Log:
COMPILE ERROR: 
Error: Symbol '__anyhit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_transparency_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__blurred_dot_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__cos_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__flat_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__glass_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_hard_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_soft_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'


[ 2][COMPILE FEEDBACK]: COMPILE ERROR: 
Error: Symbol '__anyhit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_transparency_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__blurred_dot_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__cos_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__flat_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__glass_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_hard_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_soft_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'

OPTIX_ERROR_PIPELINE_LINK_ERROR: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2588)
Log:
COMPILE ERROR: 
Error: Symbol '__anyhit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__occlusion_transparency_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__blurred_dot_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__cos_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__diffuse_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__flat_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__glass_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_hard_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__light_soft_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'
Error: Symbol '__closesthit__radiance__reflective_masked_0xb614949e7d10947' was defined multiple times. First seen in: '__closesthit__occlusion_and_12_more_6240569349103738604'

...

If I exclude the "mat" parameter from the set_data() method, it runs.

Do you have any suggestions on this?

Thanks!

Running on Google Colab

Hello - I am excited to try out your library on a Google Colaboratory Notebook. However, I am running into difficultly setting it up, having tried both the Linux and GCP instructions. Has this been attempted by yourself or others, and if so is it possible? Thanks!

**********************************************************************************
**********************************************************************************
Video encoding library initialization failed, encoding features are not available.
**********************************************************************************
**********************************************************************************
[ERROR] (MainThread) Initial setup failed, see errors above.
[ERROR] (MainThread) Geometry setup failed.
[ERROR] (MainThread) Camera setup failed.
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/dist-packages/plotoptix/npoptix.py", line 219, in run
    assert self._is_scene_created, "Scene is not ready, see initialization messages."
AssertionError: Scene is not ready, see initialization messages.

[ERROR] (MainThread) Raytracing output startup timed out.

Recovering the hit primitive ID

Good day,
I'm using the following code:

import numpy as np
from plotoptix import TkOptiX
from plotoptix import NpOptiX
import matplotlib.pyplot as plt

nu = 5
nv = 5
    
def displayResults(rt):

    print("Launch finished.")

    hitPositionsData = rt._hit_pos
    xHitPositions = hitPositionsData[:, :, 0]
    yHitPositions = hitPositionsData[:, :, 1]
    zHitPositions = hitPositionsData[:, :, 2]
    dHitPositions = hitPositionsData[:, :, 3]

    hitTriangle   = rt._geo_id[:, :, 0].reshape(rt._height, rt._width)
    
    print("Shape of rays array is {}.".format(xHitPositions.shape))

    print(xHitPositions)
    
    xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
    yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]

    #hitTriangle[hitTriangle >= 100] = 0

    print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

    print(rt._geo_id[:, :, 0].reshape(rt._height, rt._width))

    plt.plot(xHitPositions, yHitPositions, 'bo')
    plt.show()

    plt.imshow(dHitPositions)
    plt.colorbar()
    plt.show()

    plt.imshow(hitTriangle)
    plt.colorbar()
    plt.show()

    plt.draw()

verticesTriangle1   = np.array([[-2, -2, 0], [2, -2, 0], [-2, 2, 0]])
verticesTriangle2   = np.array([[ 2, -2, 0], [2,  2, 0], [-2, 2, 0]])
faceTriangle1       = np.array([0, 1, 2])
faceTriangle2       = np.array([0, 1, 2])

rt                  = NpOptiX(on_rt_accum_done = displayResults, width = nu, height = nv)

rt.set_mesh("Mesh1", verticesTriangle1, faceTriangle1)
rt.set_mesh("Mesh2", verticesTriangle2, faceTriangle2)

u                   = np.linspace(-2, 2, nu)
v                   = np.linspace(-2, 2, nv)
V, U                = np.meshgrid(v, u)
W                   = np.full((nu, nv), -1)
originsTexture      = np.stack((U, V, W, np.zeros((nu, nv)))).T

rt.set_texture_2d("origins", originsTexture)
 
cx                  = np.zeros((nu, nv))
cy                  = np.zeros((nu, nv))
cz                  = np.ones((nu, nv))
r                   = np.full((nu, nv), 200)
directionsTexture   = np.stack((cx, cy, cz, r)).T

rt.set_texture_2d("directions", directionsTexture)
 
rt.setup_camera("custom_cam", cam_type = "CustomProjXYZtoDir", textures=["origins", "directions"])

rt.set_param(max_accumulation_frames = 1)

rt.start()

#rt.close()

By rt._geo_id[:, :, 0], I would like to infer the ID of the primitive hit by the rays. However, the output seems to be:

[[4294967295 4294967295 4294967295 4294967295 4294967295]
 [         1          1 1073741825 1073741825 4294967295]
 [2147483649 2147483649 1073741825          2 4294967295]
 [2147483649 2147483649 2147483650 1073741826 4294967295]
 [2147483649 2147483650 1073741826 1073741826 4294967295]]

The large numbers at the borders of the matrix mean hit miss. However, I have only two primitives in the mesh and I do not understand why do I have more IDs than primitives.

Getting launch parameters from inside a on_rt_accum_done launched function

Good day, I'm dealing with the following code:

import numpy as np
from plotoptix import TkOptiX
from plotoptix import NpOptiX
import matplotlib.pyplot as plt

nu = 50
nv = 50
    
def displayResults(rt):

    print("Launch finished.")

    hitPositionsData = rt._hit_pos
    xHitPositions = hitPositionsData[:, :, 0]
    yHitPositions = hitPositionsData[:, :, 1]
    zHitPositions = hitPositionsData[:, :, 2]
    dHitPositions = hitPositionsData[:, :, 3]

    hitTriangle   = rt._geo_id[:, :, 1].reshape(rt._height, rt._width)

    print("Shape of rays array is {}.".format(xHitPositions.shape))

    print(xHitPositions.reshape(rt._height, rt._width))
    print(yHitPositions.reshape(rt._height, rt._width))

    xHitPositions = xHitPositions[hitTriangle < 0xFFFFFFFF]
    yHitPositions = yHitPositions[hitTriangle < 0xFFFFFFFF]
    dHitPositions[np.where(hitTriangle >= 0xFFFFFFFF)] = -1
    hitTriangle[np.where(hitTriangle >= 0xFFFFFFFF)] = 3

    print("Shape of hitting rays array is {}.".format(xHitPositions.shape))

    plt.plot(xHitPositions, yHitPositions, 'bo')
    plt.show()

    plt.imshow(dHitPositions)
    plt.colorbar()
    plt.show()

    plt.imshow(hitTriangle)
    plt.colorbar()
    plt.show()

    plt.draw()

verticesTriangle    = np.array([[-2, -2, 0], [2, -2, 0], [-2, 2, 0], [2,  2, 0]])
faceTriangle        = np.array([[0, 1, 2], [1, 2, 3]])

rt                  = NpOptiX(on_rt_accum_done = displayResults, width = nu, height = nv)

rt.set_mesh("Mesh", verticesTriangle, faceTriangle)

u                   = np.linspace(-2, 2, nu)
v                   = np.linspace(-2, 2, nv)
V, U                = np.meshgrid(v, u)
W                   = np.full((nu, nv), -1)
originsTexture      = np.stack((U, V, W, np.zeros((nu, nv)))).T

rt.set_texture_2d("origins", originsTexture)
 
cx                  = np.zeros((nu, nv))
cy                  = np.zeros((nu, nv))
cz                  = np.ones((nu, nv))
r                   = np.full((nu, nv), 200)
directionsTexture   = np.stack((cx, cy, cz, r)).T

rt.set_texture_2d("directions", directionsTexture)
 
rt.setup_camera("custom_cam", cam_type = "CustomProjXYZtoDir", textures=["origins", "directions"])

rt.set_param(max_accumulation_frames = 1)

rt.start()

#rt.close()

I would like now to recover some ray launch parameters from inside the displayResults function invoked on_rt_accum_done, for example, the ray origins u, v and w, or the ray directions directionsTexture. How could I access such data?

Failing to initialize Pythonnet

In version 0.14.4, while everything seems to run fine, I'm getting the following RuntimeError

Failed to initialize pythonnet: System.NullReferenceException: Object reference not set to an instance of an object
  at Python.Runtime.ImportHook.UpdateCLRModuleDict () [0x00014] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.ImportHook.GetCLRModule () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonEngine.InitExt () [0x00060] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Loader.Initialize (System.IntPtr data, System.Int32 size) [0x0002f] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.ImportHook.UpdateCLRModuleDict () [0x00014] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.ImportHook.GetCLRModule () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonEngine.InitExt () [0x00060] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Loader.Initialize (System.IntPtr data, System.Int32 size) [0x0002f] in <02a0d26b83f24e67b6a0456fd958e703>:0 Failed to shutdown pythonnet: System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance.
  at System.Lazy`1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) [0x00043] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].CreateValue () [0x00047] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].get_Value () [0x0000a] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at Python.Runtime.Runtime.get_InteropModule () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.TryDecodePyErr (Python.Runtime.BorrowedReference typeRef, Python.Runtime.BorrowedReference valRef, Python.Runtime.BorrowedReference tbRef) [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.FetchCurrentOrNull (System.Runtime.ExceptionServices.ExceptionDispatchInfo& dispatchInfo) [0x0007e] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.ThrowLastAsClrException () [0x00005] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.NewReferenceExtensions.BorrowOrThrow (Python.Runtime.NewReference& reference) [0x0000f] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PyModule.Import (System.String name) [0x00015] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Runtime+<>c__DisplayClass42_0.<GetModuleLazy>b__0 () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at System.Lazy`1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) [0x00043] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].CreateValue () [0x00047] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].get_Value () [0x0000a] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at Python.Runtime.Runtime.get_InteropModule () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.TryDecodePyErr (Python.Runtime.BorrowedReference typeRef, Python.Runtime.BorrowedReference valRef, Python.Runtime.BorrowedReference tbRef) [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.FetchCurrentOrNull (System.Runtime.ExceptionServices.ExceptionDispatchInfo& dispatchInfo) [0x0007e] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.ThrowLastAsClrException () [0x00005] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.NewReferenceExtensions.BorrowOrThrow (Python.Runtime.NewReference& reference) [0x0000f] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PyObject.ToString () [0x00012] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.InternString.Shutdown () [0x0002b] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Runtime.Shutdown () [0x000c3] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonEngine.Shutdown () [0x00064] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Loader.Shutdown (System.IntPtr data, System.Int32 size) [0x00026] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at System.Lazy`1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) [0x00043] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].CreateValue () [0x00047] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].get_Value () [0x0000a] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at Python.Runtime.Runtime.get_InteropModule () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.TryDecodePyErr (Python.Runtime.BorrowedReference typeRef, Python.Runtime.BorrowedReference valRef, Python.Runtime.BorrowedReference tbRef) [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.FetchCurrentOrNull (System.Runtime.ExceptionServices.ExceptionDispatchInfo& dispatchInfo) [0x0007e] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.ThrowLastAsClrException () [0x00005] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.NewReferenceExtensions.BorrowOrThrow (Python.Runtime.NewReference& reference) [0x0000f] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PyModule.Import (System.String name) [0x00015] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Runtime+<>c__DisplayClass42_0.<GetModuleLazy>b__0 () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at System.Lazy`1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) [0x00043] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].CreateValue () [0x00047] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at System.Lazy`1[T].get_Value () [0x0000a] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at Python.Runtime.Runtime.get_InteropModule () [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.TryDecodePyErr (Python.Runtime.BorrowedReference typeRef, Python.Runtime.BorrowedReference valRef, Python.Runtime.BorrowedReference tbRef) [0x00000] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.FetchCurrentOrNull (System.Runtime.ExceptionServices.ExceptionDispatchInfo& dispatchInfo) [0x0007e] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonException.ThrowLastAsClrException () [0x00005] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.NewReferenceExtensions.BorrowOrThrow (Python.Runtime.NewReference& reference) [0x0000f] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PyObject.ToString () [0x00012] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.InternString.Shutdown () [0x0002b] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Runtime.Shutdown () [0x000c3] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.PythonEngine.Shutdown () [0x00064] in <02a0d26b83f24e67b6a0456fd958e703>:0 
  at Python.Runtime.Loader.Shutdown (System.IntPtr data, System.Int32 size) [0x00026] in <02a0d26b83f24e67b6a0456fd958e703>:0 Exception ignored in atexit callback: <function unload at 0x7f5a74ee2170>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pythonnet/__init__.py", line 158, in unload
    raise RuntimeError("Failed to call Python.NET shutdown")

Using the following versions

pycparser==2.21
pythonnet==3.0.1

I'm guessing there might just be a version mismatch here? Are there known versions that work with 0.14.14?

Video encoding library initialization failed, encoding features are not available.

Hello, thank you for the great work! I'm trying to import "from plotoptix import TkOptiX" on the remote server, but I encountered the following error:



Video encoding library initialization failed, encoding features are not available.



    [0]: NVIDIA GeForce RTX 2080 Ti

I'm working with an RTX 2080 Ti, Driver Version: 535.161.08 and CUDA Version: 12.2. Also FFmpeg == 7.0 and I downloaded tkinter and PyQt but still not works.. What can I try to resolve this error? Thank you!

Does not work on Ubuntu

I installed plotoptix following the instructions in documentation, however, when I tried to run the example in the readme:

import numpy as np
from plotoptix import TkOptiX

n = 1000000                                  # 1M points, better not try this with matplotlib
xyz = 3 * (np.random.random((n, 3)) - 0.5)   # random 3D positions
r = 0.02 * np.random.random(n) + 0.002       # random radii

plot = TkOptiX()
plot.set_data("my plot", xyz, r=r)
plot.show()

And I got the following error message:

********************************************************************************
********************************************************************************
.NET ray tracing libraries initialization failed, cannot continue.
********************************************************************************
********************************************************************************
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/.local/lib/python3.10/site-packages/plotoptix/_load_lib.py in __init__(self)
    546         try:
--> 547             json_assembly = clr.System.Reflection.Assembly.LoadFile(json_name)
    548             tiff_assembly = clr.System.Reflection.Assembly.LoadFile(tiff_name)

AttributeError: module 'clr' has no attribute 'System'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-19d747a1c849> in <module>
      1 import numpy as np
----> 2 from plotoptix import TkOptiX
      3 
      4 n = 1000000                                  # 1M points, better not try this with matplotlib
      5 xyz = 3 * (np.random.random((n, 3)) - 0.5)   # random 3D positions

~/.local/lib/python3.10/site-packages/plotoptix/__init__.py in <module>
     22 # import PlotOptiX modules ###############################################
     23 from plotoptix.enums import *
---> 24 from plotoptix.npoptix import NpOptiX
     25 from plotoptix.tkoptix import TkOptiX
     26 

~/.local/lib/python3.10/site-packages/plotoptix/npoptix.py in <module>
     15 from plotoptix.geometry import GeometryMeta
     16 from plotoptix._load_lib import load_optix, PARAM_NONE_CALLBACK, PARAM_INT_CALLBACK
---> 17 from plotoptix.utils import _make_contiguous_vector, _make_contiguous_3d
     18 from plotoptix.enums import *
     19 

~/.local/lib/python3.10/site-packages/plotoptix/utils.py in <module>
     12 from plotoptix.enums import GpuArchitecture, ChannelOrder
     13 
---> 14 _optix = load_optix()
     15 
     16 

~/.local/lib/python3.10/site-packages/plotoptix/_load_lib.py in load_optix()
   1154         optix = _load_optix_win()
   1155     elif PLATFORM == "Linux":
-> 1156         optix = _ClrOptiX()
   1157     else:
   1158         raise NotImplementedError

~/.local/lib/python3.10/site-packages/plotoptix/_load_lib.py in __init__(self)
    552             print(".NET ray tracing libraries initialization failed, cannot continue.")
    553             print(80 * "*"); print(80 * "*")
--> 554             raise ImportError
    555 
    556         clr.AddReference(os.path.splitext(tail)[0])

ImportError: 

My system is Ubuntu 22.04, with Nvidia driver version: 510.73.05 and CUDA version 11.6, the required package mentioned in README.rst.

According to the message, I checked the corresponding file _load_lib.py line 539-554:

        json_name = os.path.join(os.path.dirname(__file__), BIN_PATH, "Newtonsoft.Json.dll")
        tiff_name = os.path.join(os.path.dirname(__file__), BIN_PATH, "BitMiracle.LibTiff.NET.dll")
        rnd_name = os.path.join(os.path.dirname(__file__), BIN_PATH, "RnD.SharpOptiX.dll")

        head, tail = os.path.split(rnd_name)
        sys.path.append(head)

        try:
            json_assembly = clr.System.Reflection.Assembly.LoadFile(json_name)
            tiff_assembly = clr.System.Reflection.Assembly.LoadFile(tiff_name)
            rnd_assembly = clr.System.Reflection.Assembly.LoadFile(rnd_name)
        except:
            print(80 * "*"); print(80 * "*")
            print(".NET ray tracing libraries initialization failed, cannot continue.")
            print(80 * "*"); print(80 * "*")
            raise ImportError

It seems that even in Linux, the python code still tries to load .dll files, which is supposed to work only on windows. From my understanding, the equivalence shall be somthing.so right? Is it a bug of the code or configuration issue of my system that misleads the code going to this branch?

Thanks a lot!

Are you going to support Linux?

I've found your package and it looks amazing! Great job! πŸ‘ πŸ₯‡ Are you going to support Linux? Do you have a roadmap for package development?

Docker: Compatible device(s) not found / OptiX not initialized.

I'm trying to run plotoptix within a docker container via
docker run -it -e NVIDIA_VISIBLE_DEVICES=all --gpus all render-slim bash --

However, when calling

from plotoptix import NpOptiX
NpOptiX(start_now=True, devices=[0])

I get

[Py-C# interop]
OptiX initialization failed.
Unknown OptixResult code: Compatible device(s) not found / OptiX not initialized.
PathTracer destructor failed.
[ERROR] (MainThread) Initial setup failed, see errors above.
<NpOptiX(Thread-1, initial)>

nvidia-smi output

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 3090 Ti      On | 00000000:01:00.0 Off |                  Off |
|  0%   45C    P8               26W / 450W|      3MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

Here's my Dockerfile:

FROM python:3.10.11-slim-bullseye

ARG DEBIAN_FRONTEND=noninteractive
ARG CUDA_VER=11-7

# Install deps
RUN apt-get update && apt-get install -y curl \
  git \
  gcc \
  ffmpeg \
  libsm6 \
  libxext6 \
  libpq-dev \
  clang \
  libglib2.0-dev

# Install python
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install -y python3.10 python-is-python3

# install CUDA and GPU driver
RUN apt-get install -y gnupg2
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/3bf863cc.pub \
    && add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/ /" \
    && add-apt-repository contrib \
    && apt-get update
RUN apt-get install -y cuda-nvcc-${CUDA_VER} cuda-libraries-${CUDA_VER} cuda-cudart-${CUDA_VER}

ENV CUDA_PATH /usr/local/cuda-${CUDA_VER}
ENV PATH $CUDA_PATH/bin:$PATH
ENV LD_LIBRARY_PATH $CUDA_PATH/lib64:$LD_LIBRARY_PATH

# install Mono
RUN apt -y install gnupg ca-certificates
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt install -y libgdiplus
RUN apt update && apt -y install mono-complete

# Install plotoptix
RUN pip install --upgrade pip
RUN pip install pycparser
RUN pip install pythonnet
RUN pip install plotoptix

# Install general dependencies
RUN pip install numpy scipy matplotlib pandas scikit-learn scikit-image seaborn torch Pillow ipython opencv-python
RUN apt-get install -y python3-tk

# Tried with and w/o the following lines
COPY NVIDIA-OptiX-SDK-7.7.0-linux64-x86_64.sh .
RUN sh NVIDIA-OptiX-SDK-7.7.0-linux64-x86_64.sh --skip-license --prefix=/opt/OptiX --include-subdir

ENV PATH /optix/OptiX/SDK:$PATH
ENV PATH /optix/OptiX:$PATH
ENV PATH /optix/OptiX/include:$PATH
ENV LD_LIBRARY_PATH /optix/OptiX:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH /optix/OptiX/include:$LD_LIBRARY_PATH

I've also tried this with a similar image based on nvidia/cuda:11.7.0-cudnn8-devel-ubuntu20.04 with the same result.

I've tried running this on the following GPUs:

  • GeForce 4090
  • A100
  • A10G
  • T4

Any pointers on how to resolve?

About loading "denoiser"

Dear author, I have nearly installed and can use plotoptimx, but when I do "Python - M plotoptimx. Install denoiser", it will display "downloading failed. Package not installed." do you know why?

ModuleNotFoundError: No module named 'System'

command:

python3 ~/plotoptix/examples/1_basics/0_try_plotoptix.py

error:

Traceback (most recent call last):
  File "0_try_plotoptix.py", line 2, in <module>
    from plotoptix import TkOptiX
  File "/home/kb/anaconda3/envs/ppd/lib/python3.6/site-packages/plotoptix/__init__.py", line 24, in <module>
    from plotoptix.npoptix import NpOptiX
  File "/home/kb/anaconda3/envs/ppd/lib/python3.6/site-packages/plotoptix/npoptix.py", line 15, in <module>
    from plotoptix.geometry import GeometryMeta
  File "/home/kb/anaconda3/envs/ppd/lib/python3.6/site-packages/plotoptix/geometry.py", line 15, in <module>
    from plotoptix._load_lib import load_optix
  File "/home/kb/anaconda3/envs/ppd/lib/python3.6/site-packages/plotoptix/_load_lib.py", line 17, in <module>
    from System import IntPtr, Int64
ModuleNotFoundError: No module named 'System'
Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 21:15:04) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> from System import String
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'System'

Error on changing material

In v0.17 TkOptiX, with RTX 3090, driver 536.23
when I want to change the material of a loaded .OBJ file

rt.setup_material("cover", m_matt_plastic)
rt.setup_material("flat", m_flat)

rt.load_merged_mesh_obj(mesh_path, mesh_name="test1", c=0.92, mat='cover')
rt.set_data("test2", geom="Parallelepipeds", pos=[(-20, 0, -20)], u=[300, 0, 0], v=[0, 0, 300], w=[0, thickness, 0], c=0.5,
            mat="my_loaded_jpg_texture")

and when I try to change the material of test1 in the callback of

def update_scene(rt: TkOptiX) -> None:
        rt.set_data('test1', mat='flat')  # DOES NOT WORK
        # rt.update_data('test1', mat='flat')  # DOES NOT WORK EITHER
        rt.set_data('test2', mat='flat')  # DOES WORK

rt = TkOptiX(on_rt_completed=update_scene)

I get an

ERROR] (Dummy-21 ) Geometry update failed.**

for changing test1. Changing test2 works without any issue...
What might be the problem here?

Zero RGBA values in save_image

Hi,

I am just getting started with plotoptix and testing out the examples provided. I can successfully run all of them on an NVIDIA Quadro card with no errors, but whenever I try to add e.g.

rt.save_image("rt_output_8bps.jpg")

I get as an output a black image (cfr examples/1_basics/10_1_save_hdr_environment_map.ipynb). Printing rt.get_rt_output() to terminal indeed returns an array of the correct shape, but filled with all zeros.
The same happens for different examples, which I edited only by adding the line above.

Please, let me know if I can provide further details for reproducing this behavior and I apologize in advance if this is due to something obvious I may have missed.

Thanks for your help.

Error installing examples

In a fresh install of Anaconda, with a fresh env created for plotoptix, there is an error trying to add the examples folder:

(plotoptix) C:\Users\XXXXX>python -m plotoptix.install examples
Traceback (most recent call last):
File "D:\anaconda3\envs\plotoptix\lib\runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "D:\anaconda3\envs\plotoptix\lib\runpy.py", line 147, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "D:\anaconda3\envs\plotoptix\lib\runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "D:\anaconda3\envs\plotoptix\lib\site-packages\plotoptix\install\__init__.py", line 16, in <module>
import requests, os
ModuleNotFoundError: No module named 'requests'

The requests library should be added to package requirements I think

issue on running a python script

Dear plotoptix developers,

I have installed plotoptix in a cluster to visualize some results. I have a python script to do this. When I tried to run plotoptix using this command β€œpython3 ”, I got this error:
β€œ
(SlenderBody) [[email protected] plots]$ python3 BundledFibers.py 240



Video encoding library initialization failed, encoding features are not available.





Low level ray tracing libraries initialization failed, cannot continue.



Traceback (most recent call last):
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/site-packages/plotoptix/_load_lib.py", line 1208, in init
c_rnd = cdll.LoadLibrary(os.path.join(os.path.dirname(file), BIN_PATH, "librndSharpOptiX7.so"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/ctypes/init.py", line 454, in LoadLibrary
return self._dlltype(name)
^^^^^^^^^^^^^^^^^^^
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/ctypes/init.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libcuda.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/home01/scnhv/SlenderBody/Python/plots/BundledFibers.py", line 15, in
from plotoptix import TkOptiX
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/site-packages/plotoptix/init.py", line 24, in
from plotoptix.npoptix import NpOptiX
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/site-packages/plotoptix/npoptix.py", line 17, in
from plotoptix.utils import _make_contiguous_vector, _make_contiguous_3d
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/site-packages/plotoptix/utils.py", line 14, in
_optix = load_optix()
^^^^^^^^^^^^
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/site-packages/plotoptix/_load_lib.py", line 2007, in load_optix
optix = _ClrOptiX_v3()
^^^^^^^^^^^^^^
File "/home/home01/scnhv/.conda/envs/SlenderBody/lib/python3.11/site-packages/plotoptix/_load_lib.py", line 1213, in init
raise ImportError
ImportError
(SlenderBody) [[email protected] plots]$

β€œ
I would be wondering if you could kindly guide me on this issue.

Best regards,
Nasrollah Hajaliakbari

Adding a mesh after calling rt.start() not working

If the raytracing loop is started after adding a mesh everything works as expected, if the first mesh is added after calling start() the following error is raised:

OPTIX_ERROR_INVALID_VALUE: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2721) Log: COMPILE ERROR: pipeline compile option usesPrimitiveTypeFlags for "programGroups[0].raygen.module" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[1].miss.module" does not match value from pipeline creation Info: Pipeline has 4 module(s), 4 entry function(s), 3 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 143 basic block(s) in entry functions, 2343 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions

If a mesh is added first before calling start(), the next mesh that is added does not raise this error. This only occurs if the scene is empty when starting the loop. I assume this is a bug and not intended?

PBR Materials Support

Do you have any examples on how to use PBR materials in plotoptix? I'm working on transitioning rendering a trimesh scene from pyrender to plotoptix and trying to figure out the easiest way to map materials

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.