Linux あれこれ

Linux 関連(一部 Windows11 )の備忘録です。

Fedora 32 Xfce にて、カーネル5.8 で VScode、Atom、Chrome を動かす〈H88〉

登録日: 2020-09-17 更新日: 2021-01-12

Fedora 32 Xfce をUSB メモリにインストール しました。 カーネルは 新しい 5.8 です。

システム更新後のカーネル「5.8.7-200」において、インストールした「VScode」アプリを起動すると、ウィンドウの中の表示が真っ白とか真っ暗で、デスクトップ操作ができなくなりました。

-

問題となる「VScode」、「Atom」、「Chrome」を(不具合報告が上げやすい)公式サイトからダウンロードしてのインストールを行い、その回避策も書きました。

-

「目次」

-

Fedora 32 Xfce のデスクトップ画面:

-

情報:

2020-10-07

$ cat /etc/fedora-release
Fedora release 32 (Thirty Two)

$ uname -r
5.8.12-200.fc32.x86_64

-


1. Visual Studio Code のインストール

Visual Studio Code(略して VSCode )は、マイクロソフトが開発したオープンソース(MITライセンスでライセンス)のテキストエディタです。

Fedora でインストールするには、キーとリポジトリの追加が必要でした:

$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

$ sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'

$ sudo dnf check-update
Visual Studio Code                                                       98 kB/s | 5.5 MB     00:57

インストール:

$ sudo dnf install code
:
インストール済み:
  code-1.48.2-1598353576.el7.x86_64

→動作が不安定になってもいいように、他のアプリを終了してから起動します。

やはり、カーネル「5.8」だと、ウィンドウ画面が最初、真っ白でした。その後、だいぶ経ってからウィンドウの中が真っ黒に変わりました。

アプリが使えないだけでなく、デスクトップ自体の操作ができません。 解除は、Ctrl+Alt+F2 でコンソール画面にしてユーザでログイン。「reboot」しかありませんでした。

-

カーネルを「5.6.6-300」にして立ち上げると正常に使えます:

-


Visual Studio Code の日本語化:

Visual Studio Code の日本語化だけでなく、「Python 拡張機能」のインストールも行うときは、下記も行っておきます。

-

python プログラムファイルを作成:
$ echo 'print("Hello world!")'  > ~/ドキュメント/hello.py

$ cat ~/ドキュメント/hello.py
print("Hello world!")

→「~/ドキュメント/hello.py」

-

インストール手順:

Visual Studio Code の日本語化」、に続いて、必要なら「Python 拡張機能」のインストールを行います。 開くPython プログラムファイルは上記で作成した「~/ドキュメント/hello.py」を指定します。

下記の手順を参照:

Fedora 32 「Python Classroom」Lab をUSBメモリにインストール〈H77〉

Visual Studio Code の日本語化:

-

日本語化された画面:

-

バージョン情報:

追記: 2020-10-07 更新

バージョン: 1.49.3
コミット: 2af051012b66169dde0c4dfae3f5ef48f787ff69
日付: 2020-10-02T17:56:11.027Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.8.12-200.fc32.x86_64

-

$ dnf list code
:
インストール済みパッケージ
code.x86_64                     1.49.3-1601661990.el7                      @code

$ code --version
1.49.3
2af051012b66169dde0c4dfae3f5ef48f787ff69
x64

-


VSCode の使い方の参考:

-


2. 「Atom」エディタをインストール:

VSCode の切り分けのために、同じ「Electron フレームワーク」で作られている「Atom」エディタをインストールしてみました。

参考:

Atom wiki

Atomオープンソース(MITライセンス)で、GitHub によって開発されたテキストエディタです。 Electron フレームワークの上にWebテクノロジーを使用して構築されました。(VSCode と同じ手法)

-


公式バイナリによるインストール:

Atom 公式サイト を開いて、

「Download .rpm」ボタンをクリック

