alievk / npbg

Neural Point-Based Graphics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Something wrong with pycuda while running viewer.py

FrozenSilent opened this issue · comments

Hello! Thanks for sharing the code! I just want to test the code by viewing some results, but I encounter some problems with the following line.

import pycuda.gl.autoinit # this may fails in headless mode

And the error message is as follows:

loading pointcloud...
=== 3D model ===
VERTICES:  3072078
EXTENT:  [-16.5258255  -14.02860832 -30.76384926] [ 10.81384468   2.03398347 -20.07631493]
================
new viewport size  (1024, 1024)
[i] HiDPI detected, fixing window size
[w] Cannot read STENCIL size from the framebuffer
Unable to load numpy_formathandler accelerator from OpenGL_accelerate
[i] Using GLFW (GL 3.1)
Traceback (most recent call last):
  File "/mnt/sda/yuanyujie/sig21/code/npbg/npbg/gl/render.py", line 29, in _init_buffers
    import pycuda.gl.autoinit  # this may fails in headless mode
  File "/mnt/sda/yuanyujie/anaconda3/envs/npbg/lib/python3.6/site-packages/pycuda-2020.1-py3.6-linux-x86_64.egg/pycuda/gl/autoinit.py", line 10, in <module>
    context = make_default_context(lambda dev: cudagl.make_context(dev))
  File "/mnt/sda/yuanyujie/anaconda3/envs/npbg/lib/python3.6/site-packages/pycuda-2020.1-py3.6-linux-x86_64.egg/pycuda/tools.py", line 229, in make_default_context
    "on any of the %d detected devices" % ndevices
RuntimeError: make_default_context() wasn't able to create a context on any of the 3 detected devices

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "viewer.py", line 435, in <module>
    my_app = MyApp(args)
  File "viewer.py", line 178, in __init__
    clear_color=args.clear_color)
  File "/mnt/sda/yuanyujie/sig21/code/npbg/npbg/gl/render.py", line 19, in __init__
    self._init_buffers(viewport_size, out_buffer_location)
  File "/mnt/sda/yuanyujie/sig21/code/npbg/npbg/gl/render.py", line 31, in _init_buffers
    raise RuntimeError('PyCUDA init failed, cannot use torch buffer')
RuntimeError: PyCUDA init failed, cannot use torch buffer

I tested the code on RTX 2080Ti with CUDA 10.0.130.

Hi @FrozenSilent,
Please try to use the following viewer.py instead: https://gist.github.com/seva100/93e8c4bdc5f929f1790e370542ab101f
This one does not require pycuda.

Thank you for the quick reply! The problem is solved.