NVEnc
NVEnc copied to clipboard
WSL環境でtsreplaceからNVEncを実行した際にエラーログが出力される
いつもNVEncを利用させていただいております。 素晴らしいソフトウェアをありがとうございます。
さて、WindowsのWSL上で、tsreplaceからNVEncを実行すると、ある時から以下のようなログが(大量に)表示されるようになりました。
cat: /proc/5928/io: No such file or directory
詳細なログは以下のとおりです。
tsreplaceのログ
$ tsreplace -i input.ts -o output.ts -e nvencc -i - --input-format mpegts --output-format mpegts -o -
tsreplace (x64) 0.21 (r204) by rigaya, Oct 5 2026 09:37:02 (gcc 9.4.0/Linux)
replace: Output file: "output.ts".
replace: Input file: "input.ts".
replace: Encoder : "nvencc"
replace: Encoder Args: -i - --input-format mpegts --output-format mpegts -o -
replace: Start point : keyframe.
replace: Replace delay : 0 (90kHz ticks).
replace: End at Replace EOF : off (margin 100 ms).
replace: Add AUD : on.
replace: Add Headers : on.
replace: Remove TypeD: off.
replace: Preserve Other Services: off.
replace: Copy File Timestamp: off.
replace: Preroll: 0 ms.
demux: program_number(service_id) 0, pmt_pid 0x0010 (16)
demux: program_number(service_id) 23664, pmt_pid 0x0100 (256)
demux: New PMT
demux: version 32
demux: program 0x5c70 (23664)
demux: pid pmt 0x0100 (256)
demux: pid vid 0x0200 (512)
demux: pid aud0 0x0201 (513)
demux: pid aud1 0x0000 (0)
demux: pid cap 0x0000 (0)
demux: pid pcr 0x0200 (512)
replace: Target service ID 23664, replace vid pid: 0x0200 (512).
replace: pcr pid 0x0200 (512) -> 0x02ff (767).
replace: Opened video stream #0 (ID 512 (0x200)), mpeg2video, 1440x1080 (yuv420p), stream time_base 1/90000.
replace: First packet PTS: 9886653 [ +0.0 ms] [ -371.6 ms]
replace: First frame PTS: 9920100 [ +371.6 ms] [ +0.0 ms]
replace: * First key PTS: 9920100 [ +371.6 ms] [ +0.0 ms]
replace: Replace origin PTS: 9920100 (start-point)
replace: Run encoder: nvencc --version
replace: encoder type: 1
replace: Run encoder: nvencc -i - --input-format mpegts --output-format mpegts -o - --video-streamid 512
--------------------------------------------------------------------------------
-
--------------------------------------------------------------------------------
NVEnc (x64) 9.37 (r4165) by rigaya, Oct 3 2026 11:37:28 (gcc 9.4.0/Linux)
OS Version Ubuntu 26.04.1 LTS (6.18.40.1-microsoft-standard-WSL2)
CPU Intel Core i7-14700K (14C/28T)
GPU #0: NVIDIA GeForce RTX 4070 Ti (7680 cores, 2625 MHz)[PCIe4x16][617.14]
NVENC / CUDA NVENC API 13.1, CUDA 13.4, schedule mode: auto
Input Buffers CUDA, 20 frames
Input Info avcuvid: MPEG2, 1440x1080, 30000/1001 fps
Vpp Filters copyDtoD
Output Info H.264/AVC high @ Level auto
1440x1080p 4:3 29.970fps (30000/1001fps)
avwriter: h264 => mpegts
Encoder Preset default
Rate Control VBR
Multipass none
Bitrate 0 kbps (Max: 24000 kbps)
Target Quality 25.00
QP range I:0-51 P:0-51 B:0-51
QP Offset cb:0 cr:0
VBV buf size auto
Split Enc Mode auto
Tuning Info hq
Lookahead off
GOP length 300 frames
B frames 3 frames [ref mode: middle]
Ref frames 4 frames, MultiRef L0:auto L1:auto
AQ off
Others mv:auto cabac deblock adapt-transform:enabled bdirect:auto
cat: /proc/5928/io: No such file or directory
replace: Opened video stream #0 (ID 256 (0x100)), h264, 1440x1080 (yuv420p), stream time_base 1/90000.
cat: /proc/5928/io: No such file or directoryVE 0%
cat: /proc/5928/io: No such file or directory 47%, VD 58%
cat: /proc/5928/io: No such file or directoryE 47%, VD 64%
encoded 1813 frames, 552.07 fps, 7296.27 kbps, 52.62 MB
encode time 0:00:03, CPU: 1.0%, GPU: 7.7%, VE: 31.3%, VD: 40.7%, GPUClock: 1960MHz, VEClock: 1865MHz
frame type IDR 7
frame type I 7, avgQP 21.57, total size 1.52 MB
frame type P 453, avgQP 23.99, total size 30.05 MB
frame type B 1353, avgQP 27.06, total size 21.05 MB
cat: /proc/5928/io: No such file or directory
このtsreplace実行中の、/proc/5928/ 配下の様子です。
/proc/5928/io は、確かに存在せず、これが直接的な原因かと思います。
この時の/proc/5928/
$ ls -l /proc/5928
total 0
-r--r--r-- 1 user user 0 Oct 6 21:32 arch_status
dr-xr-xr-x 2 user user 0 Oct 6 21:32 attr
-r-------- 1 user user 0 Oct 6 21:32 auxv
-r--r--r-- 1 user user 0 Oct 6 21:32 cgroup
--w------- 1 user user 0 Oct 6 21:32 clear_refs
-r--r--r-- 1 user user 0 Oct 6 21:32 cmdline
-rw-r--r-- 1 user user 0 Oct 6 21:32 comm
-rw-r--r-- 1 user user 0 Oct 6 21:32 coredump_filter
-r--r--r-- 1 user user 0 Oct 6 21:32 cpuset
lrwxrwxrwx 1 user user 0 Oct 6 21:32 cwd -> /home/user/tmp
-r-------- 1 user user 0 Oct 6 21:32 environ
lrwxrwxrwx 1 user user 0 Oct 6 21:32 exe -> /usr/bin/nvencc
dr-x------ 2 user user 29 Oct 6 21:32 fd
dr-xr-xr-x 2 user user 0 Oct 6 21:32 fdinfo
-rw-r--r-- 1 user user 0 Oct 6 21:32 gid_map
-r-------- 1 user user 0 Oct 6 21:32 ksm_merging_pages
-r-------- 1 user user 0 Oct 6 21:32 ksm_stat
-r--r--r-- 1 user user 0 Oct 6 21:32 limits
-rw-r--r-- 1 user user 0 Oct 6 21:32 loginuid
dr-x------ 2 user user 0 Oct 6 21:32 map_files
-r--r--r-- 1 user user 0 Oct 6 21:32 maps
-rw------- 1 user user 0 Oct 6 21:32 mem
-r--r--r-- 1 user user 0 Oct 6 21:32 mountinfo
-r--r--r-- 1 user user 0 Oct 6 21:32 mounts
-r-------- 1 user user 0 Oct 6 21:32 mountstats
dr-xr-xr-x 5 user user 0 Oct 6 21:32 net
dr-x--x--x 2 user user 0 Oct 6 21:32 ns
-r--r--r-- 1 user user 0 Oct 6 21:32 numa_maps
-rw-r--r-- 1 user user 0 Oct 6 21:32 oom_adj
-r--r--r-- 1 user user 0 Oct 6 21:32 oom_score
-rw-r--r-- 1 user user 0 Oct 6 21:32 oom_score_adj
-r-------- 1 user user 0 Oct 6 21:32 pagemap
-r-------- 1 user user 0 Oct 6 21:32 patch_state
-r-------- 1 user user 0 Oct 6 21:32 personality
-rw-r--r-- 1 user user 0 Oct 6 21:32 projid_map
lrwxrwxrwx 1 user user 0 Oct 6 21:32 root -> /
-rw-r--r-- 1 user user 0 Oct 6 21:32 sched
-r--r--r-- 1 user user 0 Oct 6 21:32 schedstat
-r--r--r-- 1 user user 0 Oct 6 21:32 sessionid
-rw-r--r-- 1 user user 0 Oct 6 21:32 setgroups
-r--r--r-- 1 user user 0 Oct 6 21:32 smaps
-r--r--r-- 1 user user 0 Oct 6 21:32 smaps_rollup
-r-------- 1 user user 0 Oct 6 21:32 stack
-r--r--r-- 1 user user 0 Oct 6 21:32 stat
-r--r--r-- 1 user user 0 Oct 6 21:32 statm
-r--r--r-- 1 user user 0 Oct 6 21:32 status
-r-------- 1 user user 0 Oct 6 21:32 syscall
dr-xr-xr-x 13 user user 0 Oct 6 21:32 task
-rw-r--r-- 1 user user 0 Oct 6 21:32 timens_offsets
-r--r--r-- 1 user user 0 Oct 6 21:32 timers
-rw-rw-rw- 1 user user 0 Oct 6 21:32 timerslack_ns
-rw-r--r-- 1 user user 0 Oct 6 21:32 uid_map
-r--r--r-- 1 user user 0 Oct 6 21:32 wchan
現状「ある時からこのエラーが表示されるようになった」程度の切り分けしかできていませんが、LLMと対話しながら調査したところ、以下の要因ではないかと思います。
/proc/[pid]/ioはKernel ConfigurationでCONFIG_TASK_IO_ACCOUNTINGが有効にされている必要がある。 WSL 3.0.1のカーネルは、その上位項目であるCONFIG_TASKSTATSが無効にされているため、/proc/[pid]/ioが存在しない。
現状、Windowsでwsl --updateを行うと、WSL 3.0.1がインストールされます。(9月末にリリースされました)
最新のWSL環境で利用している方はこの事象が発生するのではないかと思います。
/proc/[pid]/ioを何のために参照しておられるのかは把握できておりませんが、代替手段をご検討いただけないでしょうか。
よろしくお願いいたします。
実行環境
> wsl --version
WSL バージョン: 3.0.1.0
カーネル バージョン: 6.18.40.1-1
WSLg バージョン: 1.0.79
MSRDC バージョン: 1.2.7214
Direct3D バージョン: 1.611.1-81528511
DXCore バージョン: 10.0.26100.1-240331-1435.ge-release
Windows バージョン: 10.0.26300.9550
$ uname -r
6.18.40.1-microsoft-standard-WSL2
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 26.04.1 LTS
Release: 26.04
Codename: resolute
$ zcat /proc/config.gz | grep CONFIG_TASKSTATS
# CONFIG_TASKSTATS is not set
$ nvidia-smi
Tue Oct 6 21:38:36 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 615.78.02 KMD Version: 617.14 CUDA UMD Version: 13.4 |
+-----------------------------------------+------------------------+----------------------+
| 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 NVIDIA GeForce RTX 4070 Ti On | 00000000:01:00.0 On | N/A |
| 0% 44C P8 14W / 285W | 1602MiB / 12282MiB | 5% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
$ tsreplace --version
tsreplace (x64) 0.21 (r204) by rigaya, Oct 5 2026 09:37:02 (gcc 9.4.0/Linux)
$ nvencc --version
NVEnc (x64) 9.37 (r4165) by rigaya, Oct 3 2026 11:37:28 (gcc 9.4.0/Linux)
[NVENC API v13.1, CUDA 11.8]
reader: raw, y4m, avs, vpy, avsw, avhw [H.264/AVC, H.265/HEVC, MPEG2, VP8, VP9, VC-1, MPEG1, MPEG4, AV1]
others
nvml : yes
nvrtc : yes
nvvfx : no
ngx : no
nvof fruc : no
libass : yes
libdovi : yes
vulkan : yes
libplacebo : yes
vmaf : yes