→ファイルを保存する→「atom.x86_64.rpm」がダウンロードされました。

右クリック→「dnfdoragora パッケージインストーラで開く」

→インストールされました。

dnfdoragora だと同期だけでも時間がかかったので、dnf コマンドでインストールした方が速いと思います。

-

参考: ローカルのパッケージをインストール:

$ cd ~/ダウンロード/
$ sudo dnf localinstall --nogpgcheck atom.x86_64.rpm

-

$ dnf search atom | grep editor
:
atom.x86_64 : A hackable text editor for the 21st Century.

$ dnf list atom
:
インストール済みパッケージ
atom.x86_64                       1.51.0-0.1                       @@commandline

$ atom --version
Atom    : 1.51.0
Electron: 5.0.13
Chrome  : 73.0.3683.121
Node    : 12.0.0

→動作が不安定になってもいいように、他のアプリを終了してから起動します。

やはり、カーネル「5.8」だとタイトルバーは表示されるけど、ウィンドウ画面は真っ白です。

アプリが使えないだけでなく、デスクトップ自体の操作ができなくなります。 ログイン画面に落るときもあります。

それ以外での解除は、Ctrl+Alt+F2 でコンソール画面にしてユーザでログイン。「reboot」しました。

-

カーネルを「5.6.6-300」にして立ち上げると正常に使えます:

-


Atom の日本語化:

1. Edit → Preferences → 「+ Install」

2. 検索欄に「japanese」

3. 表示された「japanese-menu」パッケージの「Install」ボタンをクリック。

4. メニューが日本語で表示されました。

-


Atom の使い方の参考:

[徹底解説]Atomの使い方から基本まで

-

テーマの変更

Ctrl+「,」(カンマ)→「Settings」タブ表示→左側の「Themes」タブ

Choose a Theme にて、テーマを選択。

  • UI Theme(全体のテーマ)

  • Syntax Theme(画面の背景色、特定文字の色分け)

-

プラグインのインストール

Ctrl+「,」(カンマ)→「Settings」タブ表示→左側の「Install」タブ

検索窓に「プラグイン名」を入力→「Packages」をクリック。

該当の「Install」をクリック。

→標準の「Markdown Preview」は無効にします。

  • Project Manager(開いたフォルダを記憶)

  • Subline Style Column Selector(矩形選択が使用可能)

-

Emmet(HTML 入力支援)を使ってみる:
  1. 新規ファイルを開きます。

  2. 英数モードで「!」を入力。

Ctrl+E

→「HTML の基本のソース文」が自動で入力されます。

  1. カーソルを「body」タグの下の空行に移動して、「p.top」と入力。

Ctrl+E

→「 <p class="top"></p> 」が自動で入力されます。

ファイルを一度保存(index.html 等)してから開くと、「Syntax Theme」が適用されて文字色が変わります。

参考:

Emmet チートシート

-

ショートカットキーの割当の変更:

Ctrl+「,」(カンマ)→「Settings」タブ表示→左側の「Keybindings」タブ

ショートカットキー(キーバインド)やプラグイン名で検索できます。

一覧の項目の左側のアイコンをクリックすると、設定内容がコピーできます。

「your keymap file」という青いリンクをクリック。 →「Keymap.cson」が開きます。

最終行で、Ctrl+P として貼り付け。

貼り付けた後に、それを修正します。

例えば、

'ctrl-e' → 'ctrl-shift-e'

保存。

-


3. 「Chrome」ブラウザをインストール:

VSCodeAtom の切り分けのために、元になっている環境の「Chrome」ブラウザをインストールしてみました。

公式サイト を開きます。

Chrome をダウンロード」をクリック

「64 ビット .rpmFedora/openSUSE 用)」にチェック

「同意してインストール」をクリック

→ファイルを保存する

google-chrome-stable_current_x86_64.rpm」がダウンロードされました。

-

Google のレポジトリを追加しない場合:

