NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.39k stars 148 forks source link

Error when trying to use other gpus rather than gpu 0 #11

Closed hiyyg closed 3 years ago

hiyyg commented 3 years ago

Hello, I try to run nvdiffrast on other gpus rather than gpu 0 by running: CUDA_VISIBLE_DEVICES=1 python samples/torch/triangle.py However, I got this error:

Traceback (most recent call last):
  File "samples/torch/triangle.py", line 26, in <module>
    rast, _ = dr.rasterize(glctx, pos, tri, resolution=[256, 256])
  File "nvdiffrast/nvdiffrast/torch/ops.py", line 227, in rasterize
    return _rasterize_func.apply(glctx, pos, tri, resolution, ranges, grad_db)
  File "nvdiffrast/nvdiffrast/torch/ops.py", line 169, in forward
    out, out_db = _get_plugin().rasterize_fwd(glctx.cpp_wrapper, pos, tri, resolution, ranges)
RuntimeError: CUDA error: invalid device ordinal

How can I solve this problem?

hiyyg commented 3 years ago

solved

s-laine commented 3 years ago

Hi hiyyg and sorry for the delayed reply. Proper multi-GPU support is currently missing from the library but I'm going to start working on it soon. If it's not too much trouble, I'd like to hear what your solution was - my current plan for Linux is to use the eglGetPlatformDisplayEXT() extension. Is this perhaps what you did, or did you find some other solution?

hiyyg commented 3 years ago

Exactly.