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

Game not starting in Ubuntu 18.04 #2936

Open
jrgryph opened this issue Feb 22, 2020 · 35 comments
Open

Game not starting in Ubuntu 18.04 #2936

jrgryph opened this issue Feb 22, 2020 · 35 comments

Comments

@jrgryph
Copy link

jrgryph commented Feb 22, 2020

Installed with apt.
here's my terminal output...
I have NVIDIA video drivers installed too.

unknown-horizons -d
Logging to /home/jonsmith/.unknown-horizons/log/unknown-horizons-2020-02-22_10-34-39.log and /usr/share/unknown-horizons/fife.log
Python version: sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)
Platform: Linux-4.15.0-88-generic-x86_64-with-Ubuntu-18.04-bionic
SYS.PATH: ['/usr/games', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/jonsmith/.local/lib/python2.7/site-packages', '/home/jonsmith/.local/lib/python2.7/site-packages/ftputil-3.2-py2.7.egg', '/home/jonsmith/.local/lib/python2.7/site-packages/numpy-1.8.1-py2.7-linux-x86_64.egg', '/home/jonsmith/.local/lib/python2.7/site-packages/PyOpenGL-3.1.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/PyOpenGL-3.1.3b2-py2.7.egg', '/home/jonsmith/Desktop/Games/minecraft/mcedit2-2.0.0-beta14/src', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk3']
PATHSEP: ":" SEP: "/"
LD_LIBRARY_PATH: :/home/jonsmith/Desktop/panda3d/soci-3.2.3/lib
PATH: /home/jonsmith/.pyenv/shims:/home/jonsmith/.pyenv/bin:/home/jonsmith/bin:/home/jonsmith/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PYTHONPATH
Python version: sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)
Platform: Linux-4.15.0-88-generic-x86_64-with-Ubuntu-18.04-bionic
Using fife version 0.4.1, at least 0.4.0 required
Controller:LOG:Fifengine v"0.4.1"+
Controller:LOG:================== Engine initialize start =================
Controller:LOG:Time manager created
Controller:LOG:Creating VFS
Controller:LOG:Adding root directory to VFS
VFS:DEBUG:VFSDirectory created with root path ./
VFS:LOG:new provider: OS Directory
Controller:LOG:Adding zip provider to VFS
VFS:LOG:new provider: ZIP
Controller:LOG:Engine pre-init done
Controller:LOG:Creating event manager
Controller:LOG:Creating resource managers
Controller:LOG:Creating render backend
Controller:LOG:OpenGL Render backend created
Controller:LOG:Initializing render backend
Controller:WARN:Selected video driver is not supported for your Operating System! Reverting to default driver.
Controller:LOG:Querying device capabilities
Controller:LOG:Creating main screen
X Error of failed request: GLXBadDrawable
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 266
Current serial number in output stream: 266

@jrgryph jrgryph closed this as completed Feb 27, 2020
@z0rti
Copy link

z0rti commented Jan 16, 2021

did you fix it? how? compile it?

@LinuxDonald
Copy link
Member

UH needs py3

@z0rti
Copy link

z0rti commented Jan 16, 2021

This is my log:

Python version: sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)
Platform: Linux-5.4.0-51-generic-x86_64-with-glibc2.29
SYS.PATH: ['/usr/games', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
PATHSEP: ":" SEP: "/"
LD_LIBRARY_PATH: <undefined>
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PYTHONPATH <undefined>
Python version: sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)
Platform: Linux-5.4.0-51-generic-x86_64-with-glibc2.29
Using fife version 0.4.2, at least 0.4.2 required
Controller:LOG:Fifengine v0.4.2
Controller:LOG:================== Engine initialize start =================
Controller:LOG:Time manager created
Controller:LOG:Creating VFS
Controller:LOG:Adding root directory to VFS
VFS:DEBUG:VFSDirectory created with root path ./
VFS:LOG:new provider: OS Directory
Controller:LOG:Adding zip provider to VFS
VFS:LOG:new provider: ZIP
Controller:LOG:Engine pre-init done
Controller:LOG:Creating event manager
Controller:LOG:Creating resource managers
Controller:LOG:Creating render backend
Controller:LOG:OpenGL Render backend created
Controller:LOG:Initializing render backend
Controller:WARN:Selected video driver is not supported for your Operating System!  Reverting to default driver.
Controller:LOG:Querying device capabilities
Controller:LOG:Creating main screen
X Error of failed request:  GLXBadDrawable
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  297

$ lsb_release -d
Description:    Ubuntu 20.04.1 LTS

@LinuxDonald
Copy link
Member

