bsf icon indicating copy to clipboard operation
bsf copied to clipboard

Better check for unsupported hardware/driver version

Open ghost opened this issue 7 years ago • 9 comments

EDITED ISSUE The cause of this issue was unsupported hardware, but the error messages were unclear. Ideally we check for hardware/driver/etc. support and report if it unsupported early on in the initialization process.


ORIGINAL ISSUE I followed the docs https://www.bsframework.io/docs/build.html 1: I tried to link with binaries (https://www.bsframework.io/download.html):

Cannot find texture parameter with the name 'gInputTex'
                 in void bs::TGpuParams<Core>::getTextureParam(bs::GpuProgramType, const String&, bs::TGpuParamTexture<Core>&) const [with bool Core = true; bs::String = std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >] [/home/travis/build/GameFoundry/bsf/Source/Foundation/bsfCore/RenderAPI/BsGpuParams.cpp:333]

Cannot find buffer parameter with the name 'gOutput'
                 in void bs::TGpuParams<Core>::getBufferParam(bs::GpuProgramType, const String&, bs::TGpuParamBuffer<Core>&) const [with bool Core = true; bs::String = std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >] [/home/travis/build/GameFoundry/bsf/Source/Foundation/bsfCore/RenderAPI/BsGpuParams.cpp:375]

Cannot find buffer parameter with the name 'gInput'
                 in void bs::TGpuParams<Core>::getBufferParam(bs::GpuProgramType, const String&, bs::TGpuParamBuffer<Core>&) const [with bool Core = true; bs::String = std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >] [/home/travis/build/GameFoundry/bsf/Source/Foundation/bsfCore/RenderAPI/BsGpuParams.cpp:375]

Cannot find texture parameter with the name 'gOutput'
                 in void bs::TGpuParams<Core>::getLoadStoreTextureParam(bs::GpuProgramType, const String&, bs::TGpuParamLoadStoreTexture<Core>&) const [with bool Core = true; bs::String = std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >] [/home/travis/build/GameFoundry/bsf/Source/Foundation/bsfCore/RenderAPI/BsGpuParams.cpp:354]

Cannot find texture parameter with the name 'gSHCoeffs'
                 in void bs::TGpuParams<Core>::getTextureParam(bs::GpuProgramType, const String&, bs::TGpuParamTexture<Core>&) const [with bool Core = true; bs::String = std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >] [/home/travis/build/GameFoundry/bsf/Source/Foundation/bsfCore/RenderAPI/BsGpuParams.cpp:333]

Segmentation fault

2: to link with source (from git) same errors and:

A fatal error occurred and the program has to terminate!
  - Error: Segmentation fault
  - Description: Received fatal signal
  - In function: 
  - In file: :0

Stack trace: 
0) libbsf.so: bs::CrashHandler::getStackTrace[abi:cxx11]()+0x1bf [0x7fd82db0446f]
1) libbsf.so: bs::CrashHandler::logErrorAndStackTrace(std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, unsigned int) const+0x32b [0x7fd82dae949b]
2) libbsf.so: bs::CrashHandler::reportCrash(std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, unsigned int) const+0x9 [0x7fd82db03d19]
3) libbsf.so: bs::signalHandler(int, siginfo_t*, void*)+0x116 [0x7fd82db04086]
4) /lib/x86_64-linux-gnu/libc.so.6: +0x34f00 [0x7fd82c152f00]
5) libbsfGLRenderAPI.so: bs::ct::GLVertexArrayObjectManager::getVAO(std::shared_ptr<bs::ct::GLSLGpuProgram> const&, std::shared_ptr<bs::ct::VertexDeclaration> const&, std::array<std::shared_ptr<bs::ct::VertexBuffer>, 32ul> const&)+0x361 [0x7fd829cabc91]
6) libbsfGLRenderAPI.so: bs::ct::GLRenderAPI::beginDraw()+0xdc [0x7fd829cc98ec]
7) libbsfGLRenderAPI.so: bs::ct::GLRenderAPI::drawIndexed(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, std::shared_ptr<bs::ct::CommandBuffer> const&)+0x14f [0x7fd829cca21f]
8) libbsf.so: bs::ct::RendererUtility::draw(std::shared_ptr<bs::ct::MeshBase> const&, bs::SubMesh const&, unsigned int)+0x2b9 [0x7fd82dfd3759]
9) libbsf.so: bs::ct::RendererUtility::drawScreenQuad(bs::Rect2 const&, bs::Vector2I const&, unsigned int, bool)+0x363 [0x7fd82dfd4443]
10) libbsfRenderBeast.so: bs::ct::IrradianceProjectSHMat::execute(std::shared_ptr<bs::ct::Texture> const&, unsigned int, std::shared_ptr<bs::ct::RenderTarget> const&)+0x27a [0x7fd820a202aa]
11) libbsfRenderBeast.so: bs::ct::RenderBeastIBLUtility::filterCubemapForIrradiance(std::shared_ptr<bs::ct::Texture> const&, std::shared_ptr<bs::ct::Texture> const&) const+0x208 [0x7fd820a21868]
12) libbsfRenderBeast.so: bs::ct::generateDefaultIndirect()+0x30d [0x7fd820aba3fd]
13) libbsfRenderBeast.so: bs::ct::RendererTextures::startUp()+0x120 [0x7fd820aba5b0]
14) libbsfRenderBeast.so: bs::ct::RenderBeast::initializeCore()+0x18d [0x7fd8209b8c2d]
15) libbsf.so: bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>)+0x182 [0x7fd82db15842]
16) libbsf.so: bs::CoreThread::runCoreThread()+0x308 [0x7fd82db20ad8]
17) libbsf.so: bs::PooledThread::run()+0x15b [0x7fd82daa3e5b]
18) /usr/lib/x86_64-linux-gnu/libstdc++.so.6: +0xbbaff [0x7fd82c926aff]
19) /lib/x86_64-linux-gnu/libpthread.so.0: +0x75aa [0x7fd82bd035aa]
20) /lib/x86_64-linux-gnu/libc.so.6: clone+0x3f [0x7fd82c214cbf]

