Friday 19 March 2021

How to rip DVD disc on Ubuntu

 I used HandBrake application and it was incredibly easy and fast.

To install it, we need to add developer's package repository first:

$ sudo add-apt-repository ppa:stebbins/handbrake-releases
$ sudo apt-get update

HandBrake installation:

$ sudo apt-get install handbrake-cli handbrake-gtk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
handbrake-gtk is already the newest version (1:1.3.3.1-zhb-1ppa1~focal1).
The following NEW packages will be installed
  handbrake-cli
0 to upgrade, 1 to newly install, 0 to remove and 35 not to upgrade.
Need to get 8,623 kB of archives.
After this operation, 40.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu focal/main amd64 handbrake-cli amd64 1:1.3.3.1-zhb-1ppa1~focal1 [8,623 kB]
Fetched 8,623 kB in 3s (3,041 kB/s)        
Selecting previously unselected package handbrake-cli.
(Reading database ... 351992 files and directories currently installed.)
Preparing to unpack .../handbrake-cli_1%3a1.3.3.1-zhb-1ppa1~focal1_amd64.deb ...
Unpacking handbrake-cli (1:1.3.3.1-zhb-1ppa1~focal1) ...
Setting up handbrake-cli (1:1.3.3.1-zhb-1ppa1~focal1) ...

After this, the application is installed and we can run it by clicking on its exotically looking icon:


This is the main window of the application:


To rip the DVD disc we need to click on Open Source icon and select the DVD drive. Once this is done, HandBrake automatically reads all video sections (titles) from the DVD (these are videos that we can choose from the main menu that is displayed when we play DVD):


All we have to do now is to select a title and press Start. This will rip selected title into a new m4v (mp4) video file on your local disk. This has to be repeated for each title. Job done!

Wednesday 17 March 2021

How to play DVD disc on Ubuntu

Here is what I needed to do on my PC in order to play a DVD disc. 

I am running the Ubuntu 20.04:

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


I chose to use VLC media player.


VLC installation:

$ sudo apt install vlc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liba52-0.7.4 libaribb24-0 libbasicusageenvironment1 libcddb2 libdca0 libdvbpsi10 libdvdnav4 libdvdread7 libebml4v5 libfaad2 libgroupsock8 libixml10 libkate1 liblivemedia77 libmad0
  libmatroska6v5 libmpcdec6 libmpeg2-4 libopenmpt-modplug1 libplacebo7 libproxy-tools libresid-builder0c2a libsdl-image1.2 libsidplay2 libspatialaudio0 libsrt1 libssh2-1 libupnp13
  libusageenvironment3 libva-wayland2 libvlc-bin libvlc5 libvlccore9 vlc-bin vlc-data vlc-l10n vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-skins2
  vlc-plugin-video-output vlc-plugin-video-splitter vlc-plugin-visualization
Suggested packages:
  libdvdcss2
The following NEW packages will be installed
  liba52-0.7.4 libaribb24-0 libbasicusageenvironment1 libcddb2 libdca0 libdvbpsi10 libdvdnav4 libdvdread7 libebml4v5 libfaad2 libgroupsock8 libixml10 libkate1 liblivemedia77 libmad0
  libmatroska6v5 libmpcdec6 libmpeg2-4 libopenmpt-modplug1 libplacebo7 libproxy-tools libresid-builder0c2a libsdl-image1.2 libsidplay2 libspatialaudio0 libsrt1 libssh2-1 libupnp13
  libusageenvironment3 libva-wayland2 libvlc-bin libvlc5 libvlccore9 vlc vlc-bin vlc-data vlc-l10n vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-skins2
  vlc-plugin-video-output vlc-plugin-video-splitter vlc-plugin-visualization