LinuxDonald commented Jan 16, 2021

The log say there is an problem with your gpu driver.

@LinuxDonald
Copy link
Member

Gpu driver problem.

@z0rti
Copy link

z0rti commented Jan 21, 2021

What GPU drivers are supported?
I'm using official nvidia-driver-450 package for ubuntu 20.04

$ glxinfo|grep version
GLX version: 1.4
OpenGL core profile version string: 4.6.0 NVIDIA 450.80.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 450.80.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 450.80.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

(other games do work)

@LinuxDonald
Copy link
Member

Than I don't know what's wrong. There is no active engine dev available.

@vidje
Copy link

vidje commented Feb 18, 2021

So any fix for nvidia drivers 460.39?

@LinuxDonald
Copy link
Member

Could you rebuild Fife with lastest changes and lastest changes of UH please?

@LinuxDonald
Copy link
Member

@jmdejong have you maybe an idea whats broken? I have tested it now to same error.

@LinuxDonald
Copy link
Member

@jakoch could you maybe take an look too please?

@jmdejong
Copy link
Contributor

@LinuxDonald what did you do to get the same error? Just starting and playing UH does not give an error for me, but I don't have nvidia graphics.

Is this still specific for ubuntu 18.04 or does it affect other distros as well?

@LinuxDonald
Copy link
Member

unknown-horizons
X Error of failed request: GLXBadDrawable
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 307
Current serial number in output stream: 307

Setting sdl in settings.xml i get this:
unknown-horizons
Traceback (most recent call last):
File "/usr/bin/unknown-horizons", line 381, in
main()
File "/usr/bin/unknown-horizons", line 122, in main
ret = horizons.main.start(options)
File "/usr/lib/python3.9/site-packages/horizons/main.py", line 171, in start
horizons.globals.fife.init()
File "/usr/lib/python3.9/site-packages/horizons/engine/engine.py", line 152, in init
self.engine.init()
fife.fife.SDLException: [SDLException] , SDL reported something bad :: No hardware accelerated renderers available

Manjaro Nvidia Closed Source Driver.

@LinuxDonald LinuxDonald reopened this May 27, 2021
@jrgryph jrgryph changed the title Game not starting in Ubunto 18.04 Game not starting in Ubuntu 18.04 May 28, 2021
@Waldecker
Copy link

Waldecker commented Jun 21, 2021

I have the same error on Ubuntu 20.04

waldecker:~$ unknown-horizons
X Error of failed request: GLXBadDrawable
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 292
Current serial number in output stream: 292

waldecker:~$ lspci -nnk | grep -i VGA -A2
06:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP108 [GeForce GT 1030] [10de:1d01] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] GP108 [GeForce GT 1030] [1462:8c98]
Kernel driver in use: nvidia

waldecker:~$ glxinfo | grep "OpenGL core profile version string"
OpenGL core profile version string: 4.6.0 NVIDIA 460.80

waldecker:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal

Any idea how to solve it?

@debagos
Copy link

debagos commented Feb 27, 2022

Same problem on KDE Neon with proprietary Nvidia driver.

@LinuxDonald
Copy link
Member

I think fife engine is broken...

@LinuxDonald
Copy link
Member

Could you guys retest it with fifechan 0.1.5 and fife lastest git version and lastest unknown-horizons git version please

@hisoka999
Copy link

fifechan won't help, its a bug in the fifengine.

the root problem is the usage of "SDL_GetWindowSurface". this function should not be used with active "3d accelleration".

so if i'm right that would mean that the old code would need some fixing.

@LinuxDonald
Copy link
Member

For me it starts under manjaro with nvidia without any problems again.

@coldtobi
Copy link

coldtobi commented Sep 3, 2022

