xpra icon
Bug tracker and wiki

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#1472 closed defect (fixed)

No /usr/share/xpra/cuda in Ubuntu Packages

Reported by: B Owned by: B
Priority: major Milestone:
Component: encodings Version: trunk
Keywords: nvenc, fatbin, bgra, Cc:

Description

Hi,

great work in xpra!! In the Ubuntu packages im missing the whole /usr/share/xpra/cuda dir.

Error:

2017-03-24 15:04:42,409 Error: failed to load module from buffer for 'BGRA_to_NV12'
2017-03-24 15:04:42,593  cannot load nvenc7 (nvenc encoder): Encoder missing from xpra.codecs.nvenc7.encoder
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/codecs/loader.py", line 67, in codec_import_check
    init_module()
  File "xpra/codecs/nvenc7/encoder.pyx", line 2622, in xpra.codecs.nvenc7.encoder.init_module (xpra/codecs/nvenc7/encoder.c:33572)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1481, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11579)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1469, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11325)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1572, in xpra.codecs.nvenc7.encoder.Encoder.init_cuda_kernel (xpra/codecs/nvenc7/encoder.c:13914)
AssertionError: failed to load BGRA_to_NV12 for device 0

Greets from Germany

Change History (11)

comment:1 Changed 4 weeks ago by B

Additional Info:
the original Error was:

2017-03-24 15:37:39,891 created unix domain socket: /root/.xpra/nvenc-100
2017-03-24 15:37:39,892 created unix domain socket: /var/run/xpra/nvenc-100
2017-03-24 15:37:40,237 CUDA initialization (this may take a few seconds)
2017-03-24 15:37:40,573 CUDA 8.0.0 / PyCUDA 2016.1.2, found 1 device:
2017-03-24 15:37:40,574   + GeForce GTX 980 Ti @ 0000:89:00.0 (memory: 97% free, compute: 5.2)
2017-03-24 15:37:40,745 NVidia driver version 375.39
2017-03-24 15:37:42,283 Error: failed to load CUDA bin file '/usr/share/xpra/cuda/BGRA_to_NV12.fatbin'
2017-03-24 15:37:42,440  cannot load nvenc7 (nvenc encoder): Encoder missing from xpra.codecs.nvenc7.encoder
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/codecs/loader.py", line 67, in codec_import_check
    init_module()
  File "xpra/codecs/nvenc7/encoder.pyx", line 2622, in xpra.codecs.nvenc7.encoder.init_module (xpra/codecs/nvenc7/encoder.c:33572)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1481, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11579)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1469, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11325)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1572, in xpra.codecs.nvenc7.encoder.Encoder.init_cuda_kernel (xpra/codecs/nvenc7/encoder.c:13914)
AssertionError: failed to load BGRA_to_NV12 for device 0

i tried using the fatbin from the debian packages, but that gives the Error in my initial ticket poste

greets

comment:2 Changed 4 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to B

I believe that this was a CUDA detection bug in the builtbot scripts which has now been fixed.
Please try one of the beta builds which should now include the CUDA kernels. There are beta builds there from the 1.0.x, 2.0.x and 2.1 development branch for all supported Ubuntu distros versions.

(please always specify which specific distro and version you are on to speed things up)

comment:3 Changed 4 weeks ago by B

Hi,

*.fatbins now there in beta builds for xenial. But still an error with loading the bgra_to_nv12

im starting xpra for testing purposes with:
xpra start :100 --no-daemon