0 to upgrade, 45 to newly install, 0 to remove and 18 not to upgrade.
Need to get 13.7 MB of archives.
After this operation, 71.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 liba52-0.7.4 amd64 0.7.4-20 [30.5 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libaribb24-0 amd64 1.0.3-2 [26.9 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libusageenvironment3 amd64 2020.01.19-1build1 [6,960 B]
Get:4 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libbasicusageenvironment1 amd64 2020.01.19-1build1 [15.2 kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libcddb2 amd64 1.3.2-6fakesync1 [34.3 kB]
Get:6 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdvbpsi10 amd64 1.3.3-1 [47.1 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdvdread7 amd64 6.1.0+really6.0.2-1 [49.9 kB]
Get:8 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdvdnav4 amd64 6.0.1-1build1 [39.0 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libebml4v5 amd64 1.3.10-1build1 [49.1 kB]
Get:10 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libfaad2 amd64 2.9.1-1 [154 kB]
Get:11 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libgroupsock8 amd64 2020.01.19-1build1 [20.7 kB]
Get:12 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libixml10 amd64 1:1.8.4-2ubuntu2 [23.6 kB]
Get:13 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libkate1 amd64 0.4.1-11build1 [39.4 kB]
Get:14 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 liblivemedia77 amd64 2020.01.19-1build1 [318 kB]
Get:15 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmad0 amd64 0.15.1b-10ubuntu1 [63.1 kB]
Get:16 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmatroska6v5 amd64 1.5.2-3build1 [124 kB]
Get:17 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmpcdec6 amd64 2:0.1~r495-2 [32.4 kB]
Get:18 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmpeg2-4 amd64 0.5.1-9 [50.7 kB]
Get:19 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libopenmpt-modplug1 amd64 0.4.11-1build1 [20.0 kB]
Get:20 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libplacebo7 amd64 1.7.0-2 [721 kB]
Get:21 http://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libproxy-tools amd64 0.4.15-10ubuntu1.2 [5,440 B]
Get:22 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libresid-builder0c2a amd64 2.1.1-15ubuntu2 [31.3 kB]
Get:23 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libsdl-image1.2 amd64 1.2.12-12 [30.0 kB]
Get:24 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libsidplay2 amd64 2.1.1-15ubuntu2 [89.2 kB]
Get:25 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libspatialaudio0 amd64 0.3.0+git20180730+dfsg1-2build1 [32.9 kB]
Get:26 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libsrt1 amd64 1.4.0-1build1 [236 kB]
Get:27 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libssh2-1 amd64 1.8.0-2.1build1 [75.4 kB]
Get:28 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libupnp13 amd64 1:1.8.4-2ubuntu2 [87.9 kB]
Get:29 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libva-wayland2 amd64 2.7.0-2 [8,924 B]
Get:30 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libvlccore9 amd64 3.0.9.2-1 [428 kB]
Get:31 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libvlc5 amd64 3.0.9.2-1 [65.8 kB]
Get:32 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libvlc-bin amd64 3.0.9.2-1 [17.1 kB]
Get:33 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-bin amd64 3.0.9.2-1 [54.2 kB]
Get:34 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-data all 3.0.9.2-1 [339 kB]
Get:35 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdca0 amd64 0.0.6-1 [91.0 kB]
Get:36 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-base amd64 3.0.9.2-1 [2,854 kB]
Get:37 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-qt amd64 3.0.9.2-1 [1,054 kB]
Get:38 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-video-output amd64 3.0.9.2-1 [160 kB]
Get:39 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc amd64 3.0.9.2-1 [34.0 kB]
Get:40 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-l10n all 3.0.9.2-1 [5,584 kB]
Get:41 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-notify amd64 3.0.9.2-1 [18.2 kB]
Get:42 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-samba amd64 3.0.9.2-1 [18.8 kB]
Get:43 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-skins2 amd64 3.0.9.2-1 [471 kB]
Get:44 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-video-splitter amd64 3.0.9.2-1 [32.4 kB]
Get:45 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-visualization amd64 3.0.9.2-1 [36.2 kB]
Fetched 13.7 MB in 4s (3,493 kB/s)                    
Extract templates from packages: 100%
Selecting previously unselected package liba52-0.7.4:amd64.
(Reading database ... 350491 files and directories currently installed.)
Preparing to unpack .../00-liba52-0.7.4_0.7.4-20_amd64.deb ...
Unpacking liba52-0.7.4:amd64 (0.7.4-20) ...
Selecting previously unselected package libaribb24-0:amd64.
Preparing to unpack .../01-libaribb24-0_1.0.3-2_amd64.deb ...
Unpacking libaribb24-0:amd64 (1.0.3-2) ...
Selecting previously unselected package libusageenvironment3:amd64.
Preparing to unpack .../02-libusageenvironment3_2020.01.19-1build1_amd64.deb ...
Unpacking libusageenvironment3:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libbasicusageenvironment1:amd64.
Preparing to unpack .../03-libbasicusageenvironment1_2020.01.19-1build1_amd64.deb ...
Unpacking libbasicusageenvironment1:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libcddb2.
Preparing to unpack .../04-libcddb2_1.3.2-6fakesync1_amd64.deb ...
Unpacking libcddb2 (1.3.2-6fakesync1) ...
Selecting previously unselected package libdvbpsi10:amd64.
Preparing to unpack .../05-libdvbpsi10_1.3.3-1_amd64.deb ...
Unpacking libdvbpsi10:amd64 (1.3.3-1) ...
Selecting previously unselected package libdvdread7:amd64.
Preparing to unpack .../06-libdvdread7_6.1.0+really6.0.2-1_amd64.deb ...
Unpacking libdvdread7:amd64 (6.1.0+really6.0.2-1) ...
Selecting previously unselected package libdvdnav4:amd64.
Preparing to unpack .../07-libdvdnav4_6.0.1-1build1_amd64.deb ...
Unpacking libdvdnav4:amd64 (6.0.1-1build1) ...
Selecting previously unselected package libebml4v5:amd64.
Preparing to unpack .../08-libebml4v5_1.3.10-1build1_amd64.deb ...
Unpacking libebml4v5:amd64 (1.3.10-1build1) ...
Selecting previously unselected package libfaad2:amd64.
Preparing to unpack .../09-libfaad2_2.9.1-1_amd64.deb ...
Unpacking libfaad2:amd64 (2.9.1-1) ...
Selecting previously unselected package libgroupsock8:amd64.
Preparing to unpack .../10-libgroupsock8_2020.01.19-1build1_amd64.deb ...
Unpacking libgroupsock8:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libixml10:amd64.
Preparing to unpack .../11-libixml10_1%3a1.8.4-2ubuntu2_amd64.deb ...
Unpacking libixml10:amd64 (1:1.8.4-2ubuntu2) ...
Selecting previously unselected package libkate1:amd64.
Preparing to unpack .../12-libkate1_0.4.1-11build1_amd64.deb ...
Unpacking libkate1:amd64 (0.4.1-11build1) ...
Selecting previously unselected package liblivemedia77:amd64.
Preparing to unpack .../13-liblivemedia77_2020.01.19-1build1_amd64.deb ...
Unpacking liblivemedia77:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libmad0:amd64.
Preparing to unpack .../14-libmad0_0.15.1b-10ubuntu1_amd64.deb ...
Unpacking libmad0:amd64 (0.15.1b-10ubuntu1) ...
Selecting previously unselected package libmatroska6v5:amd64.
Preparing to unpack .../15-libmatroska6v5_1.5.2-3build1_amd64.deb ...
Unpacking libmatroska6v5:amd64 (1.5.2-3build1) ...
Selecting previously unselected package libmpcdec6:amd64.
Preparing to unpack .../16-libmpcdec6_2%3a0.1~r495-2_amd64.deb ...
Unpacking libmpcdec6:amd64 (2:0.1~r495-2) ...
Selecting previously unselected package libmpeg2-4:amd64.
Preparing to unpack .../17-libmpeg2-4_0.5.1-9_amd64.deb ...
Unpacking libmpeg2-4:amd64 (0.5.1-9) ...
Selecting previously unselected package libopenmpt-modplug1:amd64.
Preparing to unpack .../18-libopenmpt-modplug1_0.4.11-1build1_amd64.deb ...
Unpacking libopenmpt-modplug1:amd64 (0.4.11-1build1) ...
Selecting previously unselected package libplacebo7:amd64.
Preparing to unpack .../19-libplacebo7_1.7.0-2_amd64.deb ...
Unpacking libplacebo7:amd64 (1.7.0-2) ...
Selecting previously unselected package libproxy-tools.
Preparing to unpack .../20-libproxy-tools_0.4.15-10ubuntu1.2_amd64.deb ...
Unpacking libproxy-tools (0.4.15-10ubuntu1.2) ...
Selecting previously unselected package libresid-builder0c2a.
Preparing to unpack .../21-libresid-builder0c2a_2.1.1-15ubuntu2_amd64.deb ...
Unpacking libresid-builder0c2a (2.1.1-15ubuntu2) ...
Selecting previously unselected package libsdl-image1.2:amd64.
Preparing to unpack .../22-libsdl-image1.2_1.2.12-12_amd64.deb ...
Unpacking libsdl-image1.2:amd64 (1.2.12-12) ...
Selecting previously unselected package libsidplay2.
Preparing to unpack .../23-libsidplay2_2.1.1-15ubuntu2_amd64.deb ...
Unpacking libsidplay2 (2.1.1-15ubuntu2) ...
Selecting previously unselected package libspatialaudio0:amd64.
Preparing to unpack .../24-libspatialaudio0_0.3.0+git20180730+dfsg1-2build1_amd64.deb ...
Unpacking libspatialaudio0:amd64 (0.3.0+git20180730+dfsg1-2build1) ...
Selecting previously unselected package libsrt1:amd64.
Preparing to unpack .../25-libsrt1_1.4.0-1build1_amd64.deb ...
Unpacking libsrt1:amd64 (1.4.0-1build1) ...
Selecting previously unselected package libssh2-1:amd64.
Preparing to unpack .../26-libssh2-1_1.8.0-2.1build1_amd64.deb ...
Unpacking libssh2-1:amd64 (1.8.0-2.1build1) ...
Selecting previously unselected package libupnp13:amd64.
Preparing to unpack .../27-libupnp13_1%3a1.8.4-2ubuntu2_amd64.deb ...
Unpacking libupnp13:amd64 (1:1.8.4-2ubuntu2) ...
Selecting previously unselected package libva-wayland2:amd64.
Preparing to unpack .../28-libva-wayland2_2.7.0-2_amd64.deb ...
Unpacking libva-wayland2:amd64 (2.7.0-2) ...
Selecting previously unselected package libvlccore9:amd64.
Preparing to unpack .../29-libvlccore9_3.0.9.2-1_amd64.deb ...
Unpacking libvlccore9:amd64 (3.0.9.2-1) ...
Selecting previously unselected package libvlc5:amd64.
Preparing to unpack .../30-libvlc5_3.0.9.2-1_amd64.deb ...
Unpacking libvlc5:amd64 (3.0.9.2-1) ...
Selecting previously unselected package libvlc-bin:amd64.
Preparing to unpack .../31-libvlc-bin_3.0.9.2-1_amd64.deb ...
Unpacking libvlc-bin:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-bin.
Preparing to unpack .../32-vlc-bin_3.0.9.2-1_amd64.deb ...
Unpacking vlc-bin (3.0.9.2-1) ...
Selecting previously unselected package vlc-data.
Preparing to unpack .../33-vlc-data_3.0.9.2-1_all.deb ...
Unpacking vlc-data (3.0.9.2-1) ...
Selecting previously unselected package libdca0:amd64.
Preparing to unpack .../34-libdca0_0.0.6-1_amd64.deb ...
Unpacking libdca0:amd64 (0.0.6-1) ...
Selecting previously unselected package vlc-plugin-base:amd64.
Preparing to unpack .../35-vlc-plugin-base_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-base:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-qt:amd64.
Preparing to unpack .../36-vlc-plugin-qt_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-qt:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-video-output:amd64.
Preparing to unpack .../37-vlc-plugin-video-output_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-video-output:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc.
Preparing to unpack .../38-vlc_3.0.9.2-1_amd64.deb ...
Unpacking vlc (3.0.9.2-1) ...
Selecting previously unselected package vlc-l10n.
Preparing to unpack .../39-vlc-l10n_3.0.9.2-1_all.deb ...
Unpacking vlc-l10n (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-notify:amd64.
Preparing to unpack .../40-vlc-plugin-notify_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-notify:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-samba:amd64.
Preparing to unpack .../41-vlc-plugin-samba_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-samba:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-skins2:amd64.
Preparing to unpack .../42-vlc-plugin-skins2_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-skins2:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-video-splitter:amd64.
Preparing to unpack .../43-vlc-plugin-video-splitter_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-video-splitter:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-visualization:amd64.
Preparing to unpack .../44-vlc-plugin-visualization_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-visualization:amd64 (3.0.9.2-1) ...
Setting up libsdl-image1.2:amd64 (1.2.12-12) ...
Setting up libkate1:amd64 (0.4.1-11build1) ...
Setting up libdvbpsi10:amd64 (1.3.3-1) ...
Setting up libebml4v5:amd64 (1.3.10-1build1) ...
Setting up libdvdread7:amd64 (6.1.0+really6.0.2-1) ...
Setting up libspatialaudio0:amd64 (0.3.0+git20180730+dfsg1-2build1) ...
Setting up vlc-l10n (3.0.9.2-1) ...
Setting up libmpeg2-4:amd64 (0.5.1-9) ...
Setting up libaribb24-0:amd64 (1.0.3-2) ...
Setting up libusageenvironment3:amd64 (2020.01.19-1build1) ...
Setting up libmpcdec6:amd64 (2:0.1~r495-2) ...
Setting up libcddb2 (1.3.2-6fakesync1) ...
Setting up liba52-0.7.4:amd64 (0.7.4-20) ...
Setting up libmatroska6v5:amd64 (1.5.2-3build1) ...
Setting up libixml10:amd64 (1:1.8.4-2ubuntu2) ...
Setting up libresid-builder0c2a (2.1.1-15ubuntu2) ...
Setting up libfaad2:amd64 (2.9.1-1) ...
Setting up libbasicusageenvironment1:amd64 (2020.01.19-1build1) ...
Setting up libvlccore9:amd64 (3.0.9.2-1) ...
Setting up libsidplay2 (2.1.1-15ubuntu2) ...
Setting up libva-wayland2:amd64 (2.7.0-2) ...
Setting up libmad0:amd64 (0.15.1b-10ubuntu1) ...
Setting up libsrt1:amd64 (1.4.0-1build1) ...
Setting up vlc-plugin-qt:amd64 (3.0.9.2-1) ...
Setting up libdca0:amd64 (0.0.6-1) ...
Setting up libssh2-1:amd64 (1.8.0-2.1build1) ...
Setting up libopenmpt-modplug1:amd64 (0.4.11-1build1) ...
Setting up vlc-data (3.0.9.2-1) ...
Setting up libplacebo7:amd64 (1.7.0-2) ...
Setting up vlc-plugin-notify:amd64 (3.0.9.2-1) ...
Setting up libdvdnav4:amd64 (6.0.1-1build1) ...
Setting up libproxy-tools (0.4.15-10ubuntu1.2) ...
Setting up vlc-plugin-video-output:amd64 (3.0.9.2-1) ...
Setting up vlc-plugin-samba:amd64 (3.0.9.2-1) ...
Setting up libgroupsock8:amd64 (2020.01.19-1build1) ...
Setting up vlc-plugin-skins2:amd64 (3.0.9.2-1) ...
Setting up vlc-plugin-video-splitter:amd64 (3.0.9.2-1) ...
Setting up libvlc5:amd64 (3.0.9.2-1) ...
Setting up libupnp13:amd64 (1:1.8.4-2ubuntu2) ...
Setting up vlc-plugin-visualization:amd64 (3.0.9.2-1) ...
Setting up libvlc-bin:amd64 (3.0.9.2-1) ...
Setting up liblivemedia77:amd64 (2020.01.19-1build1) ...
Setting up vlc-bin (3.0.9.2-1) ...
Setting up vlc-plugin-base:amd64 (3.0.9.2-1) ...
Setting up vlc (3.0.9.2-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.5 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for libvlc-bin:amd64 (3.0.9.2-1) ...


It was necessary to install several packages. 
 
libdvd-pkg package provides libraries that are needed for playing video DVDs with a media player (such as VLC, SMplayer, Totem, etc.). 
 
libdvdnav4 is a DVD navigation library, which provides an interface to the advanced features of DVDs, like menus and navigation. It contains the VM and other parts useful for writing DVD players.
 
libdvdread7 is a package for reading DVDs.

$ sudo apt install libdvd-pkg libdvdnav4 libdvdread7 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libdvdnav4 is already the newest version (6.0.1-1build1).
libdvdnav4 set to manually installed.
libdvdread7 is already the newest version (6.1.0+really6.0.2-1).
libdvdread7 set to manually installed.
The following NEW packages will be installed
  libdvd-pkg
0 to upgrade, 1 to newly install, 0 to remove and 18 not to upgrade.
Need to get 14.9 kB of archives.
After this operation, 80.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/multiverse amd64 libdvd-pkg all 1.4.2-1-1 [14.9 kB]
Fetched 14.9 kB in 0s (212 kB/s)    
Preconfiguring packages ...
Selecting previously unselected package libdvd-pkg.
(Reading database ... 351510 files and directories currently installed.)
Preparing to unpack .../libdvd-pkg_1.4.2-1-1_all.deb ...
Unpacking libdvd-pkg (1.4.2-1-1) ...
Setting up libdvd-pkg (1.4.2-1-1) ...
libdvd-pkg: dpkg database is locked. You may need to use command "sudo dpkg-reco
nfigure libdvd-pkg".
libdvd-pkg: Building and installation of package(s) [libdvdcss2 libdvdcss-dev] p
ostponed till after next APT operation.





$ sudo dpkg-reconfigure libdvd-pkg
libdvd-pkg: Downloading orig source...
I: libdvdcss_1.4.2
/usr/bin/wget --tries=3 --timeout=40 --read-timeout=40 --continue -O libdvdcss_1.4.2.orig.tar.bz2 \
          http://download.videolan.org/pub/libdvdcss/1.4.2/libdvdcss-1.4.2.tar.bz2 \
        || /usr/bin/uscan --noconf --verbose --rename --destdir=/usr/src/libdvd-pkg --check-dirname-level=0 --force-download --download-current-version /usr/share/libdvd-pkg/debian
--2021-03-17 08:02:21--  http://download.videolan.org/pub/libdvdcss/1.4.2/libdvdcss-1.4.2.tar.bz2
Resolving download.videolan.org (download.videolan.org)... 2a01:e0d:1:3:58bf:fa02:c0de:5, 213.36.253.2
Connecting to download.videolan.org (download.videolan.org)|2a01:e0d:1:3:58bf:fa02:c0de:5|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 366824 (358K) [application/octet-stream]
Saving to: ‘libdvdcss_1.4.2.orig.tar.bz2’

libdvdcss_1.4.2.orig.tar 100%[=================================>] 358.23K  2.27MB/s    in 0.2s    

2021-03-17 08:02:22 (2.27 MB/s) - ‘libdvdcss_1.4.2.orig.tar.bz2’ saved [366824/366824]

libdvd-pkg: Checking orig.tar integrity...
/usr/src/libdvd-pkg/libdvdcss_1.4.2.orig.tar.bz2: OK
libdvd-pkg: Unpacking and configuring...
libdvd-pkg: Building the package... (it may take a while)
libdvd-pkg: Build log will be saved to /usr/src/libdvd-pkg/libdvdcss2_1.4.2-1~local_amd64.build
Current: =ep
Bounding set =cap_chown,cap_dac_override,cap_fowner,cap_wake_alarm,cap_block_suspend,cap_audit_read
Ambient set =
Securebits: 024/0x14/5'b10100
 secure-noroot: no (unlocked)
 secure-no-suid-fixup: yes (unlocked)
 secure-keep-caps: yes (unlocked)
 secure-no-ambient-raise: no (unlocked)
uid=0(root) euid=0(root)
gid=0(root)
groups=0(root)
Guessed mode: UNCERTAIN (0)
libdvd-pkg: Installing...
Selecting previously unselected package libdvdcss-dev:amd64.
(Reading database ... 351541 files and directories currently installed.)
Preparing to unpack .../libdvdcss-dev_1.4.2-1~local_amd64.deb ...
Unpacking libdvdcss-dev:amd64 (1.4.2-1~local) ...
Selecting previously unselected package libdvdcss2:amd64.
Preparing to unpack .../libdvdcss2_1.4.2-1~local_amd64.deb ...
Unpacking libdvdcss2:amd64 (1.4.2-1~local) ...
Setting up libdvdcss2:amd64 (1.4.2-1~local) ...
Setting up libdvdcss-dev:amd64 (1.4.2-1~local) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.5 is not a symbolic link


Upon installing dependencies, I was able to open and play DVD disc:






References:




Sunday 14 March 2021

Running NVIDIA DIGITS Docker container on Ubuntu

Installing NVIDIA DIGITS directly on your computer means that you'll:
  • spend a considerable amount of time in installing all dependencies and building DIGITS itself
  • pollute your machine with another application and its dependencies
To prevent this, we can run NVIDIA DIGITS Docker container. Let's check first whether docker is installed and its version :

$ docker --version
Docker version 20.10.3, build 48d30b5

For the reference, I was running the commands I listed below in this article on my Ubuntu 20.04:

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

Ideally, we'd be running NVIDIA Digits on a machine with GPU(s). This would speed up training and inference but Digits can also work on a machine which has a CPU only. 

I have GeForce GT 640 graphics card:

$ nvidia-smi -L
GPU 0: GeForce GT 640 (UUID: GPU-f2583df9-404d-2564-d332-e7878a94d087)

$ lspci
...
VGA compatible controller: NVIDIA Corporation GK107 [GeForce GT 640 OEM] (rev a1)
...

GK107 is a code name for GeForce GT 640 (GDDR5) (source: GeForce 600 series - Wikipedia) which, according to CUDA GPUs | NVIDIA Developer, has computing capability 3.5 (which is supported as it has to be >2.1 according to Installation Guide — NVIDIA Cloud Native Technologies documentation).

To test the local GPU we can run nvidia-smi application on the local host or in Docker image.

If we haven't installed CUDA or nvidia-smi locally, we can run nvidia-smi from NVIDIA CUDA Docker image:

$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
Thu Feb 11 01:02:09 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GT 640      Off  | 00000000:01:00.0 N/A |                  N/A |
| 40%   31C    P8    N/A /  N/A |    286MiB /  1992MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+


Let's now follow the instructions from DIGITS | NVIDIA NGC. We first need to download the image to our local host:

$ docker pull nvcr.io/nvidia/digits:20.12-tensorflow-py3
20.12-tensorflow-py3: Pulling from nvidia/digits
6a5697faee43: Pulling fs layer 
ba13d3bc422b: Pulling fs layer 
...
cec6045b0d0e: Pulling fs layer 
cb4aa708e833: Waiting 
235cfa23a5f4: Waiting 
24781a3c82ea: Waiting 
f7c7d47c1a97: Pull complete 
...
b57dde2f2923: Pull complete 
Digest: sha256:7542143bc2292fc48a3874786877815a5ca6a74a69366324aaf66914155cb5a7
Status: Downloaded newer image for nvcr.io/nvidia/digits:20.12-tensorflow-py3
nvcr.io/nvidia/digits:20.12-tensorflow-py3

Let's now run the container. docker run has --gpus option which instructs Docker to add GPU devices to container ('all' to pass all GPUs).

$ docker run --gpus all -it --rm nvcr.io/nvidia/digits:20.12-tensorflow-py3
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

I haven't installed NVIDIA Container Toolkit (nvidia-docker) which enable Docker containers accessing host's GPU. Installation Guide — NVIDIA Cloud Native Technologies documentation describes how to install it:

$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
   && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
$ sudo apt-get update
$ sudo apt-get install -y nvidia-docker2
$ sudo systemctl restart docker


nvidia-docker version 
NVIDIA Docker: 2.5.0
Client: Docker Engine - Community
 Version:           20.10.3
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        48d30b5
 Built:             Fri Jan 29 14:33:21 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.3
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       46229ca
  Built:            Fri Jan 29 14:31:32 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0


To be on the safe side, I also installed the latest NVIDIA driver.

$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
[sudo] password for bojan: 
Thu Feb 11 01:02:09 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GT 640      Off  | 00000000:01:00.0 N/A |                  N/A |
| 40%   31C    P8    N/A /  N/A |    286MiB /  1992MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+


This time running DIGITS container was successful. DIGITS 6.0 http server uses port 5000 by default and in this example it is mapped to host port 8888.

$ docker run --gpus all -it --rm -p 8888:5000 nvcr.io/nvidia/digits:20.12-tensorflow-py3

============
== DIGITS ==
============

NVIDIA Release 20.12 (build 17912121)
DIGITS Version 6.1.1

Container image Copyright (c) 2020, NVIDIA CORPORATION.  All rights reserved.
DIGITS Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved.

Various files include modifications (c) NVIDIA CORPORATION.  All rights reserved.
NVIDIA modifications are covered by the license terms that apply to the underlying project or file.
ERROR: No supported GPU(s) detected to run this container

  ___ ___ ___ ___ _____ ___
 |   \_ _/ __|_ _|_   _/ __|
 | |) | | (_ || |  | | \__ \
 |___/___\___|___| |_| |___/ 6.1.1

Caffe support disabled.
Reason: A valid Caffe installation was not found on your system.
cudaRuntimeGetVersion() failed with error #999
2021-02-11 16:23:54.454747: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
/opt/digits/digits/pretrained_model/views.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if str(files['weights_file'].filename) is '':
/opt/digits/digits/pretrained_model/views.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if str(files['model_def_file'].filename) is '':
/opt/digits/digits/pretrained_model/views.py:54: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if str(files['weights_file'].filename) is '':
/opt/digits/digits/pretrained_model/views.py:60: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if str(files['model_def_file'].filename) is '':
/opt/digits/digits/pretrained_model/views.py:169: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif str(flask.request.form['job_name']) is '':
/opt/digits/digits/pretrained_model/views.py:177: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if str(flask.request.files['labels_file'].filename) is not '':
2021-02-11 16:23:56 [INFO ] Loaded 0 jobs.


If we now open a browser on the host and type http://localhost:8888 we'll be able to see DIGITS home page:



As DIGITS is a web-based application we don't need to run it in interactive mode (docker run -it) but can run it in a detached mode (docker run -d):

$ docker run \
--gpus all \
-d \
--name digits \
--rm \
-p 8888:5000 \
-v /home/bojan/dev/digits-demo/data:/data \
-v /home/bojan/dev/digits-demo/jobs:/workspace/jobs \ nvcr.io/nvidia/digits:20.12-tensorflow-py3

905f9a8c8e48bc87ae99117eed92b855d45c7d37695c0e94433bd18fab6bfaca

We can verify that DIGITS container is indeed running:

$ docker ps 
CONTAINER ID   IMAGE                                        COMMAND                  CREATED              STATUS              PORTS                                                  NAMES
905f9a8c8e48   nvcr.io/nvidia/digits:20.12-tensorflow-py3   "/usr/local/bin/nvid…"   About a minute ago   Up About a minute   6006/tcp, 6064/tcp, 8888/tcp, 0.0.0.0:8888->5000/tcp   digits


Why DIGITS doesn't recognize my GPU?



One thing didn't seem right to me though. In the upper right corner of the DIGITS home page should be a text which indicates how many GPUs are available. In my case, although I have one GPU, no GPUs were listed. 




I tried first to check if GPU is indeed visible from the container:

$ docker exec -it digits bash
root@e58b860504a9:/workspace# 

root@e58b860504a9:/workspace# nvidia-smi
Fri Feb 12 23:33:17 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GT 640      Off  | 00000000:01:00.0 N/A |                  N/A |
| 40%   32C    P8    N/A /  N/A |    260MiB /  1992MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Graphics card was visible. DIGITS installation contains a Python script which is DIGITS Device Query (source code: python/9427/DIGITS/digits/device_query.py). When I tried to run it, I got an error:

root@e58b860504a9:/opt/digits/digits# python device_query.py 
cudaRuntimeGetVersion() failed with error #999
No devices found.


cudaErrorUnknown = 999
This indicates that an unknown internal error has occurred.
CUDA was installed fine:

root@6cd6c429f20c:/workspace# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0


On the host system I checked if loading the NVIDIA driver gave any errors (NVRM errors are internal to the nvidia kernel module):

$ sudo dmesg |grep NVRM
[sudo] password for bojan: 
[    2.283911] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  460.32.03  Sun Dec 27 19:00:34 UTC 2020
[ 8654.742795] NVRM: GPU at PCI:0000:01:00: GPU-f2583df9-404d-2564-d332-e7878a94d087
[ 8654.742800] NVRM: Xid (PCI:0000:01:00): 31, pid=577, Ch 00000002, intr 10000000. MMU Fault: ENGINE HOST4 HUBCLIENT_HOST faulted @ 0x1_01160000. Fault is of type FAULT_INFO_TYPE_UNSUPPORTED


I could not deduct anything useful from here but by reading DIGITS release notes I finally found the reason why DIGITS won't recognize my GPU - it is too old!

Installation Guide — NVIDIA Cloud Native Technologies documentation specifies compute capability requirements for NVIDIA Container Toolkit but compute capability requirements for DIGITS Docker image are specified for each image release. For digits:20.12 DIGITS Release Notes :: NVIDIA Deep Learning DIGITS Documentation states the following:

Release 20.12 supports CUDA compute capability 6.0 and higher.

My GPU has compute capability 3.5 and so it does not meet that requirement.


References