(For documentation: This might be in fife, fifengine/fifengine#1079)

@coldtobi
Copy link

coldtobi commented Sep 3, 2022

German Debian Forums had thread about it [1], and there is a
Workaround documented:

The workaround is to run the application in a Xephyr environment
(package xserver-xephyr), which seems to be without hardware acceleration.

Example for how to use the workaround:

  Xephyr :99 -resizeable -screen 1400x1050 &
  DISPLAY=:99 unknown-horizons

[1] https://debianforum.de/forum/viewtopic.php?t=183160#p1292067

@jakoch
Copy link
Member

jakoch commented Sep 3, 2022

Hmmm... No hardware accelerated renderers available. Ok, that means the initalization fails on fifengine side.


This might be caused by a wrong usage of SDL_ functions, specifically SDL_GetWindowSurface in Fifengine's RenderBackendOpenGL. Referencing: https://github.com/libsdl-org/SDL/blob/main/include/SDL_video.h#L1287

I think it would be better to make the current window the opengl context and then start swapping, before glew_init.
So just SDL_GL_MakeCurrent(handle, context) followed by SDL_GL_SetSwapInterval(1).
The upstream (fifengine) needs a bugfix.

@LinuxDonald
Copy link
Member

@jakoch have you maybe the time to create an fix for it please?

@jakoch
Copy link
Member

jakoch commented Sep 3, 2022

I haven't worked on fife for years. So i need to (re)setup my dev env with repo(s) and stuff first, before i could tackle this.

@armandorub
Copy link

I cannot start the game: Select tutorial, then shows me a sailboat on the screen and in a fraction of a second disappears and the program close!
I am in Ubuntu 22.04.1 LTS and i have dual graphic cards: Intel and Nvidia, this last one is GTX 1650.

@coldtobi
Copy link

This seems to be a differnt issue, as the one I described above does not even open up a window.
Can you start from a console and see if there is some output hinting towards the problem?

@armandorub
Copy link

Here it is:
Unknown-horizons error
same here:
image

@coldtobi
Copy link

coldtobi commented Sep 26, 2022

@armandorub Oh, that looks familiar: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014084, or on this repo #2956.

@armandorub
Copy link

So, I understand this is an open bug and I just need to wait until is solved.
Thank you for your attention.

@coldtobi
Copy link

So, I understand this is an open bug and I just need to wait until is solved. Thank you for your attention.

Well, it is fixed here and in Debian unstable;
I'm not affiliated with Canonical/Ubuntu nor this project, (I was just updating the Debian package a few weeks ago.), so you'd need to address that issue with Canonical. However, Ubuntu 18.04 is "end of life", if I am not wrong, so it is unlikely that there will be a fix in this version of Ubuntu. You should consider updating to an supported version...

@jrgryph jrgryph closed this as completed Sep 27, 2022
@coldtobi
Copy link

@jrgryph are sure this is fixed?

@armandorub
Copy link

So where is possible to download de fixed game?

@jrgryph
Copy link
Author

jrgryph commented Sep 28, 2022

woops

@jrgryph jrgryph reopened this Sep 28, 2022
@coldtobi
Copy link

coldtobi commented Oct 1, 2022

So where is possible to download de fixed game?

There are a few options:

  • you can try the flatpak version: https://flathub.org/apps/details/org.unknown_horizons.UnknownHorizons
    (this version is too old to have the fix, however, as flatpaks bundle all dependencies this might actually working for you. I did not verify if it does.
  • you can try to recompile the Debian package yourself.
    I recently write some instructions how to do that for another package, you can try this instruction I originally wrote
    for another package:

You can rebuild the package for Ubuntu in the Debian way:

Get the .dsc-file, for the version you want by browsing the source package page On that site, towards the bottom, there is a link pointing to the .dsc-file, for example for the latest version, at the time of me writing this, it is pointing to unknown-horizons_2019.1-5.dsc Copy that link.
In a terminal, best in an empty directory (for easier cleanup), you then can build the package:

NOTE: You will need to have "Backports" for Ubuntu 18.04 enable. Otherwise it won't find a recent enough version of "debhelper" and the build will fail. It might be that you need to install "debhelper" from backports (as the package needs version 13 or later) manually.

Disclaimer: I did not try to rebuild the package on Ubuntu. The below instructions might or might not work for you.

# install debian tools for building packages
sudo apt install build-essentials devscripts equivs
# get the debian sources and unpack them
dget -ux <the link you have copied above>
# enter the source directory
cd unknown-horizons-*
# generate a pseudo package to install the build dependencies and install it.
sudo mk-build-deps -i -r
# build the debian package
dpkg-buildpackge -uc -b
# install the created packages 
sudo debi 
# optional: cleanup
sudo apt remove  unknown-horizons-build-deps 
sudo apt-mark auto build-essentials devscripts equivs 

Downside if of course that you won't get updates automatically , but you can subscribe to https://tracker.debian.org/pkg/unknown-horizons to get notifications if something (like new uploads) happens to the Debian package :)

@armandorub
Copy link

Thank you very much! I am keeping your recommendations and I intend to follow them carefully.

joebonrichie pushed a commit to solus-packages/unknown-horizons that referenced this issue Aug 15, 2023
Fixes launch

**Note:** Game currently doesn't work with hardware acceleration. One workaround is to launch it in a Xephyr environment. See [here](unknown-horizons/unknown-horizons#2936 (comment)) for details.

Signed-off-by: Thomas Staudinger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests