Created attachment 195998 [details] chrome://gpu/ After update to version 67 hardware accelerated rendering is broken. Tested on latest graphics/drm-stable-kmod (intel haswell, kabylake) and x11/nvidia-driver (fermi) with 11-STABLE and 12-CURRENT. Log Messages [11317:351109120:0808/070059.064224:ERROR:gpu_info_collector_freebsd.cc(15)] : Not implemented reached in bool gpu::CollectBasicGraphicsInfo(gpu::GPUInfo *) [11317:351109120:0808/070059.101966:ERROR:gpu_info_collector_freebsd.cc(10)] : Not implemented reached in bool gpu::CollectContextGraphicsInfo(gpu::GPUInfo *) [11317:351109120:0808/070059.102083:ERROR:gpu_init.cc(49)] : gpu::CollectGraphicsInfo failed. GpuProcessHostUIShim: The GPU process exited with code 1024. [11358:351109120:0808/070059.640808:ERROR:gpu_info_collector_freebsd.cc(15)] : Not implemented reached in bool gpu::CollectBasicGraphicsInfo(gpu::GPUInfo *) [11358:351109120:0808/070059.705806:ERROR:gpu_info_collector_freebsd.cc(10)] : Not implemented reached in bool gpu::CollectContextGraphicsInfo(gpu::GPUInfo *) [11358:351109120:0808/070059.705828:ERROR:gpu_init.cc(49)] : gpu::CollectGraphicsInfo failed. GpuProcessHostUIShim: The GPU process exited with code 1024.
(In reply to Oleh Hushchenkov from comment #0) Yes, these log messages are intentional because they are not currently implemented. The GPU collection ones, there's no GPU access set up yet at all. At the moment, you can disable the hardware acceleration in chromium and use SwiftShader instead. Read for further details: https://blog.chromium.org/2016/06/universal-rendering-with-swiftshader.html
I tried to enable Swiftshader but it has no effect. Software rendering caused tearing issue when scrolling page or playing video. Is the main concern. Thank you for working on chromium in FreeBSD.
Created attachment 196196 [details] patch Attached patch implements GPU access set up for FreeBSD.
(In reply to Carlos J. Puga Medina from comment #3) With attached patch I have this (on Intel Kabylake and FreeBSD 12.0-ALPHA1): Graphics Feature Status Canvas: Hardware accelerated Flash: Hardware accelerated Flash Stage3D: Hardware accelerated Flash Stage3D Baseline profile: Hardware accelerated Compositing: Hardware accelerated Multiple Raster Threads: Enabled Native GpuMemoryBuffers: Software only. Hardware acceleration disabled Hardware Protected Video Decode: Unavailable Rasterization: Software only. Hardware acceleration disabled Skia Deferred Display List: Disabled Skia Renderer: Disabled Surface Synchronization: Enabled Video Decode: Unavailable Viz Service Display Compositor: Disabled WebGL: Hardware accelerated WebGL2: Hardware accelerated So it works) I will test patch on Nvidia Fermi today.
(In reply to Oleh Hushchenkov from comment #4) Can you provide the full report of chrome://gpu? Thanks
Created attachment 196210 [details] Intel Kabylake GPU report after patch
Playback of 1080p60 videos on YouTube is a lot smoother now. In chrome://flags I also set "GPU rasterization" to "Force-enabled for all layers" and get ~60 fps consistently. Before applying the patch it was regularly dipping below 30 fps once I did something else on the machine. https://people.freebsd.org/~tobik/logs/chromium_gpu_report.txt
Created attachment 196222 [details] Nvidia Fermi GPU report after patch On Nvidia Fermi and 12.0-ALPHA1 GPU acceleration still disabled. Both my test systems are amd64.
A commit references this bug: Author: cpm Date: Wed Aug 15 22:54:56 UTC 2018 New revision: 477294 URL: https://svnweb.freebsd.org/changeset/ports/477294 Log: www/chromium: Update to 68.0.3440.106 - Update amount of free disk space required to build chromium - Implement GPU access set up for FreeBSD [1] - Remove the incorrect sugestion in pkg-message and remove the fix-hanging-tabs.sh script because the bug of hanging tabs has been fixed in r337328 improving the chromium stability. Thanks to markj@ [2] PR: 230450 [1], 212812 [2] Reported by: Oleh Hushchenkov <gor@clogic.com.ua> MFH: 2018Q3 Changes: head/www/chromium/Makefile head/www/chromium/distinfo head/www/chromium/files/fix-hanging-tabs.sh head/www/chromium/files/patch-build_linux_unbundle_libwebp.gn head/www/chromium/files/patch-gpu_config_gpu__info__collector__freebsd.cc head/www/chromium/files/patch-services_network_public_cpp_cors_cors_legacy.cc head/www/chromium/files/patch-services_network_public_cpp_cors_cors_legacy.h head/www/chromium/files/patch-third_party_blink_renderer_platform_image-decoders_jpeg_jpeg_image_decoder.cc head/www/chromium/files/patch-third_party_blink_renderer_platform_image-encoders_image_encoder.cc head/www/chromium/files/patch-third_party_blink_renderer_platform_image-encoders_image_encoder.h head/www/chromium/files/patch-third_party_blink_renderer_platform_wtf_compiler.h head/www/chromium/files/pkg-message.in head/www/chromium/pkg-plist
A commit references this bug: Author: cpm Date: Thu Aug 16 06:57:26 UTC 2018 New revision: 477309 URL: https://svnweb.freebsd.org/changeset/ports/477309 Log: MFH: r477294 www/chromium: Update to 68.0.3440.106 - Update amount of free disk space required to build chromium - Implement GPU access set up for FreeBSD [1] - Remove the incorrect sugestion in pkg-message and remove the fix-hanging-tabs.sh script because the bug of hanging tabs has been fixed in r337328 improving the chromium stability. Thanks to markj@ [2] PR: 230450 [1], 212812 [2] Reported by: Oleh Hushchenkov <gor@clogic.com.ua> Approved by: ports-secteam (miwi) Changes: _U branches/2018Q3/ branches/2018Q3/www/chromium/Makefile branches/2018Q3/www/chromium/distinfo branches/2018Q3/www/chromium/files/fix-hanging-tabs.sh branches/2018Q3/www/chromium/files/patch-build_linux_unbundle_libwebp.gn branches/2018Q3/www/chromium/files/patch-gpu_config_gpu__info__collector__freebsd.cc branches/2018Q3/www/chromium/files/patch-services_network_public_cpp_cors_cors_legacy.cc branches/2018Q3/www/chromium/files/patch-services_network_public_cpp_cors_cors_legacy.h branches/2018Q3/www/chromium/files/patch-third_party_blink_renderer_platform_image-decoders_jpeg_jpeg_image_decoder.cc branches/2018Q3/www/chromium/files/patch-third_party_blink_renderer_platform_image-encoders_image_encoder.cc branches/2018Q3/www/chromium/files/patch-third_party_blink_renderer_platform_image-encoders_image_encoder.h branches/2018Q3/www/chromium/files/patch-third_party_blink_renderer_platform_wtf_compiler.h branches/2018Q3/www/chromium/files/pkg-message.in branches/2018Q3/www/chromium/pkg-plist
Fails with nvidia tesla (GTX 745) on 11-STABLE/amd64
(In reply to Jonathan Chen from comment #11) Not having an nvidia card makes it a bit harder to debug, but it seems that needs some work. Try to enable "Override software rendering list". It can be found in chrome://flags/
(In reply to Jonathan Chen from comment #11) Not having an nvidia card makes it a bit harder to debug, but it seems that needs some work. Try to enable "Override software rendering list". It can be found in chrome://flags
(In reply to Carlos J. Puga Medina from comment #13) Yeah, I've already got that set. Here's my chome://gpu Graphics Feature Status Canvas: Software only. Hardware acceleration disabled Flash: Software only. Hardware acceleration disabled Flash Stage3D: Software only. Hardware acceleration disabled Flash Stage3D Baseline profile: Software only. Hardware acceleration disabled Compositing: Software only. Hardware acceleration disabled Multiple Raster Threads: Disabled Native GpuMemoryBuffers: Software only. Hardware acceleration disabled Hardware Protected Video Decode: Disabled Rasterization: Software only. Hardware acceleration disabled Skia Deferred Display List: Disabled Skia Renderer: Disabled Surface Synchronization: Disabled Video Decode: Software only. Hardware acceleration disabled Viz Service Display Compositor: Disabled WebGL: Disabled WebGL2: Disabled Problems Detected GPU process was unable to boot: GPU process crashed too many times with SwiftShader. Disabled Features: all Native GpuMemoryBuffers have been disabled, either via about:flags or command line. Disabled Features: native_gpu_memory_buffers Viz service display compositor is not enabled by default. Disabled Features: viz_display_compositor Skia renderer is not used by default. Disabled Features: skia_renderer Skia deferred display list is not used by default. Disabled Features: skia_deferred_display_list Version Information Data exported 2018-08-16T22:06:54.183Z Chrome version Chrome/68.0.3440.106 Operating system FreeBSD 11.2-STABLE Software rendering list URL https://chromium.googlesource.com/chromium/src/+/1c32c539ce0065a41cb79da7bfcd2c71af1afe62/gpu/config/software_rendering_list.json Driver bug list URL https://chromium.googlesource.com/chromium/src/+/1c32c539ce0065a41cb79da7bfcd2c71af1afe62/gpu/config/gpu_driver_bug_list.json ANGLE commit id unknown hash 2D graphics backend Skia/68 1e419fead7ff3b5247102b29b982b6472a60cd4d- Command Line /usr/local/share/chromium/chrome --flag-switches-begin --use-simple-cache-backend=on --ignore-gpu-blacklist --flag-switches-end Driver Information Initialization time 0 In-process GPU true Passthrough Command Decoder false Direct Composition false Supports overlays false Sandboxed false GPU0 VENDOR = 0x0000, DEVICE= 0x0000 Optimus false AMD switchable false Driver vendor Driver version Driver date Pixel shader version Vertex shader version Max. MSAA samples Machine model name Machine model version GL_VENDOR GL_RENDERER GL_VERSION GL_EXTENSIONS Disabled Extensions Disabled WebGL Extensions Window system binding vendor Window system binding version Window system binding extensions Window manager Metacity (Marco) XDG_CURRENT_DESKTOP MATE Compositing manager Yes Direct rendering Yes Reset notification strategy 0x0000 GPU process crash count 3 System visual ID 0 RGBA visual ID 0 Compositor Information Tile Update Mode One-copy Partial Raster Enabled GpuMemoryBuffers Status ATC Software only ATCIA Software only DXT1 Software only DXT5 Software only ETC1 Software only R_8 Software only R_16 Software only RG_88 Software only BGR_565 Software only RGBA_4444 Software only RGBX_8888 Software only RGBA_8888 Software only BGRX_8888 Software only BGRX_1010102 Software only RGBX_1010102 Software only BGRA_8888 Software only RGBA_F16 Software only YVU_420 Software only YUV_420_BIPLANAR Software only UYVY_422 Software only Display(s) Information Info Display[25442309496752064] bounds=[0,0 1920x1080], workarea=[0,0 1920x1080], scale=1, external. Color space information {primaries:INVALID, transfer:INVALID, matrix:INVALID, range:INVALID} Bits per color component 8 Bits per pixel 24 Video Acceleration Information Log Messages GpuProcessHostUIShim: The GPU process crashed! GpuProcessHostUIShim: The GPU process crashed! GpuProcessHostUIShim: The GPU process crashed! GpuProcessHostUIShim: The GPU process crashed! GpuProcessHostUIShim: The GPU process crashed! GpuProcessHostUIShim: The GPU process crashed!
(In reply to Carlos J. Puga Medina from comment #13) Enabling "Override software rendering list" not helped on Nvidia. I think it can't help because GpuProcessHostUIShim hangs on Nvidia cards.
(In reply to Oleh Hushchenkov from comment #15) It may need some work to get Nvidia cards working https://codesearch.chromium.org/chromium/src/gpu/ipc/service/gpu_init.cc?dr&q=gpu_ini&g=0&l=78
Created attachment 196276 [details] patch-fix-nvidia-access-device Try the attached patch and report back.
Created attachment 196313 [details] Nvidia Fermi GPU report after second patch It seems that the patch does not change anything.
Reopen the PR until fixing the Nvidia GPU access setup.
(In reply to Oleh Hushchenkov from comment #18) Could you post outputs of pciconf -lv and ls -la /dev/ here? Thank you
Created attachment 196327 [details] Output of "pciconf -lv"
Created attachment 196328 [details] Output of "ls -la /dev/"
Created attachment 196361 [details] gpu_info.c Please compile attached file and run it on target system: sudo pkg install libpci cc -o gpu_info -I/usr/local/include gpu_info.c -L/usr/local/lib -lGL -lX11 -lpci ./gpu_info It's some code extracted from Chromium to save time on rebuilding whole package with patches. Also please run glxinfo and attach output to this PR
irontree:/tmp,9:00am> uname -a FreeBSD irontree.solnet 11.2-STABLE FreeBSD 11.2-STABLE #0 r337369: Mon Aug 6 16:36:31 NZST 2018 root@irontree.solnet:/usr/obj/usr/src/sys/GENERIC amd64 irontree:/tmp,9:00am> cc -o gpu-info -I/usr/local/include gpuinfo.c -L/usr/local/lib -lGL -lX11 -lpci irontree:/tmp,9:01am> ./gpu-info Mesa GPU info: Segmentation fault (core dumped)
Created attachment 196365 [details] glxinfo output Attached info from glxinfo
Here's a gdb stacktrace: irontree:/tmp,9:30am> cc -g -o gpu-info -I/usr/local/include gpuinfo.c -L/usr/local/lib -lGL -lX11 -lpci irontree:/tmp,9:38am> gdb gpu-info GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... (gdb) r Starting program: /tmp/gpu-info Mesa GPU info: Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () Current language: auto; currently minimal (gdb) bt #0 0x0000000000000000 in ?? () #1 0x0000000000400b0b in mesa_info () at gpuinfo.c:26 #2 0x0000000000400cfb in main (agrc=1, argv=0x7fffffffe590) at gpuinfo.c:74 (gdb) l 26 21 PFNGLXQUERYRENDERERINTEGERMESAPROC queryInteger = 22 (PFNGLXQUERYRENDERERINTEGERMESAPROC) glXGetProcAddressARB((const GLubyte *) 23 "glXQueryRendererIntegerMESA"); 24 25 int vendor_ret = 26 queryInteger(display, 0, 0, GLX_RENDERER_VENDOR_ID_MESA, vid); 27 int device_ret = 28 queryInteger(display, 0, 0, GLX_RENDERER_DEVICE_ID_MESA, did); 29 30 if (vendor_ret) (gdb)
(In reply to Jonathan Chen from comment #26) Thanks Jonathan, it's more clear now. Current code assumes that libMESA is used and uses MESA-specific extension to get renderer IDs. nVidia drivers do not have this function naturally so GPU thread crashes when trying to call NULL-ptr function.
(In reply to Oleksandr Tymoshenko from comment #27) Then, the next step is to remove this code and check again. Do we need some glue code to fix it? Thanks Oleksandr for taking a look :)
(In reply to Carlos J. Puga Medina from comment #28) I think the right way to solve this is to fallback to PCI devices scan if this extension is not available. I'll have patch ready a bit later today or tomorrow.
(In reply to Oleksandr Tymoshenko from comment #29) OK, drop me a line to test the changes.
Created attachment 196391 [details] chromium-detect-pci-gpus.diff Patch that fixes crash with non-MESA drivers and falls back to scanning PCI devices. Ideally, we'd like to use libpci but the current version calculates device class wrong for non-root users (patch submitted to libpci author), so a workaround would be messy. Instead, use direct access to /dev/pci. Once the upstream fixes the bug generic libpci code can be used.
(In reply to Oleksandr Tymoshenko from comment #31) Right now testing@work @Oleh, @Jonathan Would you mind to verify if the Nvidia crash is fixed? Thanks
(In reply to Carlos J. Puga Medina from comment #32) Build chromium takes 5 hours on my computer. When the build process is completed, I will test and report back.
Created attachment 196394 [details] chrome://gpu post-patch My test run appears to run fine, and it appears that h/w acceleration has been enabled. I've attached the output from chrome://gpu. It looks good so far.
Created attachment 196409 [details] Nvidia Fermi GPU report after third patch With last patch it works, chrome://gpu attached.
Thank you Oleksandr and Carlos!
I've been using the patched chromium for more than a day now, and it appears to be performing well. IMO, it should be safe to apply the patch onto the port. Thanks for your work, Oleksandr and Carlos!
A commit references this bug: Author: cpm Date: Wed Aug 22 09:58:20 UTC 2018 New revision: 477781 URL: https://svnweb.freebsd.org/changeset/ports/477781 Log: - Add more useful comments to make Makefile more readable - Fix TEST option allow running basic tests and skip tests that must be verified if they are supported before being added back to TEST_TARGETS - Add patches that fixes crash with non-MESA drivers fall back to scanning PCI devices. Ideally, we'd like to use libpci but the current version calculates device class wrong for non-root users (patch submitted to libpci author), so a workaround would be messy. Instead, use direct access to /dev/pci. Once the upstream fixes the bug generic libpci code can be used [1] Tested by: Oleh Hushchenkov <gor@clogic.com.ua>, Jonathan Chen <jonc@chen.org.nz> - Bump PORTREVISION PR: 230450 [1] Submitted by: gonzo [1] Reported by: Oleh Hushchenkov, Jonathan Chen [1] Changes: head/www/chromium/Makefile head/www/chromium/Makefile.tests head/www/chromium/distinfo head/www/chromium/files/patch-base_process_memory__unittest.cc head/www/chromium/files/patch-chrome_test_base_in__process__browser__test.cc head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp
A commit references this bug: Author: cpm Date: Wed Aug 22 10:01:04 UTC 2018 New revision: 477782 URL: https://svnweb.freebsd.org/changeset/ports/477782 Log: MFH: r477781 - Add more useful comments to make Makefile more readable - Fix TEST option allow running basic tests and skip tests that must be verified if they are supported before being added back to TEST_TARGETS - Add patches that fixes crash with non-MESA drivers fall back to scanning PCI devices. Ideally, we'd like to use libpci but the current version calculates device class wrong for non-root users (patch submitted to libpci author), so a workaround would be messy. Instead, use direct access to /dev/pci. Once the upstream fixes the bug generic libpci code can be used [1] Tested by: Oleh Hushchenkov <gor@clogic.com.ua>, Jonathan Chen <jonc@chen.org.nz> - Bump PORTREVISION PR: 230450 [1] Submitted by: gonzo [1] Reported by: Oleh Hushchenkov, Jonathan Chen [1] Approved by: ports-secteam (blanket) Changes: _U branches/2018Q3/ branches/2018Q3/www/chromium/Makefile branches/2018Q3/www/chromium/Makefile.tests branches/2018Q3/www/chromium/distinfo branches/2018Q3/www/chromium/files/patch-base_process_memory__unittest.cc branches/2018Q3/www/chromium/files/patch-chrome_test_base_in__process__browser__test.cc branches/2018Q3/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h branches/2018Q3/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp branches/2018Q3/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp branches/2018Q3/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp
Committed, thanks!