$ ls /etc/default/
grub  useradd

$ sudo touch /etc/default/google-chrome

$ ls /etc/default/
google-chrome  grub  useradd

-

インストール:

リモートにはないことを確認:

$ dnf search google-chrome-stable
:
一致する項目はありませんでした。

ローカルのパッケージをインストール:

$ cd ~/ダウンロード/
$ sudo dnf localinstall --nogpgcheck google-chrome-stable_current_x86_64.rpm
:
インストール:
 google-chrome-stable     x86_64     85.0.4183.102-1     @commandline      67 M
依存関係のインストール:
 liberation-fonts         noarch     1:2.1.0-1.fc32      fedora           8.3 k

これでよろしいですか? [y/N]: y

Fedora 以外からダウンロードしたパッケージには、GPG キーがないので無視する指定にします。

動作が不安定になってもいいように、他のアプリを終了してから起動します。

-

カーネル「5.8」だとタイトルバーは表示されますが、ウィンドウ画面が表示しきれません。

ログイン画面に落るときもあります。

ログイン画面に落ちないときの解除は、Ctrl+Alt+F2 でコンソール画面にしてユーザでログイン。「reboot」しました。

端末から起動すると、エラーメッセージを確認できました。

-

カーネルを「5.6.6-300」にして立ち上げると正常に使えます:

-

バージョンの確認:

$ cat /etc/fedora-release
Fedora release 32 (Thirty Two)

$ uname -r
5.8.7-200.fc32.x86_64

$ /usr/bin/google-chrome-stable --version
Google Chrome 85.0.4183.102

-

端末から起動してエラーを確認:

$ /usr/bin/google-chrome-stable 2>test.txt