.....
2017-03-25 10:29:05,538 CUDA initialization (this may take a few seconds)
2017-03-25 10:29:05,863 CUDA 8.0.0 / PyCUDA 2016.1.2, found 1 device:
2017-03-25 10:29:05,863   + GeForce GTX 980 Ti @ 0000:89:00.0 (memory: 97% free, compute: 5.2)
2017-03-25 10:29:06,016 NVidia driver version 375.39
2017-03-25 10:29:07,658 Error: failed to load module from buffer for 'BGRA_to_NV12'
2017-03-25 10:29:07,838  cannot load nvenc7 (nvenc encoder): Encoder missing from xpra.codecs.nvenc7.encoder
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/codecs/loader.py", line 67, in codec_import_check
    init_module()
  File "xpra/codecs/nvenc7/encoder.pyx", line 2622, in xpra.codecs.nvenc7.encoder.init_module (xpra/codecs/nvenc7/encoder.c:33572)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1481, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11579)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1469, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11325)
  File "xpra/codecs/nvenc7/encoder.pyx", line 1572, in xpra.codecs.nvenc7.encoder.Encoder.init_cuda_kernel (xpra/codecs/nvenc7/encoder.c:13914)
AssertionError: failed to load BGRA_to_NV12 for device 0
2017-03-25 10:29:07,982 Warning: failed to load the mdns avahi publisher:
2017-03-25 10:29:07,982  No module named avahi
2017-03-25 10:29:07,983  either fix your installation or use the 'mdns=no' option
2017-03-25 10:29:07,993 Warning: no X11 RandR support on :100
2017-03-25 10:29:08,235 Warning: webcam forwarding is disabled
2017-03-25 10:29:08,235  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2017-03-25 10:29:08,235  make sure that the 'v4l2loopback' kernel module is installed and loaded
2017-03-25 10:29:08,235 found 0 virtual video devices for webcam forwarding
2017-03-25 10:29:08,251 pulseaudio not started: 'pulseaudio' command not found

Warning: running as root
2017-03-25 10:29:08,474 GStreamer version 1.8.3 for Python 2.7.12 64-bit
2017-03-25 10:29:08,481 D-Bus notification forwarding is available
2017-03-25 10:29:08,494 xpra X11 version 2.0.1-r15391 64-bit
2017-03-25 10:29:08,495  uid=0 (root), gid=0 (root)
2017-03-25 10:29:08,495  running with pid 11903 on Linux Ubuntu 16.04 xenial
2017-03-25 10:29:08,496  connected to X11 display :100 with 24 bit colors
2017-03-25 10:29:08,568 xpra is ready.

im running xpra in a container with mapping nvidia devices into it. OpenGL accl, ... and all works find, but now im stucking with the nvenc...

today i will test some containers with debian and centos....i will report the tests...

greets

comment:4 Changed 4 weeks ago by Antoine Martin

That's unfortunate: the Error: failed to load module from buffer for 'BGRA_to_NV12' doesn't print the actual cause of the error, r15401 fixes that.
Run xpra with "-d cuda,nvenc" for full debug output.

I have just made a new beta Ubuntu 16.04 build with this change applied. Maybe it will help you figure it out?
Have you tried running nvenc outside the container?

comment:5 Changed 4 weeks ago by B

Hi,

thanks for the attention.
on the docker host i have no pycuda,xpra and dependencies installed. Maybe i can test it on my host with a 750 Ti. I will inform you on that tests.

here is the debug output with the new beta...

greets

