The above code can run normally in a real environment, but cannot run in WSL2!
How to solve it or what alternative solutions are available to prevent the download of memory from the GPU to the CPU from increasing program time!
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia python test_opencv_gl.py
QStandardPaths: wrong permissions on runtime directory /run/user/1000/, 0755 instead of 0700
Traceback (most recent call last):
File "/home/cy/gpu_env/test_opencv_gl.py", line 6, in <module>
cv2.imshow("Test GUI", img)
cv2.error: OpenCV(4.9.0) /home/cy/gpu_env/opencv/opencv-4.9.0/modules/core/src/opengl.cpp:176: error: (-217:Gpu API call) OS call failed or operation not supported on this OS in function 'registerBuffer'
Glxgears is running normally!
If the GPU's GpuMat is downloaded to the CPU's Mat, it can be displayed normally!
Windows build number:
10.0.22621.3737
Your Distribution version:
Ubuntu22.04
Your WSL versions:
WSL version: 2.2.4.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.61 MSRDC version: 1.2.5326 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26091.1-240325-1447. ge release Windows version: 10.0.22621.3737
Steps to reproduce:
Operating Environment
WSL logs:
No response
WSL dumps:
No response
Expected behavior:
The above code can run normally in a real environment, but cannot run in WSL2! How to solve it or what alternative solutions are available to prevent the download of memory from the GPU to the CPU from increasing program time!
Actual behavior:
Glxgears is running normally!
If the GPU's GpuMat is downloaded to the CPU's Mat, it can be displayed normally!