$ cat test.txt
[3461:3461:0912/093119.954196:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[3461:3461:0912/093131.633339:ERROR:gl_surface_egl.cc(741)] EGL Driver message (Critical) eglCreateContext: Context lost.
:

→終了できないので、Ctrl+Alt+F2 でコンソール画面にしてユーザでログイン。「reboot」しました。

-


Google Chrome の不具合報告

2020-09-12

  • Google Chrome にて、問題を報告(Chrome に関するフィードバックを送信)しました。

-

要約:

カーネル「5.8.7-200」において、「Electron フレームワーク」を利用している「VSCode」と「Atom」のアプリを起動すると、ウィンドウが真っ白で動作しない現象が出ています。

その元になっている環境の「Chrome」ブラウザをインストールしてみました。 今回はその「Chrome」ブラウザで発生した現象です。

Chrome」ブラウザの障害は、「ハードウェアアクセラレーションが使用可能なときは使用する」をオフに設定することで、回避できました。

問題なのは、「Chrome」ブラウザがエラーとなる障害で、「Electron フレームワーク」を利用している「VSCode」と「Atom」のアプリが使えないこと、および、デスクトップの操作ができなくなることです。回避するには、カーネルを「5.6.6」にします。

希望:

「ハードウェアアクセラレーションの初期化で失敗するときは、オフで起動される」と、自動的に回避できると思います。

-


送信した内容:

表題:

Fedora 32 Xfce: When launching Chrome with kernel "5.8.7", "InitializeSandbox () called with multiple threads in process gpu-process."

-

usage environment:

-

Check version:

Google Chrome
Version: 85.0.4183.102 (Official Build) (64-bit)

-

$ cat /etc/fedora-release
Fedora release 32 (Thirty Two)

$ uname -r
5.8.7-200.fc32.x86_64

$ /usr/bin/google-chrome-stable --version
Google Chrome 85.0.4183.102

-

Detailed contents:

When I start Chrome with kernel "5.8.7", the title bar of the app is displayed, but nothing is displayed on the window screen. It is white. After a while, the login screen may be displayed. Or I can't control the desktop.

-

The problem is here:

When I launch the "VSCode" and "Atom" apps that use the "Electron framework" in the kernel "5.8.7-200", the window turns white and does not work. As a test, I installed the "Chrome" browser, which is the foundation of the "Electron framework".

This time it is a phenomenon that occurred in that "Chrome" browser. The "Chrome" browser failure could be avoided by turning off "Use when hardware acceleration is available".

The problem is that the "Chrome" browser causes an error that makes the "VSCode" and "Atom" apps that use the "Electron framework" unavailable and the desktop inoperable.

To avoid this, set the kernel to "5.6.6" and boot.

If possible, if the initialization of hardware acceleration fails, I think that it can be automatically avoided by not using hardware acceleration.

-

Launch a Chrome browser in a terminal emulator and check for errors:

$ /usr/bin/google-chrome-stable 2>test.txt

$ cat test.txt
[3461:3461:0912/093119.954196:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[3461:3461:0912/093131.633339:ERROR:gl_surface_egl.cc(741)] EGL Driver message (Critical) eglCreateContext: Context lost.
[3461:3461:0912/093131.633662:ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_CONTEXT_LOST
[3461:3461:0912/093131.635060:ERROR:gles2_command_buffer_stub.cc(319)] ContextResult::kFatalFailure: Failed to create context.
[3461:3461:0912/093131.635645:ERROR:gl_surface_egl.cc(741)] EGL Driver message (Critical) eglCreateContext: Context lost.
[3461:3461:0912/093131.643738:ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_CONTEXT_LOST
[3461:3461:0912/093131.645366:ERROR:gles2_command_buffer_stub.cc(319)] ContextResult::kFatalFailure: Failed to create context.
[3461:3461:0912/093131.646807:ERROR:gl_surface_egl.cc(741)] EGL Driver message (Critical) eglCreateContext: Context lost.
[3461:3461:0912/093131.646959:ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_CONTEXT_LOST
[3461:3461:0912/093131.647184:ERROR:gles2_command_buffer_stub.cc(319)] ContextResult::kFatalFailure: Failed to create context.
[3461:3461:0912/093131.647498:ERROR:shared_context_state.cc(721)] SharedContextState context lost via ARB/EXT_robustness. Reset status = GL_GUILTY_CONTEXT_RESET_KHR
[3461:3461:0912/093131.649273:ERROR:gpu_service_impl.cc(1124)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[3569:1:0912/093131.668900:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[3543:1:0912/093131.669648:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[3554:1:0912/093131.670296:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[3524:1:0912/093131.671317:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[3609:3609:0912/093131.785766:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[3609:3609:0912/093138.099181:ERROR:gles2_cmd_decoder_passthrough.cc(1495)]   GLES2DecoderPassthroughImpl: Context reset detected after MakeCurrent.
[3609:3609:0912/093138.099466:ERROR:gpu_service_impl.cc(1124)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[3621:3621:0912/093141.912201:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[3621:3621:0912/093148.469808:ERROR:x11_util.cc(112)] X IO error received (X server probably went away)
[3415:3415:0912/093148.470385:ERROR:x11_error_handler.cc(64)] X IO error received (X server probably went away)

-

Workaround:

If I can't see the login screen, press Ctrl + Alt + F2 to switch to the console screen and log in as a user. "reboot" to recover. Booting with the "5.6.6-300" kernel works fine.

By the way, Fedora 32 Cinnamon works fine in "Cinnamon (Software ...)" sessions.

-

Reference:

My PC doesn't support Gfxboot and it stops at boot when booting with Ubuntu 20.04.1 live USB stick.

Graphics initalization failed
Error Setting up gfxboot
boot: 

Press Tab, type "Live", and press Enter to start.

-


これまでの調査のまとめ

1. Fedora 32 のGNOME やCinnamon にて、カーネル「 5.7」、「5.8」に更新すると、特定のPC(自分のPC のこと)で、デスクトップの描画が点滅したりしてデスクトップそのものが使えなくなりました。

2. それが、Fedora 32 Xfce だと使えます。

3. ただし、Fedora 32 Xfce であっても、カーネル「5.8」で「VSCode」を使うと、画面真っ白や真っ黒になります。 同じような現象です。

4. それらのアプリが必要なら、インストール時のカーネル「5.6.6」が削除されないように死守するか、 Fedora 32 Cinnamon の「Cinnamon (Software ...)」セッションで使うか、です。

追記:

もうひとつは、「Fedora 32 Xfce」で使い、アプリの起動用の .desktop ファイルを修正して「ハードウェアアクセレーターを使わない」設定にします。

-

5. 切り分けのため、同じElectron フレームワークを使っている「Atom」をインストールしてみました。同じ現象。

6. Electron フレームワークの元になっている「Chrome ブラウザ」をインストールしてみました。同じ現象。

→こちらは端末にてエラーコードを確認できました。GPU の初期化でエラーしているみたい。 (問題として上がっていないので、特定のPC でのみ発生していると思われます)

7. 「Chrome ブラウザ」は、「ハードウェアアクセレーターを使わない」設定にすると立ち上がりました。

→「Atom」や「VSCode」アプリにもそのような指定があればいいのですが…。

-

8. 問題は、Chrome を元にした「Electron フレームワーク」を利用している「Atom」や「VSCode」アプリを起動できないことと、起動するとデスクトップの操作ができなくなることです。影響が大きいです。

9. 不具合の報告先は、難しいところ(Fedora、kernel、AtomVSCodeGoogle Chrome)です。

→エラーメッセージのわかっている「Google Chrome」にて、問題を報告(Chrome に関するフィードバックを送信)しました。

-


「ハードウェアアクセレーターを使わない」設定(GPU の無効化)

  • Atom」や「VSCode」アプリで「ハードウェアアクセレーターを使わない」設定を見つけました

まさか設定があるとは…。不具合報告が早過ぎたようです。たぶん取り上げられないので問題提起ということで…。

-

参考:

WindowsでGPGPU (CUDA) するときに余計なGPUメモリの消費を削減するためのTips

→表題からは想像もできませんね。

-


FirefoxGPU を無効化:

  • 問題がないので、さわりません。

設定→「推奨のパフォーマンス設定を使用する」のチェックを外すと、下記の設定ができるようになります。

パフォーマンス設定→「ハードウェアアクセラレーション機能を使用する(可能な場合)」のチェックを外す

-

設定してみたら、Firefox のパフォーマンスがガクッと落ちました。無応答になったりなので、問題がないのならさわらない方が無難です。

-


Google ChromeGPU を無効化:

設定→一番下の「詳細設定」→システム→「ハードウェアアクセラレーションが使用可能な場合は使用する」オン→オフに変更。

-

または、

起動オプションとして --disable-gpu を付加します。

$ sudo nano /usr/share/applications/google-chrome.desktop

下記の行を修正:

Exec=/usr/bin/google-chrome-stable --incognito

↓ 変更:

Exec=/usr/bin/google-chrome-stable --incognito --disable-gpu

-


Atom エディタ(Electron 系アプリ) でGPU を無効化:

$ sudo nano /usr/share/applications/atom.desktop

下記の行を修正:

Exec=env ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false /usr/bin/atom %F

↓ 変更:

Exec=env ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false /usr/bin/atom --disable-gpu %F

AtomGPU 無効で起動するには、 --disable-gpu を付けますが、この起動方法では自動更新が無効になります。

-

更新のたびに修正が必要なので、設定を退避:
$ sudo cp /usr/share/applications/atom.desktop /usr/share/applications/atom.desktop-ORG

-

確認:

$ ls /usr/share/applications/*-ORG
/usr/share/applications/atom.desktop-ORG

-

設定をやり直すとき:
$ sudo cp /usr/share/applications/atom.desktop-ORG /usr/share/applications/atom.desktop

-


Visual Studio Code(Electron 系アプリ) でGPU を無効化:

$ sudo nano /usr/share/applications/code.desktop

-

1つ目の修正:

Exec=/usr/share/code/code --no-sandbox --unity-launch %F

↓ 変更:

Exec=/usr/share/code/code --no-sandbox --unity-launch --disable-gpu %F

-

2つ目の修正:

Exec=/usr/share/code/code --no-sandbox --new-window %F

↓ 変更:

Exec=/usr/share/code/code --no-sandbox --new-window --disable-gpu %F

-

  • もうひとつ desktop ファイルがありました。
$ sudo nano /usr/share/applications/code-url-handler.desktop

修正:

Exec=/usr/share/code/code --no-sandbox --open-url %U

↓ 変更:

Exec=/usr/share/code/code --no-sandbox --open-url --disable-gpu %U

-

更新のたびに修正が必要なので、設定を退避:
$ sudo cp /usr/share/applications/code.desktop /usr/share/applications/code.desktop-ORG
$ sudo cp /usr/share/applications/code-url-handler.desktop /usr/share/applications/code-url-handler.desktop-ORG

-

確認:

$ ls /usr/share/applications/*-ORG
/usr/share/applications/code-url-handler.desktop-ORG
/usr/share/applications/code.desktop-ORG

-

設定をやり直すとき:
$ sudo cp /usr/share/applications/code.desktop-ORG /usr/share/applications/code.desktop
$ sudo cp /usr/share/applications/code-url-handler.desktop-ORG /usr/share/applications/code-url-handler.desktop

-


GPU のエラーメッセージが登録されていました

$ dmesg

[53459.794035] i915 0000:00:02.0: [drm] GPU HANG: ecode 7:1:8edcfc79, in glxinfo [10703]
[53459.794045] GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.
[53459.794046] Please file a _new_ bug report at https://gitlab.freedesktop.org/drm/intel/issues/new.
[53459.794046] Please see https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs for details.
[53459.794055] drm/i915 developers can then reassign to the right component if it's not a kernel issue.
[53459.794056] The GPU crash dump is required to analyze GPU hangs, so please always attach it.
[53459.794057] GPU crash dump saved to /sys/class/drm/card0/error
[53459.804236] i915 0000:00:02.0: [drm] Resetting chip for stopped heartbeat on rcs0
[53462.738026] i915 0000:00:02.0: [drm] GPU HANG: ecode 7:1:8edcfc7b
[53462.739861] i915 0000:00:02.0: [drm] Resetting chip for stopped heartbeat on rcs0

GPU がクラッシュしていました。

  • 検索すると、不具合報告がヒット:

[i915] GPU HANG: ecode 7:1:8edcfc79, in systemd-logind [411]

和訳:

2020年6月11日

Archlinux を使用しています。linux-5.7.2 にアップグレードした後、Xorgの起動直後にGPU がハングします。 システムが応答しなくなり、画面がランダムに点滅し始めます。 linux-lts-5.4.46、linux-5.6.15でも再現性がなかったため、linux-5.7.xでi915と互換性がないと考えられます。

→「/drm/intel/」というi915 の報告先に上がっていました。表現は違うけど、同じような現象です。デスクトップの描画がおかしくなる問題は「Fedora 32 Xfce」では表面化していないけど、裏ではコケていたようです。

-


まとめ

カーネル「 5.7」や「5.8」で、特定のPC(自分のPC のこと)でデスクトップの描画がおかしくなる問題は「Fedora 32 Xfce」では発生していません(表面化していません)でした。

ただし、「Visual Studio Code」や「Atom」だけは取り残された印象で、同じような現象でうまく起動できません。

しばらくして、アプリごとの「ハードウェアアクセレーターを使わない」設定が見つかり解決できました。検索ワードが良くなかったようです。

-

GNOME で(同じように)デスクトップが使えない件は、別の投稿 にしました。

-

-


目次

先頭

-


-