NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.43k stars 157 forks source link

Implementation of setgpu.lib #144

Closed XiaoXuan42 closed 1 year ago

XiaoXuan42 commented 1 year ago

I have trouble in getting opengl to work on different gpu in my project and I want to learn from your practice. If I'm right nvdiffrast uses setgpu.lib to select gpu and the source code is missing. Can you provide some guides on how to select gpu for opengl on linux(ubuntu)?

s-laine commented 1 year ago

That library is Windows-only. On Linux, nvdiffrast uses EGL's functionality to enumerate display devices and select the one that has the correct Cuda device index. While it's not exactly what you're looking for, you can find the function in nvdiffrast/common/glutil.cpp, line 265. I hope this helps you forward.

XiaoXuan42 commented 1 year ago

Thank you! I'll search for equivalent api of opengl.