Open sjkorvin opened 3 years ago
@sjkorvin, thanks for reporting the issue, have you tried this with GPU acceleration disabled? While I can't be sure if GPU is the sole root cause, but the "dxgk:err:" in dmesg indicates WSLg's GL stack (NVIDIA driver or D3D12 mapping layer) is calling dxgk module in Linux kernel with invalid handle, thus all GL rendering is most likely failing. If this works or does not work using software rendering, it could give us some clue on what we should look for next. You can force software rendering by adding below in .wslgconfig, and also "export LIBGL_ALWAYS_SOFTWARE=1" prior to run emulator in your user distro, GL has to be disabled on both system and user distro. Thanks!
[system-distro-env] LIBGL_ALWAYS_SOFTWARE=1
@hideyukn88 Thank you very much for your response. I have added that to .wslgconfig. The contents of my .wslgconfig file are currently:
[system-distro-env]
WESTON_RDP_MONITOR_REFRESH_RATE=144
[system-distro-env]
LIBGL_ALWAYS_SOFTWARE=1
After shutting down WSL with wsl --shutdown
in PowerShell, I opened Ubuntu in WSL again.
My steps taken are as follow:
1.) Run export LIBGL_ALWAYS_SOFTWARE=1
2.) Run cd /home/steven/spine-20210901
3.) Run ./spine /home/steven/Sonic_Mania/eboot.bin
The emulator still does not open.
My dmesg
output appears to be the same as before GPU acceleration was disabled:
[ 26.206146] process 'home/steven/spine-20210901/spine' started with executable stack
[ 26.801874] dxgk:err: is_handle_valid Entry is freed 40000080 2
[ 26.801877] dxgk:err: hmgrtable_get_object_by_type invalid handle 40000080
[ 26.801877] dxgk:err: adapter_by_handle failed 40000080
[ 26.802933] dxgk:err: is_handle_valid Entry is freed 40000080 2
[ 26.802934] dxgk:err: hmgrtable_get_object_by_type invalid handle 40000080
[ 26.802935] dxgk:err: adapter_by_handle failed 40000080
[ 26.805320] dxgk:err: is_handle_valid Entry is freed 40000080 2
[ 26.805321] dxgk:err: hmgrtable_get_object_by_type invalid handle 40000080
[ 26.805322] dxgk:err: adapter_by_handle failed 40000080
[ 26.806256] dxgk:err: is_handle_valid Entry is freed 40000080 2
[ 26.806256] dxgk:err: hmgrtable_get_object_by_type invalid handle 40000080
[ 26.806257] dxgk:err: adapter_by_handle failed 40000080
[ 48.977442] hv_balloon: Max. dynamic memory size: 32724 MB
My glxinfo -b
output is as follows:
41
Thank you again for your assistance in this matter.
Firstly, I now realize that the proper command was glxinfo -B
.
Secondly, I thought that I would try running this emulator in an Ubuntu 20.04 virtual machine as opposed to an Ubuntu 21.04 virtual machine. My WSL distribution was specifically Ubuntu 20.04.3. The Spine emulator did not work in my Ubuntu 20.04.3 virtual machine in VMWare Workstation.
Upon experiencing this, I had installed the Ubuntu on Windows Community Preview WSL distribution. It's currently based on Ubuntu 21.04.
Without disabling GPU acceleration, I had received the same dmesg
output as when attempting to run the emulator in my Ubuntu 20.04 WSL distribution.
When attempting to run the emulator with GPU acceleration disabled on both system and user distro, it ran!
It takes up a fourth of the screen on my 4K display and performance isn't close to where it was in my Ubuntu 21.04 virtual machine. Nonetheless, this is amazing progress!
While some things need work, would you wish to close this issue? I have no further inquiries because the issue that I had raised has been resolved. Thank you so much for your assistance in solving this.
Before this issue is closed, would you have any idea what could be causing this emulator to not run with hardware acceleration enabled? Performance is not at all where it should be because the emulator is running with software acceleration. Thank you once again.
Not sure if default installed kernel is built with nested virt enabled, afaik support is still pretty new unless I'm mistaken
@sjkorvin, no need to close the issue, we will use this to track the GPU acceleration issue. Unfortunately, I don't have access to PlayStation firmware thus not able to repro, but we will see what we can do to investigate this, thanks!
@hideyukn88 Thank you so much! Someone on the emulation subreddit told me that I need two GPUs to get GPU acceleration working in WSL. Is that correct? I only have my 2080 Super. I'm planning on purchasing a 1050 Ti to add to my PC for another purpose than this issue.
@hideyukn88 Thank you so much! Someone on the emulation subreddit told me that I need two GPUs to get GPU acceleration working in WSL. Is that correct? I only have my 2080 Super. I'm planning on purchasing a 1050 Ti to add to my PC for another purpose than this issue.
WSLg shares GPU resources with Windows, so it doesn't need you to have multiple GPUs
They probably thought you were talking about traditional emulation which does require separate gpu's. Thankfully wslg doesn't since it's integrated closely with Windows
Can confirm the same with wsl2 running under Win 11 and WSL graphics driver 510.06 GPU acceleration off and based on 21.04 - works. (Bad performance ofc) GPU acceleration off and based on 20.04 - not working, but won't work under a VM too. GPU acceleration ON on either distro - not working
Environment
Steps to reproduce
I got Spine working in my Ubuntu 21.04 virtual machine in VMWare Workstation 16. Unfortunately, I cannot get it to work in WSLg. Spine requires PlayStation 4 firmware files that I have placed in the emulator directory's firmware directory. Please note that in Ubuntu, Spine requires
libsdl2-dev
to be installed. I have installedlibsdl2-dev
in Ubuntu in WSL throughsudo apt install libsdl2-dev
.1.) Copy Spine emulator directory (spine-20210901) to
/home/steven/
2.) Runchmod a+x
on the spine binary file and on the contents of thelib
directory in the emulator directory 3.) Runcd /home/steven/spine-20210901
to cd to the emulator directory 4.) Run./spine /home/steven/Sonic_Mania/eboot.bin
to launch Sonic Mania. 5.) I am using a 144 Hz display. I have added the following lines toc:\ProgramData\Microsoft\WSL\.wslgconfig
; however, this issue has occurred with and without these lines added to my.wslgconfig
file:Below are my file permissions to verify that they are correctly set:
Below is my dmesg output:
Below is my glxinfo output:
WSL logs:
Unfortunately, running
wpr -start wsl.wprp -filemode
from an administrative command prompt gave me the output:Please find attached directly below my WSLg logs. pulseaudio.log weston.log
Attempting to open
versions.txt
in Notepad++ had given me a message that versions.txt did not exist. I could not copyversions.txt
elsewhere.Edit: Running
cat
onversions.txt
from within WSL gave me the following output:Expected behavior
I expected Sonic Mania to start with the Spine emulator through WSLg, just as it did for me in my Ubuntu 21.04 virtual machine.
Please find below a screenshot of Sonic Mania running in Spine in my Ubuntu 21.04 virtual machine.
Actual behavior
Sonic Mania is not running in Spine in WSLg.