GeometryCollective / ddg-exercises

Assignment skeleton for course on Discrete Differential Geometry (15-458/858)
187 stars 74 forks source link

Displays but doesn't respond to mouse or keyboard - Windows/Mesa #5

Closed Bathsheba closed 2 years ago

Bathsheba commented 2 years ago

Trying to do the first coding exercise in Windows 10 Pro 21H2 using wsl2 Ubuntu with VcXsrv. I've installed all dependencies and have a completely clean compile, not in debug mode.
It launches and the Polyscope window displays the sample mesh, or if I provide an OBJ it displays that correctly. The frame rate updates, it's definitely running. But it won't interact, the controls don't receive mouse clicks or keypresses. With one exception: the mousewheel works to zoom the mesh in and out. Driving me nuts because SO CLOSE to working. xeyes, xcalc, glxgears run normally and receive mouse and keyboard inputs as they should.

I tried default, kisak and oibaf Mesa, all give the same results. [polyscope] Backend: openGL3_glfw -- Loaded openGL version: 3.3 (Core Profile) Mesa 21.2.6 [polyscope] Backend: openGL3_glfw -- Loaded openGL version: 3.3 (Core Profile) Mesa 22.0.0 - kisak-mesa PPA [polyscope] Backend: openGL3_glfw -- Loaded openGL version: 4.2 (Core Profile) Mesa 22.1.0-devel (git-b7fbaf9 2022-03-16 focal-oibaf-ppa) I can't switch to pure Nvidia because Windows only allows this in its bleediest-edge update channel right now, and I do actually need this machine to work.

At https://github.com/cmu-geometry/ddg-exercises-js/issues/1 it's suggested this problem may be due to compiler over-optimization. I tried adding -O0 to the compiler flags without improvement, and that's as much as I can figure out. Help?

Thanks, Bathsheba

$ glxinfo -B name of display: 172.17.32.1:0 display: 172.17.32.1:0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: Microsoft Corporation (0xffffffff) Device: D3D12 (NVIDIA GeForce GTX 1070) (0xffffffff) Version: 22.1.0 Accelerated: yes Video memory: 24436MB Unified memory: no Preferred profile: core (0x1) Max core profile version: 4.2 Max compat profile version: 4.2 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.1 OpenGL vendor string: Microsoft Corporation OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1070) OpenGL core profile version string: 4.2 (Core Profile) Mesa 22.1.0-devel (git-b7fbaf9 2022-03-16 focal-oibaf-ppa) OpenGL core profile shading language version string: 4.20 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile

OpenGL version string: 4.2 (Compatibility Profile) Mesa 22.1.0-devel (git-b7fbaf9 2022-03-16 focal-oibaf-ppa) OpenGL shading language version string: 4.20 OpenGL context flags: (none) OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.1.0-devel (git-b7fbaf9 2022-03-16 focal-oibaf-ppa) OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

mwmuni commented 2 years ago

A few things you should try to isolate the problem:

  1. Check if it works without specifying any optimisation flags, not even -O0
  2. If it fails with no flags, it's not an optimisation problem
  3. Check if it works when specifying the -Og flag
  4. If -Og fixes it, it is an optimisation problem; continue to 3.
  5. Check each -Og flag with -O1 to see which one is causing your problem (or try half, then the other half, like a binary search)

It should be noted that -Og uses a restricted set of -O1 flags.

-O1 flags that are disabled by -Og: -fbranch-count-reg -fdelayed-branch -fdse -fif-conversion -fif-conversion2 -finline-functions-called-once -fmove-loop-invariants -fmove-loop-stores -fssa-phiopt -ftree-bit-ccp -ftree-dse -ftree-pta -ftree-sra

An example of a disabled version of a flag: -ftree-dse -> -fno-tree-dse

Also, make sure everything is up to date, including running wsl --update Also also, if updating to Windows 11 is an option, GPU acceleration for wsl2 is in regular Windows 11. You don't need Insiders for it.

source

Bathsheba commented 2 years ago

Thanks for looking into this! Removing all -O flags from CMakeLists and CMakeCache didn't work, so I fail at #2.

Everything here is up to date. I'd rather not move to Windows 11 at this time, though I guess it's that or nothing now. Differential geometry is harder than I thought it would be.

keenancrane commented 2 years ago

Hi @Bathsheba,

Sorry you're having so much trouble here—we are definitely weakest on Windows platform support, but I know that some students in my class do get it working (though unfortunately I don't know how!).

Since these exercises are really just lightly built on top of two external libraries, Polyscope and GeometryCentral, I would suggest you post your troubles there. Nick Sharp in particular (the main author of those two packages) probably has plenty to say on how to best get things working on Windows, and/or you may find other users who have worked through similar issues (in the GitHub Issues, for instance).

Hope that helps,

Keenan

Bathsheba commented 2 years ago

Thank you, I posted an issue at the Polyscope repo.

Bathsheba commented 2 years ago

Moved to Windows 11 and now it works out of the box, in wsl with Mesa.