Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not initialize SDL: XRandR support is required but not available #1708

Open
UPUPGOO opened this issue Jan 15, 2019 · 16 comments
Open

Could not initialize SDL: XRandR support is required but not available #1708

UPUPGOO opened this issue Jan 15, 2019 · 16 comments

Comments

@UPUPGOO
Copy link

UPUPGOO commented Jan 15, 2019

LogInit: Warning: Could not initialize SDL: XRandR support is required but not available
LogInit: Error: FLinuxApplication::CreateLinuxApplication() : InitSDL() failed, cannot create application instance.
LogLinux: FLinuxPlatformMisc::RequestExit(bForce=true, ReturnCode=1)
LogLinux: FLinuxPlatformMisc::RequestExit(1)

When I run AirSimNH.sh, errors occured.[https://github.com/Microsoft/AirSim/releases]
So what can I do?
Thank you for your answer.

@madratman
Copy link
Contributor

madratman commented Jan 22, 2019

Are you using xvfb? Can you share the output of $ echo $DISPLAY and $ xdpyinfo | grep version?
This might be helpful.
Also, are you running this inside a docker container or a server?
FWIW, we updated AirSimNH linux binary late last week, might be worth trying again. However, my hunch is that's not the root cause here.

@UPUPGOO
Copy link
Author

UPUPGOO commented Jan 23, 2019

Thank you for your reply!
I am using Microsoft's Remote Desktop connecting to Ubuntu(I runned AirSim inside a server not a docker container).
image

Also,I will try newest AirSimNH linux binary.Thanks.

@madratman
Copy link
Contributor

hey @UPUPGOO. So, I couldn't figure it out what was the cause the last time we talked about it.

But today, I faced the exact same issue myself, and have found a workaround - disable xinerama by disabling the monitor using the default Intel GPU in nvidia-settings. I am not sure if your situation is similar to mine, but xinerama seems to be the culprit here. Enabling it disables xrandr. (https://bugs.launchpad.net/ubuntu/+source/xrandr/+bug/295313 , https://www.linuxquestions.org/questions/fedora-35/x-org-xinerama-and-randr-%2Asigh%2A-598941/)

In my case, I have a dual monitor setup and one is using the defaul Intel GPU, and another an Nvidia GPU, AND Xinerama was enabled in nvidia-settings:
xrandr_bug_1

Now if I uncheck the xinerama enabled box in the above image, only the intel gpu is used, and the monitor connected to nvidia does not work and shows a black screen (and unreal would use the intel gpu), which is not what we want. Xinerama is used for relative positioning of the displays here (although xrandr should be able to do it as well?).

So, well I just disabled the monitor using intel gpu, and disableds xinerama, and the error goes away.

The unreal building on linux wiki page offers a better solution for multi-monitor setup. Ctrl+F "SDL2 with multi-monitor support" in there and you'll see :

# install deps
$ sudo apt-get install libxinerama-dev libxrandr-dev x11proto-xinerama-dev
# then re-build SDL2 in Engine source code
$ cd PATHTOUNREALENGINE/Engine/Source/ThirdParty/SDL2 && ./build.sh

However, running ./build.sh in there leads to an error saying vulkan.h being not found:

[ 86%] Building C object CMakeFiles/SDL2-static.dir/src/video/x11/SDL_x11xinput2.c.o
In file included from /home/madratman/projects/UnrealEngine/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/src/video/x11/SDL_x11video.c:42:0:
/home/madratman/projects/UnrealEngine/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/src/video/x11/SDL_x11vulkan.h:23:27: fatal error: vulkan/vulkan.h: No such file or directory
compilation terminated.
CMakeFiles/SDL2-static.dir/build.make:1583: recipe for target 'CMakeFiles/SDL2-static.dir/src/video/x11/SDL_x11video.c.o' failed
make[2]: *** [CMakeFiles/SDL2-static.dir/src/video/x11/SDL_x11video.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/madratman/projects/UnrealEngine/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/src/video/x11/SDL_x11vulkan.c:7:0:
/home/madratman/projects/UnrealEngine/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/src/video/x11/SDL_x11vulkan.h:23:27: fatal error: vulkan/vulkan.h: No such file or directory
compilation terminated.
CMakeFiles/SDL2-static.dir/build.make:1596: recipe for target 'CMakeFiles/SDL2-static.dir/src/video/x11/SDL_x11vulkan.c.o' failed
make[2]: *** [CMakeFiles/SDL2-static.dir/src/video/x11/SDL_x11vulkan.c.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/SDL2-static.dir/all' failed
make[1]: *** [CMakeFiles/SDL2-static.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Well, you can try installing vulkan from here https://vulkan-tutorial.com/Development_environment#page_Vulkan_SDK. And try again.

But I think a better solution is figuring out why relative positioning of monitors / the monitor connected to nvidia gpu's display port doesn't work with xinerama being disabled in nvidia-settings. Dunno how to do that.
@sytelus @msb336 any ideas?

@madratman
Copy link
Contributor

@UPUPGOO I faced this yet once again while working on dockerfiles for airsim in #1868
Thought I'll just share that I was able to resolve it by an sudo apt-get install x11-xserver-utils.
If this is not an issue anymore, let's close it?

@madratman madratman added this to Low hanging fruits in Bug triage Apr 6, 2019
@madratman
Copy link
Contributor

@UPUPGOO please comment / reopen issue if the above comment doesn't resolve it.

@xiaoaoran
Copy link

I met same problem when running UnrealEngine.

[2020.01.22-06.05.51:870][ 0]LogInit: Warning: Could not initialize SDL: XRandR support is required but not available
[2020.01.22-06.05.51:870][ 0]LogInit: Warning: FLinuxSplashState::InitSplashResources() : InitSDL() failed, there will be no splash.
[2020.01.22-06.05.51:870][ 0]LogInit: Initializing SDL.
[2020.01.22-06.05.53:598][ 0]LogInit: Warning: Could not initialize SDL: XRandR support is required but not available
[2020.01.22-06.05.53:598][ 0]LogInit: Error: FLinuxApplication::CreateLinuxApplication() : InitSDL() failed, cannot create application instance.
[2020.01.22-06.05.53:598][ 0]LogLinux: FLinuxPlatformMisc::RequestExit(bForce=true, ReturnCode=1)
[2020.01.22-06.05.53:598][ 0]LogLinux: FLinuxPlatformMisc::RequestExit(1)
aoran.xiao@scale-gpu002:~/UnrealEngine-4.18.3-release$ echo $DISPLAY

sudo apt-get install x11-xserver-util does not work for me

how did you solve it?

@saihv
Copy link
Contributor

saihv commented Jan 22, 2020

@xiaoaoran Can you check if one of these helps

sudo apt install libxrandr-dev
sudo apt install xorg-dev

@xiaoaoran
Copy link

xiaoaoran commented Feb 3, 2020

@saihv I installed these two packages, but it ddn't work

By the way, I am running Xshell in windows to connect a ubuntu server for this project.

I appreciate for a solution!

@xiaoaoran
Copy link

@UPUPGOO Did you solve it?

@jawadefaj
Copy link

Did anyone found a solution? I was trying to install UE4.22 in WSL and this popped out.

@gengtsh
Copy link

gengtsh commented Jun 18, 2020

Did anyone found a solution? i'm also running Xshell in windows to connect a ubuntu server

@tharindurmt
Copy link

I'm having the sort of the same issue. Following is my setup, the issues I had and the things I have tried so far.

Ubuntu: 18.04
UE: 4.24 and 4.25 (Everything described below was tried in both versions)
GPU: RTX 8000 and RTX 6000 (two each)
Nvidia driver version: 450.66

Following are the ways I tried to launch UE Editor.

  1. X11 forwarding enabled putty ssh session: with standard vulkan and then with -opengl4 argument (opengl4 enabled through config).
    Both showed error: LogInit: Warning: Could not initialize SDL: XRandR support is required but not available LogInit: Error: FLinuxApplication::CreateLinuxApplication() : InitSDL() failed, cannot create application instance.
  2. X11 forwarding disabled putty ssh session: with standard vulkan and then with putty ssh session with -opengl4 argument (opengl4 enabled through config).
    Both showed no error, But it's hanged and showed: 2]LogLinux: Warning: Unable to set desired swap interval 'Immediate'

Relevent installed packages:

libnvidia-fbc1-450:amd64                   450.66-0ubuntu0.18.04.1                          amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
libnvidia-fbc1-450:i386                    450.66-0ubuntu0.18.04.1                          i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
libnvidia-gl-450:amd64                     450.66-0ubuntu0.18.04.1                          amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
libnvidia-gl-450:i386                      450.66-0ubuntu0.18.04.1                          i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
xserver-xorg-video-nvidia-450              450.66-0ubuntu0.18.04.1                          amd64        NVIDIA binary Xorg driver
libxrandr-dev
org-dev

However, when I tried glxinfo (with X11 forwarding enabled putty session), I get

name of display: localhost:12.0
Error: couldn't find RGB GLX visual or fbconfig

However, I can successfully run the UE Editor at the server. This only happens with the remote login. Can someone please suggest what could be the issue here?

@HareshKarnan
Copy link

same issue here. Running vncserver on a remote ubuntu 18.04 machine and using novnc. Same error !

@yadonskov
Copy link

I also use vnc on remote ubuntu 18.04, same error, above suggestions didn't work for me

@MasonLilly
Copy link

Still having this problem as well, using VNC to connect to an Ubuntu 18.04 VM.

@jonyMarino jonyMarino reopened this Jul 12, 2021
Bug triage automation moved this from Low hanging fruits to Needs triage Jul 12, 2021
@lyfs
Copy link

lyfs commented Dec 9, 2021

hello , i resolve this problem by install gdm3,and replace gdm3 with lightgdm

1、sudo apt-get update

2、sudo apt-get -d install --reinstall lightdm

3、sudo apt-get remove --purge lightdm

4、sudo apt-get install gdm

5、sudo reboot

after reboot

1、sudo apt-get install --reinstall gnome-session

2、sudo apt-get install --reinstall ubuntu-desktop

image
when you see this , maybe it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bug triage
  
Needs triage
Development

No branches or pull requests