Same error if I run the Editor from Banshee Engine.

Banshee Engine Log System information

Banshee version: 1.0

OS version: Linux#1 SMP Debian 4.15.11-1 (2018-03-20) 64-bit

CPU vendor: GenuineIntel

CPU name: Intel(R) Celeron(R) CPU G1610 @ 2.60GHz

CPU clock speed: 2600Mhz

CPU core count: 2

GPU: Intel Open Source Technology Center Mesa DRI Intel(R) Ivybridge Desktop

ghost avatar Oct 10 '18 09:10 ghost

Thanks. This is most likely due to Mesa drivers which aren't currently supported.

BearishSun avatar Oct 10 '18 10:10 BearishSun

Actually what is more likely is that your integrated GPU doesn't support the features bsf requires. Looking online it only supports OpenGL 4 (or maybe even 3.1? I'm finding conflicting information), while bsf requires 4.4.

BearishSun avatar Oct 10 '18 11:10 BearishSun

Well, wiki page:

ghost avatar Oct 10 '18 17:10 ghost

Sorry, I pressed a wrong button. The wiki page for the chip: On Linux OpenGL 4.2 is supported as of Mesa 17.1.[20]

Would have to confirm it in a few hours.

ghost avatar Oct 10 '18 17:10 ghost

OpenGL 4.1 can work, but it's not supported out of the box. It's currently only used as a fallback on macOS, but you can enable it on Linux by setting these to 0:

	#define BS_OPENGL_4_2 1
	#define BS_OPENGL_4_3 1
	#define BS_OPENGL_4_4 1
	#define BS_OPENGL_4_5 1

In BsGLPrerequisites.h. You might also need to delete Data/Timestamp.asset to force shaders to recompile.

But regardless, Mesa drivers don't currently work as intended as there are a couple of bugs in them. One of the bugs was fixed in Mesa 18, and the other one still hasn't been fixed - it's likely I'll need to create a workaround but I haven't gotten that far yet. Ideally you should get things to run, but will likely have graphical artifacts.

BearishSun avatar Oct 10 '18 17:10 BearishSun

I didn't try this. Because I got it to run with Vulkan and actually that's why I'm interested on your project. In a real project I'm gonna use another hardware anyway.

If you want, you can close the Issue.

Thanks.

ghost avatar Oct 10 '18 23:10 ghost

I think there should be a function that checks that all the opengl functions are properly pulled in by the loader. Having it segmentation fault on a user machine with no message or warning as to why seems like a very annoying behavior.

cwfitzgerald avatar Oct 10 '18 23:10 cwfitzgerald

It's not working with Vulkan either. I was so exited to see a window, but that's all. And after about 3 minutes:

INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
A fatal error occurred and the program has to terminate!
  - Error: Segmentation fault
  - Description: Received fatal signal
  - In function: 
  - In file: :0

Stack trace: 
0) libbsf.so: bs::CrashHandler::getStackTrace[abi:cxx11]()+0x1bf [0x7f2e9d6b246f]
1) libbsf.so: bs::CrashHandler::logErrorAndStackTrace(std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, unsigned int) const+0x32b [0x7f2e9d69749b]
2) libbsf.so: bs::CrashHandler::reportCrash(std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> > const&, unsigned int) const+0x9 [0x7f2e9d6b1d19]
3) libbsf.so: bs::signalHandler(int, siginfo_t*, void*)+0x116 [0x7f2e9d6b2086]
4) /lib/x86_64-linux-gnu/libc.so.6: +0x34f00 [0x7f2e9bd00f00]
5) /lib/x86_64-linux-gnu/libc.so.6: +0x137800 [0x7f2e9be03800]
6) libbsf.so: bs::ct::Mesh::readData(bs::MeshData&, unsigned int, unsigned int)+0xce [0x7f2e9da20c3e]
7) libbsf.so: +0x8270b6 [0x7f2e9da1f0b6]
8) libbsf.so: bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>)+0x6a [0x7f2e9d6c372a]
9) libbsf.so: bs::CommandQueueBase::playback(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*)+0x19 [0x7f2e9d6c40b9]
10) libbsf.so: bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>)+0x182 [0x7f2e9d6c3842]
11) libbsf.so: bs::CoreThread::runCoreThread()+0x308 [0x7f2e9d6cead8]
12) libbsf.so: bs::PooledThread::run()+0x15b [0x7f2e9d651e5b]
13) /usr/lib/x86_64-linux-gnu/libstdc++.so.6: +0xbbaff [0x7f2e9c4d4aff]
14) /lib/x86_64-linux-gnu/libpthread.so.0: +0x75aa [0x7f2e9b8b15aa]
15) /lib/x86_64-linux-gnu/libc.so.6: clone+0x3f [0x7f2e9bdc2cbf]

I think I need new hardware :)

ghost avatar Oct 11 '18 00:10 ghost

I agree having it just crash is not very nice, but I haven't gotten around to adding nicer checks. I don't think we need checks per-extension, but just a OpenGL version check, since bsf relies on core functionality anyway. I'd happily accept a PR if that's something you wanted to add.

BearishSun avatar Oct 11 '18 05:10 BearishSun