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

glfw/3.3.2: Driver load issues with the conan package #1200

Closed
LunarWatcher opened this issue May 20, 2020 · 6 comments
Closed

glfw/3.3.2: Driver load issues with the conan package #1200

LunarWatcher opened this issue May 20, 2020 · 6 comments
Labels

Comments

@LunarWatcher
Copy link

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: glfw/3.3.2
  • Operating System+version: Linux Mint 19.3
    • GPU: Nvidia GTX 1060M (6GB), proprietary drivers (440.59)
  • Compiler+version: GCC 7
  • Docker image: (not applicable)
  • Conan version: conan 1.25.1
  • Python version: Python 3.6.9

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Configuration for profile gcc:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

test.cpp:

#include <GLFW/glfw3.h>

int main() {
    if (!glfwInit())
    {
        return -1;
    }

    GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
    if (!window)
    {
        return -1;
    }
    glfwMakeContextCurrent(window); 
    glfwSwapBuffers(window);
    int width, height;
    glfwGetFramebufferSize(window, &width, &height);
    glViewport(0, 0, width, height);
    while (!glfwWindowShouldClose(window))
    {
        glfwPollEvents();
    }

    glfwTerminate();
}

conanfile.txt:

[requires]
glfw/3.3.2@bincrafters/stable
glew/2.1.0@bincrafters/stable

[generators]
cmake

CMakeLists.txt:

cmake_minimum_required(VERSION 3.8)
project("Test")

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(Test test.cpp)
target_include_directories(Test PRIVATE ".")
target_link_libraries(Test ${CONAN_LIBS})
mkdir build && cd build && conan install .. --profile gcc
cmake ..
LIBGL_DEBUG=verbose ./bin/Test.cpp

Logs (Include/Attach if Applicable)

Click to expand log
libGL: screen 0 does not appear to be DRI3 capable
libGL: screen 0 does not appear to be DRI2 capable
libGL: MESA-LOADER: dlopen(/home/lunarwatcher/.conan/data/mesa/19.3.1/bincrafters/stable/package/0584dc45620b4bdf99bddb906b9a0e5224605ec2/lib/dri/swrast_dri.so)
libGL: Can't open configuration file /home/lunarwatcher/.conan/data/mesa/19.3.1/bincrafters/stable/package/0584dc45620b4bdf99bddb906b9a0e5224605ec2/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lunarwatcher/.drirc: No such file or directory.
libGL: Can't open configuration file /home/lunarwatcher/.conan/data/mesa/19.3.1/bincrafters/stable/package/0584dc45620b4bdf99bddb906b9a0e5224605ec2/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lunarwatcher/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

While I've included a lot of code here, this issue is specific to conan. With this CMakeLists:

cmake_minimum_required(VERSION 3.8)
project("Test")

add_executable(Test test.cpp)

target_include_directories(Test PRIVATE ".")

add_subdirectory(glfw EXCLUDE_FROM_ALL)
target_link_libraries(Test PRIVATE glfw)

add_definitions(-DGLEW_STATIC)
add_subdirectory(glew-cmake EXCLUDE_FROM_ALL)
target_link_libraries(Test PRIVATE libglew_static)

And these submodules:

[submodule "glfw"]
	path = glfw
	url = https://github.com/glfw/glfw
[submodule "glew-cmake"]
	path = glew-cmake
	url = https://github.com/Perlmint/glew-cmake

with identical code (test.cpp) to the conan test, it suddenly works fine:

image

As far as I can tell, this is a problem with the Conan package. GLFW itself works fine outside conan, and the standard glxgears test passes without issues. Games or other software requiring the GPU driver to work also works fine.

Also, #1119: building mesa did not make a difference.

@ericLemanissier
Copy link
Contributor

thanks for the bug report. We are migrating away from the mesa package. Could you please try with the updated glfw/3.3.2 recipe ?

@LunarWatcher
Copy link
Author

Mesa is still pulled in by conan-glew apparently. Specifically, it requires mesa-glu, which pulls in mesa/19.3.1, which still causes the same crash. glfw works fine on its own now at least.

@ericLemanissier
Copy link
Contributor

That's unfortunate, but this will be fixed when someone will have some time available to finalize https://github.com/bincrafters/conan-glu: conan-glew will depend on conan-glu instead of mesa-glu. Fell free ton contribute !

@LunarWatcher
Copy link
Author

What exactly is missing? I compiled conan-glu locally and changed conan-glew to include conan-glu instead, and it appears to work fine without any modifications.

@ericLemanissier
Copy link
Contributor

@Croydon started the work, so he would be the correct person to answer you, unfortunately he has little time for this currently. He mentionned 2 todos: https://github.com/bincrafters/conan-glu/blob/testing/virtual/conanfile.py#L15-L16, so that's a start !

@Croydon
Copy link
Member

Croydon commented Jun 22, 2020

A glu system package is now Work-In-Progress here: conan-io/conan-center-index#1976

Afterwards the glew package can be updated

glfw is now available from the Conan Center Index and should be used from there. The respective Bincrafters' package is now obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants