Flutter on Fedora 36 - Linux compilation not working "unable to load driver: swrast" - linux

when running flutter run to run on linux, a blank page appears with this in the debug console:
Launching lib/main.dart on Linux in debug mode...
libGL error: MESA-LOADER: failed to open swrast: /lib64/libpthread.so.0: version `GLIBC_PRIVATE' not found (required by /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri/../../../../lib/x86_64-linux-gnu/librt.so.1) (search paths :/usr/lib/dri:/snap/flutter/current/usr/lib/x86_64-linux-gnu/dri:, suffix _dri)
libGL error: failed to load driver: swrast
** (flutter_mastering:4822): WARNING **: 18:51:11.101: Failed to start Flutter renderer: Unable to create a GL context
searched for similar issues on the topic:
https://github.com/flutter/flutter/issues/75536
https://github.com/flutter/flutter/issues/76178
Cannot load `swrast` and `iris` drivers in Fedora 35
https://www.linuxquestions.org/questions/linux-software-2/libgl-error-on-fedora-28-swrast-solved-4175631923/
apparently nothing worked, here is some of my device's info:
5.19.6-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 31 17:58:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
❯ glxinfo | grep render
GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_NV_float_buffer,
GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: AMD Radeon Vega 3 Graphics (raven, LLVM 14.0.0, DRM 3.47, 5.19.6-200.fc36.x86_64)
GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted,
GL_INTEL_blackhole_render, GL_KHR_blend_equation_advanced,
GL_NV_conditional_render, GL_NV_copy_image, GL_NV_depth_clamp,
GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted,
GL_INGR_blend_func_separate, GL_INTEL_blackhole_render,
GL_NV_compute_shader_derivatives, GL_NV_conditional_render,
GL_EXT_render_snorm, GL_EXT_robustness, GL_EXT_sRGB_write_control,
GL_INTEL_blackhole_render, GL_KHR_blend_equation_advanced,
GL_NV_conditional_render, GL_NV_draw_buffers, GL_NV_fbo_color_attachments,
GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,
❯ flutter doctor
[✓] Flutter (Channel stable, 3.0.5, on Fedora Linux 36 (Workstation Edition) 5.19.6-200.fc36.x86_64, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.71.0)
[✓] Connected device (1 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.

The issue is because of the snap install, what worked for me is replacing the snap version with the manual install from github. You can also use the tarball.
git clone https://github.com/flutter/flutter.git -b stable
now to add flutter to path:
sudo gedit ~/.bashrc
Assuming ur flutter install was at /home/user/ add this at the end of the file:
export PATH="$PATH:/flutter/bin"
If ur flutter install is somewhere else then change the directory accordingly
After saving and exiting, refresh ur .bashrc file with:
source ~/.bashrc
Now check if its added to path with:
echo $PATH
If you see a /flutter/bin then ur doing fine. To check if flutter's installed:
flutter --version
To add any missing dependencies (if ur on Fedora) use:
sudo dnf install bash curl file git unzip which xz zip mesa-libGLU clang cmake ninja-build pkg-config gtk3-devel
On Ubuntu based distros it is
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev

Related

crossroad setup failed: Android NDK is only available for Linux 64-bit

I'm trying to build libjxl for android-arm64 by crossroad. I have install NDK, the evidence is I can run ndk-build command. The problem is: crossroad --h android-arm64 failed with error:
android-arm64: Setups a cross-compilation environment for Android on ARM.
Not available. Some requirements are missing:
Android NDK is only available for Linux 64-bit
But my server is linux 64-bit. Here is uname -a result:
Linux 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64
Any suggestion please? If you need any further information, please let me know. Thanks in advance~

Fail to run tensorflow on GPU

I fail to run the TF-CUDA tutorials_example_trainer as given in the installation guide (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#installing-from-sources)
I've had problems with the CUDA libs before, but that was with graphics related demo's.
All details below,
Thank you in advance for the help provided.
Environment info
Operating System: Debian Stretch
Installed version of CUDA and cuDNN:
8.0, 5.0
If installed from source, provide
554ddd9ad2d4abad5a9a31f2d245f0b1012f0d10
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Steps to reproduce
Build from source with 367.35 driver
Run bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
Logs or other output that would be helpful
bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
modprobe: ERROR: ../libkmod/libkmod-module.c:832 kmod_module_insert_module() could not find module by name='nvidia_367_uvm'
modprobe: ERROR: could not insert 'nvidia_367_uvm': Unknown symbol in module, or unknown parameter (see dmesg)
E tensorflow/stream_executor/cuda/cuda_driver.cc:491] failed call to cuInit: CUDA_ERROR_UNKNOWN
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:153] retrieving CUDA diagnostic information for host: debian
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:160] hostname: debian
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:185] libcuda reported version is: 367.35.0
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:356] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 367.35 Mon Jul 11 23:14:21 PDT 2016
GCC version: gcc version 5.4.0 20160609 (Debian 5.4.0-6)
"""
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] kernel reported version is: 367.35.0
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:293] kernel version seems to match DSO: 367.35.0
I tensorflow/core/common_runtime/gpu/gpu_init.cc:81] No GPU devices available on machine.
F tensorflow/cc/tutorials/example_trainer.cc:125] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'y': Could not satisfy explicit device specification '/gpu:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
[[Node: y = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/gpu:0"](Const, x)]])
The error message indicates that your GPU driver is not well set. You could try the following command to see if the driver is installed correctly.
$ nvidia-smi
If not please follow the instruction on the CUDA official site and reinstall CUDA. As your OS is not officially supported, you may want to change your OS.

Video4Linux Loopback Device on Linux4Tegera

I am interfacing Bumblebee2 camera with Nvidia Tegra TK1 board. I have installed firewire1394 driver along with coriander 2.0.2 to get the camera output and it is working fine. But I am not able to load the video for Linux module. I have installed the following two packages as well using synaptic
v4l2loopback-utils
qv4l2
I have following version of Linux kernel on Nvida Tegra TK1 board.
uname -a
Linux tegra-ubuntu 3.10.40-grinch-21.3.4 #1 SMP PREEMPT Fri May 1 10:41:09 UTC 2015 armv7l armv7l armv7l GNU/Linux
I downloaded the stable version of Video4Linux Loopback Device from here
I follow the steps mentioned in the readme file and when I tried to make it, I got the following errors.
make -C /lib/modules/3.10.40-grinch-21.3.4/build SUBDIRS=/home/ubuntu/vloopback modules
make: *** /lib/modules/3.10.40-grinch-21.3.4/build: No such file or directory. Stop.
make: *** [all] Error 2
I would appreciate if someone can help me to install video for Linux loopback device.
Current running kernel Linux tegra-ubuntu 3.10.40-grinch-21.3.4 does not have v4l2loopback support. I used module assistant to compile v4l2loopback module.
sudo aptitude install v4l2loopback-source module-assistant
sudo module-assistant auto-install v4l2loopback-source
Don't forget to mention the current running kernel headers. Then build and make v4l2loopback from here

Cuda - compile local and run remote

I want to compile my program locally and next run on server, because I haven't cuda capable graphics card.
My computer:
Kubuntu 12.04 x32
Nvidia display driver - lack
Nvcc - v6.01
Gcc - 4.6.3
Server:
Ubuntu 13.10 x64
Graphics card - GF GTX 480
Nvidia display driver - 337.xx
Nvcc - v6.01
Gcc - 4.8.1
Compilation on local computer:
nvcc kernel.cu
Running on server:
./a.out
But I get following error - "Cuda driver version is insufficient for cuda runtime version."
What's wrong? When I compile my code on server it work without problem.
The problem might be caused by the fact that you compile on x32 but execute on x64 architecture.
This problem is also described here: https://devtalk.nvidia.com/default/topic/555955/32-bit-executable-fails-with-insufficient-driver-version-on-64-bit-linux-os/
The solution provided there is to install the missing 32bit gcc libraries, which in your case (Ubuntu) should possible through:
sudo apt-get install lib32stdc++6

Debugging Helpers in Qtcreator don't work on Linux

and sorry for mess English.
In theory while debugging in qt-creator show fields of classes defined in Qt.
But it doesn't do it and display only or mem address.
I think that the problem in GDB or Python scripts.
GDB loaded from http://origin.releases.qt-project.org/gdb/ gives what is described above.
I tried to Build GDB myself with config flags
configure --prefix=<DIR> --target x86_64-linux-gnu --with-python
and
configure --target x86_64-linux-gnu --disable-nls --with-libiconv --with-expat --with-python
but they crash while starting from Qtcreator
i'm running on Ubuntu 12.10 x64
Qt version is 4.8.4 (from Git)
and creators are 2.5.2(from qt-project site) and 2.6.81 (git)
GDB versions:
build myself - 7.5
download from qt-project - 7.4.1
on Win8 subject works fine in combination QtCreator(2.6.81)-Qt-4.8.4-MinGW-GDB-7.5(build myself from source with Py. support)
UPD: Try to build with http://qt.gitorious.org/qt-creator/qt-creator/trees/master/dist/gdb
it didn’t help
SOLUTION: Qt libs didn't contain debug simbols. I was caught by flag -debug-and-release. It work in macOS and windows (MinGW) but not in Linux. Be careful!
Are you sure the version of Qt you use has been built with debug symbols? What does readelf -S /path/to/your/libQtCore.so say?

Resources