Using display number provided by Xvfb: :0
2017-03-25 12:49:05,535 created unix domain socket: /root/.xpra/nvenc-0^[[0m
2017-03-25 12:49:06,537 created unix domain socket: /var/run/xpra/nvenc-0^[[0m
2017-03-25 12:49:06,900 CUDA initialization (this may take a few seconds)^[[0m
^[[36m2017-03-25 12:49:06,930 CUDA driver version=8000^[[0m
^[[36m2017-03-25 12:49:06,930 get_prefs() will try to load cuda.conf from: ['/etc/xpra', '~/.xpra']^[[0m
^[[36m2017-03-25 12:49:06,930 get_prefs() '/etc/xpra/cuda.conf' does not exist!^[[0m
^[[36m2017-03-25 12:49:06,931 get_prefs() '/root/.xpra/cuda.conf' does not exist!^[[0m
^[[36m2017-03-25 12:49:06,931  + testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0^[[0m
^[[36m2017-03-25 12:49:07,228    created context=<pycuda._driver.Context object at 0x7fd7f321a230>^[[0m
^[[36m2017-03-25 12:49:07,228    api version=3020^[[0m
^[[36m2017-03-25 12:49:07,229    memory: free=5904MB, total=6078MB^[[0m
^[[36m2017-03-25 12:49:07,229    multi-processors: 22, clock rate: 1076000^[[0m
^[[36m2017-03-25 12:49:07,229    max block sizes: (1024, 1024, 64)^[[0m
^[[36m2017-03-25 12:49:07,229    max grid sizes: (2147483647, 65535, 65535)^[[0m
^[[36m2017-03-25 12:49:07,229    maximum texture size: 65536x65536^[[0m
^[[36m2017-03-25 12:49:07,229    max pitch: 2147483647^[[0m
^[[36m2017-03-25 12:49:07,229    compute capability: 0x52 (5.2)^[[0m
2017-03-25 12:49:07,229 CUDA 8.0.0 / PyCUDA 2016.1.2, found 1 device:^[[0m
2017-03-25 12:49:07,229   + GeForce GTX 980 Ti @ 0000:89:00.0 (memory: 97% free, compute: 5.2)^[[0m
2017-03-25 12:49:07,387 NVidia driver version 375.39^[[0m
^[[36m2017-03-25 12:49:07,387 will test 0 devices from failing list: []^[[0m
^[[36m2017-03-25 12:49:07,388 will test 1 device from OK list: [0]^[[0m
^[[36m2017-03-25 12:49:07,388 select_device: testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0^[[0m
^[[36m2017-03-25 12:49:07,649 created context=<pycuda._driver.Context object at 0x7fd7f321a230>^[[0m
^[[36m2017-03-25 12:49:07,650 memory: free=5904MB, total=6078MB^[[0m
^[[36m2017-03-25 12:49:07,650 device matches preferred device id 0: GeForce GTX 980 Ti @ 0000:89:00.0^[[0m
^[[36m2017-03-25 12:49:08,294 will test 0 devices from failing list: []^[[0m
^[[36m2017-03-25 12:49:08,295 will test 1 device from OK list: [0]^[[0m
^[[36m2017-03-25 12:49:08,295 select_device: testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0^[[0m
^[[36m2017-03-25 12:49:08,559 created context=<pycuda._driver.Context object at 0x7fd7f321a230>^[[0m
^[[36m2017-03-25 12:49:08,560 memory: free=5904MB, total=6078MB^[[0m
^[[36m2017-03-25 12:49:08,560 device matches preferred device id 0: GeForce GTX 980 Ti @ 0000:89:00.0^[[0m
^[[36m2017-03-25 12:49:09,010 get_CUDA_function(0, BGRA_to_NV12) cubin file=/usr/share/xpra/cuda/BGRA_to_NV12.fatbin^[[0m
^[[36m2017-03-25 12:49:09,011  loaded 31168 bytes^[[0m
^[[36m2017-03-25 12:49:09,012 module_from_buffer(P U ^A^@^P^@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^ @^R^C  ^A^H^K ^@^@^@ \^N
^G^@^H^@^ L
^Kg^A^@^@ \>^ @*^B _^@^H^H'^@^H^GpK^H
G^@^H^DpK
^W^Wmod = driver.module_from_buffer(data)N^ ^@^@^@ \^H
RuntimeError: cuModuleLoadDataEx failed: no kernel image is available for execution on the device - ^[[0m
^[[31m2017-03-25 12:49:09,013 Error: failed to load module from buffer for 'BGRA_to_NV12'^[[0m
^[[31m2017-03-25 12:49:09,013  cuModuleLoadDataEx failed: no kernel image is available for execution on the device - ^[[0m
^[[36m2017-03-25 12:49:09,192 cuda_context.reset_state()^[[0m^G^ \^N^@^ ^A^ ^G^ \ ^G^@ ^@ ^_^@^K^@ ^@^ ^G^ \^P^@ ^@^ ^G^ \^O^@^@^@^@^@   ^G  @ ^_^@^Y^SG^E^@^@^PL^H^Y^W^@^@^@^@^\
^[[33m2017-03-25 12:49:09,192  cannot load nvenc7 (nvenc encoder): Encoder missing from xpra.codecs.nvenc7.encoder
Traceback (most recent call last):  ^] ^W^E^@^H^PL^Z^Y^G^E^@^ ^PL^ ^A@ ^@
^@File "/usr/lib/python2.7/dist-packages/xpra/codecs/loader.py", line 67, in codec_import_check
^F7^init_module()^A^@^@ \
^KFile "xpra/codecs/nvenc7/encoder.pyx", line 2624, in xpra.codecs.nvenc7.encoder.init_module (xpra/codecs/nvenc7/encoder.c:33159)
^GFile "xpra/codecs/nvenc7/encoder.pyx", line 1482, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11490)
^KFile "xpra/codecs/nvenc7/encoder.pyx", line 1470, in xpra.codecs.nvenc7.encoder.Encoder.init_context (xpra/codecs/nvenc7/encoder.c:11236)
G^File "xpra/codecs/nvenc7/encoder.pyx", line 1573, in xpra.codecs.nvenc7.encoder.Encoder.init_cuda_kernel (xpra/codecs/nvenc7/encoder.c:13772)
AssertionError: failed to load BGRA_to_NV12 for device 0^[[0m@^H^PL^W^H^G^@^@   ^O^@^A^@^@^@   ^G  @ ^_^@^H^YW^@^@^@^@^\
^[[33m2017-03-25 12:49:09,329 Warning: failed to load the mdns avahi publisher:^[[0m
^[[33m2017-03-25 12:49:09,329  No module named avahi^[[0m
^[[33m2017-03-25 12:49:09,330  either fix your installation or use the 'mdns=no' option^[[0m
.......

comment:6 Changed 4 weeks ago by Antoine Martin

Now we have a useful message:

cuModuleLoadDataEx failed: no kernel image is available for execution on the device

I believe this means that CUDA couldn't find a kernel build to match your graphics card and / or driver version. But since I also see in your log sample:

CUDA 8.0.0 / PyCUDA 2016.1.2, found 1 device:
  + GeForce GTX 980 Ti @ 0000:89:00.0 (memory: 97% free, compute: 5.2)
NVidia driver version 375.39

This is all up to date, so I don't really know what's wrong.
The builtbot shows:

'/usr/local/cuda/bin/nvcc' '-fatbin' \
    '-c' 'xpra/codecs/cuda_common/BGRA_to_NV12.cu' \
    '-o' 'xpra/codecs/cuda_common/BGRA_to_NV12.fatbin' \
    '-gencode=arch=compute_30,code=sm_30' \
    '-gencode=arch=compute_35,code=sm_35' \
    '-gencode=arch=compute_53,code=sm_53' \
    '-gencode=arch=compute_60,code=sm_60' \
    '-gencode=arch=compute_61,code=sm_61' \
    '-gencode=arch=compute_62,code=sm_62'
CUDA compiling BGRA_to_YUV444   (no file)
'/usr/local/cuda/bin/nvcc' '-fatbin' \
    '-c' 'xpra/codecs/cuda_common/BGRA_to_YUV444.cu' \
    '-o' 'xpra/codecs/cuda_common/BGRA_to_YUV444.fatbin' \
    '-gencode=arch=compute_30,code=sm_30' \
    '-gencode=arch=compute_35,code=sm_35' \
    '-gencode=arch=compute_53,code=sm_53' \
    '-gencode=arch=compute_60,code=sm_60' \
    '-gencode=arch=compute_61,code=sm_61' \
    '-gencode=arch=compute_62,code=sm_62'

As per CUDA : Virtual Architecture Feature List, maybe your 980 Ti needs a different arch option? (I have tested these kernel builds with various cards before: 1070, 970, 760 and 750 Ti...
r15406 adds "compute_50" and "compute_52" - maybe that will help?
New beta 2.1 packages for Ubuntu 16.04 here: http://xpra.org/beta/.

comment:7 Changed 4 weeks ago by B

Hi Antoine,

great work.
nvidia-smi (Type: C means compute process):

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    7      2627    C   /usr/bin/python                                110MiB |
|    7      2711    G   glxgears                                         3MiB |
|    7     31606    G   /usr/lib/xorg/Xorg                             111MiB |
+-----------------------------------------------------------------------------+

log:

Using display number provided by Xvfb: :0
2017-03-25 18:46:46,564 created unix domain socket: /root/.xpra/nvenc-0
2017-03-25 18:46:47,566 created unix domain socket: /var/run/xpra/nvenc-0
2017-03-25 18:46:48,059 get_nvenc_license_keys(7) '/etc/xpra/nvenc7.keys' does not exist
2017-03-25 18:46:48,059 get_nvenc_license_keys(7) '/root/.xpra/nvenc7.keys' does not exist
2017-03-25 18:46:48,059 get_nvenc_license_keys(7)=[]
2017-03-25 18:46:48,059 get_nvenc_license_keys(0) '/etc/xpra/nvenc.keys' does not exist
2017-03-25 18:46:48,059 get_nvenc_license_keys(0) '/root/.xpra/nvenc.keys' does not exist
2017-03-25 18:46:48,059 get_nvenc_license_keys(0)=[]
2017-03-25 18:46:48,060 nvenc.init_module()
2017-03-25 18:46:48,060 NVENC encoder API version 7.0
2017-03-25 18:46:48,060 init_nvencode_library() will try to load libcuda.so
2017-03-25 18:46:48,060 init_nvencode_library() <bound method LibraryLoader.LoadLibrary of <ctypes.LibraryLoader object at 0x7f0cfa3f04d0>>(libcuda.so)=<CDLL 'libcuda.so', handle 1758060 at 7f0cf832a910>
2017-03-25 18:46:48,060 init_nvencode_library() libcuda.cuCtxGetCurrent=<_FuncPtr object at 0x7f0cebb37530>
2017-03-25 18:46:48,060 init_nvencode_library() will try to load libnvidia-encode.so
2017-03-25 18:46:48,061 init_nvencode_library() <bound method LibraryLoader.LoadLibrary of <ctypes.LibraryLoader object at 0x7f0cfa3f04d0>>(libnvidia-encode.so)=<CDLL 'libnvidia-encode.so', handle 1411b80 at 7f0cf832a950>^[[$
2017-03-25 18:46:48,061 init_nvencode_library() NvEncodeAPICreateInstance=<_FuncPtr object at 0x7f0cebb376d0>
2017-03-25 18:46:48,061 CUDA initialization (this may take a few seconds)
2017-03-25 18:46:48,089 CUDA driver version=8000
2017-03-25 18:46:48,089 get_prefs() will try to load cuda.conf from: ['/etc/xpra', '~/.xpra']
2017-03-25 18:46:48,089 get_prefs() '/etc/xpra/cuda.conf' does not exist!
2017-03-25 18:46:48,089 get_prefs() '/root/.xpra/cuda.conf' does not exist!
2017-03-25 18:46:48,089  + testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:48,412    created context=<pycuda._driver.Context object at 0x7f0cee32d230>
2017-03-25 18:46:48,412    api version=3020
2017-03-25 18:46:48,413    memory: free=5904MB, total=6078MB
2017-03-25 18:46:48,413    multi-processors: 22, clock rate: 1076000
2017-03-25 18:46:48,413    max block sizes: (1024, 1024, 64)
2017-03-25 18:46:48,413    max grid sizes: (2147483647, 65535, 65535)
2017-03-25 18:46:48,413    maximum texture size: 65536x65536
2017-03-25 18:46:48,413    max pitch: 2147483647
2017-03-25 18:46:48,413    compute capability: 0x52 (5.2)
2017-03-25 18:46:48,413 CUDA 8.0.0 / PyCUDA 2016.1.2, found 1 device:
2017-03-25 18:46:48,414   + GeForce GTX 980 Ti @ 0000:89:00.0 (memory: 97% free, compute: 5.2)
2017-03-25 18:46:48,571 cannot use nvml to query the kernel module version:
2017-03-25 18:46:48,572  No module named pynvml
2017-03-25 18:46:48,572 NVidia driver version 375.39
2017-03-25 18:46:48,572 testing encoder with device 0
2017-03-25 18:46:48,572 will test 0 devices from failing list: []
2017-03-25 18:46:48,572 will test 1 device from OK list: [0]
2017-03-25 18:46:48,572 select_device: testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:48,831 created context=<pycuda._driver.Context object at 0x7f0cee32d230>
2017-03-25 18:46:48,832 memory: free=5904MB, total=6078MB
2017-03-25 18:46:48,832 device matches preferred device id 0: GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:49,013 selected device GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:49,013 init_cuda() pixel format=None, device_id=0
2017-03-25 18:46:49,013 init_cuda cuda_device=<pycuda._driver.Device object at 0x7f0ceb946890> (GeForce GTX 980 Ti @ 0000:89:00.0)
2017-03-25 18:46:49,285 init_cuda cuda_context=<pycuda._driver.Context object at 0x7f0cee32d230>
2017-03-25 18:46:49,285 init_cuda cuda info={'driver': {'driver_version': 8000, 'version': (8, 0, 0)}}
2017-03-25 18:46:49,285 init_cuda pycuda info={'version': {'': (2016, 1, 2), 'text': '2016.1.2'}}
2017-03-25 18:46:49,286 test encoder=nvenc(None/None/None - None -    0x0   )
2017-03-25 18:46:49,286 open_encode_session() cuda_context=<pycuda._driver.Context object at 0x7f0cee32d230>, cuda_context_ptr=0x17c7e90
2017-03-25 18:46:49,286 open_encode_session() functionList=0x1c79070
2017-03-25 18:46:49,296 encoding context=29860016
2017-03-25 18:46:49,296 success, encoder context=0x1c7a0b0 (1 context in use)
2017-03-25 18:46:49,296 init_encoder() nvenc(None/None/None - None -    0x0   )
2017-03-25 18:46:49,297 found 2 encoders:
2017-03-25 18:46:49,297 [0] H264
2017-03-25 18:46:49,297 [1] HEVC
2017-03-25 18:46:49,297 codecs=H264, HEVC
2017-03-25 18:46:49,297 device 0 supports: {'H264': {'max-size': (4096, 4096), 'async': 0, 'guid': '6BC82762-4E63-4CA4-AA85-1E50F321F6BF', 'name': 'H264', 'rate-control': 63}, 'HEVC': {'max-size': (4096, 4096), 'async': 0, '$
2017-03-25 18:46:49,298 clean() cuda_context=<pycuda._driver.Context object at 0x7f0cee32d230>, encoder context=0x1c7a0b0
2017-03-25 18:46:49,298 cuda_clean() destroying encoder 0x1c7a0b0
2017-03-25 18:46:49,303 cuda_clean() (still 0 context in use)
2017-03-25 18:46:49,483 clean() cuda_context=None, encoder context=0x0
2017-03-25 18:46:49,483 max-size(h264)=(4096, 4096)
2017-03-25 18:46:49,483 max-size(h265)=(4096, 4096)
2017-03-25 18:46:49,483 will test: ['h264', 'h265']
2017-03-25 18:46:49,483 init_context(1920, 1080, 'BGRX', ['YUV420P', 'YUV444P'], 'h264', 50, 50, (1, 1), {'cuda_device': 0})
2017-03-25 18:46:49,483 will test 0 devices from failing list: []
2017-03-25 18:46:49,483 will test 1 device from OK list: [0]
2017-03-25 18:46:49,484 select_device: testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:49,483 will test 1 device from OK list: [0]
2017-03-25 18:46:49,484 select_device: testing device 0: GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:49,747 created context=<pycuda._driver.Context object at 0x7f0cee32d230>
2017-03-25 18:46:49,748 memory: free=5904MB, total=6078MB
2017-03-25 18:46:49,749 device matches preferred device id 0: GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:49,924 selected device GeForce GTX 980 Ti @ 0000:89:00.0
2017-03-25 18:46:49,924 using lossy h264 compression at 50% quality with pixel format NV12
2017-03-25 18:46:49,924 init_cuda() pixel format=NV12, device_id=0
2017-03-25 18:46:49,924 init_cuda cuda_device=<pycuda._driver.Device object at 0x7f0ceb946c00> (GeForce GTX 980 Ti @ 0000:89:00.0)
2017-03-25 18:46:50,187 init_cuda cuda_context=<pycuda._driver.Context object at 0x7f0cee32d230>
2017-03-25 18:46:50,188 init_cuda cuda info={'driver': {'driver_version': 8000, 'version': (8, 0, 0)}}
2017-03-25 18:46:50,188 init_cuda pycuda info={'version': {'': (2016, 1, 2), 'text': '2016.1.2'}}
2017-03-25 18:46:50,189 get_CUDA_function(0, BGRA_to_NV12) cubin file=/usr/share/xpra/cuda/BGRA_to_NV12.fatbin
2017-03-25 18:46:50,190  loaded 42192 bytes
2017-03-25 18:46:50,190 get_CUDA_function(0, BGRA_to_NV12) module=<pycuda._driver.Module object at 0x7f0ceba39830>
2017-03-25 18:46:50,191 loading function BGRA_to_NV12 from pre-compiled cubin took 1.0ms
2017-03-25 18:46:50,192 CUDA Input Buffer=0x8109840000, pitch=10240
2017-03-25 18:46:50,192 CUDA Output Buffer=0x810a2e0000, pitch=2048
2017-03-25 18:46:50,201 inputBuffer=[0 0 0 ..., 0 0 0] (size=11141120)
2017-03-25 18:46:50,202 max_block_sizes=(1024, 1024, 64)
2017-03-25 18:46:50,202 max_grid_sizes=(2147483647, 65535, 65535)
2017-03-25 18:46:50,202 max_threads_per_block=1024
2017-03-25 18:46:50,203 open_encode_session() cuda_context=<pycuda._driver.Context object at 0x7f0cee32d230>, cuda_context_ptr=0x17c7e90
2017-03-25 18:46:50,203 open_encode_session() functionList=0x1c8d980
2017-03-25 18:46:50,213 encoding context=29944256
2017-03-25 18:46:50,213 success, encoder context=0x1c8e9c0 (1 context in use)
2017-03-25 18:46:50,214 found 2 encoders:
2017-03-25 18:46:50,214 [0] H264
2017-03-25 18:46:50,214 [1] HEVC
2017-03-25 18:46:50,214 codecs=H264, HEVC
2017-03-25 18:46:50,214 found 10 presets:
2017-03-25 18:46:50,215 * default              P frame interval=1, gop length=30        
2017-03-25 18:46:50,215 * low-latency          P frame interval=1, gop length=infinite  
2017-03-25 18:46:50,215 * hp                   P frame interval=1, gop length=30        
2017-03-25 18:46:50,215 * hq                   P frame interval=1, gop length=30        
2017-03-25 18:46:50,215 * bd                   P frame interval=3, gop length=30        
2017-03-25 18:46:50,216 * low-latency-hq       P frame interval=1, gop length=infinite  
2017-03-25 18:46:50,216 * low-latency-hp       P frame interval=1, gop length=infinite  
2017-03-25 18:46:50,216 * streaming            P frame interval=1, gop length=30        
2017-03-25 18:46:50,216 * lossless             P frame interval=1, gop length=30        
2017-03-25 18:46:50,216 * lossless-hp          P frame interval=1, gop length=30        
2017-03-25 18:46:50,216 presets for 6BC82762-4E63-4CA4-AA85-1E50F321F6BF: low-latency, bd, default, hp, hq, streaming, lossless-hp, low-latency-hp, low-latency-hq, lossless (pixel format=NV12)
2017-03-25 18:46:50,217 preset low-latency: speed=80, quality=20 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset bd: speed=40, quality=80 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset default: speed=50, quality=50 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset hp: speed=60, quality=40 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset hq: speed=50, quality=70 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset streaming: speed=-1000, quality=-1000 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset lossless-hp: speed=30, quality=100 (lossless=True - want lossless=0)
2017-03-25 18:46:50,217 preset low-latency-hp: speed=100, quality=0 (lossless=False - want lossless=0)
2017-03-25 18:46:50,217 preset low-latency-hq: speed=70, quality=30 (lossless=False - want lossless=0)
2017-03-25 18:46:50,218 preset lossless: speed=0, quality=100 (lossless=True - want lossless=0)
2017-03-25 18:46:50,218 get_preset(H264) speed=50, quality=50, lossless=False, pixel_format=NV12, options={0: [('default', 'B2DFB705-4EBD-4C49-9B5F-24A777D3E587')], 100: [('low-latency-hq', 'C5F733B9-EA97-4CF9-BEC2-BF78A74FD$
2017-03-25 18:46:50,218 using preset 'default' for quality=50, speed=50, lossless=0, pixel_format=NV12
2017-03-25 18:46:50,218 init_params(H264) using preset=default
2017-03-25 18:46:50,218 9 input format types:
2017-03-25 18:46:50,218 * 0x1
2017-03-25 18:46:50,218  + 0x1 : NV12_PL
2017-03-25 18:46:50,219 * 0x10
2017-03-25 18:46:50,219  + 0x10 : YV12_PL
2017-03-25 18:46:50,219 * 0x100
2017-03-25 18:46:50,219  + 0x100 : IYUV_PL
2017-03-25 18:46:50,219 * 0x1000
2017-03-25 18:46:50,219  + 0x1000 : YUV444_PL
2017-03-25 18:46:50,219 * 0x1000000
2017-03-25 18:46:50,219  + 0x1000000 : ARGB
2017-03-25 18:46:50,220 * 0x10000000
2017-03-25 18:46:50,220  + 0x10000000 : ABGR
2017-03-25 18:46:50,220 * 0x4000000
2017-03-25 18:46:50,220  + 0x4000000 : AYUV
2017-03-25 18:46:50,220 * 0x2000000
2017-03-25 18:46:50,220  + 0x2000000 : ARGB10
.....

do you know what that means:

2017-03-25 18:46:51,493 Warning: hardware or nvenc library version does not support YUV444

Greets

Last edited 4 weeks ago by Antoine Martin (previous) (diff)

comment:8 Changed 4 weeks ago by Antoine Martin

So, it should be working, right?
You can verify which encoder is actually being used for each window using:

xpra info | egrep "nvenc|\.encoder=" | grep -v pipeline

Warning: hardware or nvenc library version does not support YUV444 means that the API is claiming not to support the YUV444 mode.
Not really a problem.

comment:9 Changed 4 weeks ago by B

xpra info gives me:

env.HOSTNAME=nvenc
network.sockets.unix-domain.listeners=('/root/.xpra/nvenc-11', '/var/run/xpra/nvenc-11')
server.build.lib.nvenc7=7.0
server.hostname=nvenc
video.encoding.BGRX_to_h264=('x264', 'nvenc')
video.encoding.BGRX_to_h265=('nvenc',)
video.encoding.video-encoder.nvenc=active
window.1.client-machine=nvenc
window.1.encoder=nvenc

looks good for my opinion. again: great work, thanks...

greets

comment:10 Changed 4 weeks ago by B

Resolution: fixed
Status: newclosed

works, antoine fixed build scripts and compiling options for nvidia kernel bin

greets

comment:11 Changed 4 weeks ago by Antoine Martin

r15408 applied the same change to the v1.0.x and v2.0.x branches and will be included in the next stable update.

Note: See TracTickets for help on using tickets.