You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have discovered that under certain NVIDIA driver versions and OpenGL versions, using nvdiffrast within kaolin to render causes errors. As mentioned in this issue sicxu/Deep3DFaceRecon_pytorch#2, the problem is related to the use of nvdiff.RasterizeGLContext instead of nvdiff.RasterizeCudaContext. I noticed that in the kaolin code, the Context is initialized and fixed to always be GLContext.
After changing this to nvdiff.RasterizeCudaContext and recompiling kaolin, I used kal.render.mesh.rasterize and selected 'nvdiffrast' as the backend for rendering. The result was normal, with the only issue being that the output must be a multiple of 8.
I would like to know if there are plans in future versions to make the Context type a selectable parameter. Additionally, I would like to inquire if there is a need to contribute a pull request.
The text was updated successfully, but these errors were encountered:
In fact, there is an option to set the default context without recompiling the code with: kal.render.mesh.nvdiffrast_context.nvdiffrast_use_cuda(). However, it looks like there is a bug in that function (thank you for alerting us to it).
You can still bypass that bug and set your preferred context using:
import kaolin as kal
import nvdiffrast.torch
kal.render.mesh.nvdiffrast_context.set_default_nvdiffrast_context(
nvdiffrast.torch.RasterizeCudaContext("cuda"), "cuda")
print(kal.render.mesh.nvdiffrast_context.default_nvdiffrast_context(device="cuda"))
# Prints: <nvdiffrast.torch.ops.RasterizeCudaContext object at 0x7fc42c2164c0>
I have discovered that under certain NVIDIA driver versions and OpenGL versions, using nvdiffrast within kaolin to render causes errors. As mentioned in this issue sicxu/Deep3DFaceRecon_pytorch#2, the problem is related to the use of
nvdiff.RasterizeGLContext
instead ofnvdiff.RasterizeCudaContext
. I noticed that in the kaolin code, the Context is initialized and fixed to always beGLContext
.kaolin/kaolin/render/mesh/rasterization.py
Lines 35 to 39 in 5406915
After changing this to
nvdiff.RasterizeCudaContext
and recompiling kaolin, I usedkal.render.mesh.rasterize
and selected 'nvdiffrast' as the backend for rendering. The result was normal, with the only issue being that the output must be a multiple of 8.I would like to know if there are plans in future versions to make the Context type a selectable parameter. Additionally, I would like to inquire if there is a need to contribute a pull request.
The text was updated successfully, but these errors were encountered: