Created
September 4, 2023 09:29
-
-
Save andreped/21749b8f89983b97622719ba4f9c9bbf to your computer and use it in GitHub Desktop.
fast-python-intel-opencl-runtime-fix.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/andreped/21749b8f89983b97622719ba4f9c9bbf/fast-python-intel-opencl-runtime-fix.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "YJBII5KZUE1X", | |
"outputId": "2ccb6245-00cd-4f74-f091-be18a4a649af" | |
}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"--2023-09-04 09:27:46-- https://github.com/intel/llvm/releases/download/2023-WW27/oclcpuexp-2023.16.6.0.28_rel.tar.gz\n", | |
"Resolving github.com (github.com)... 140.82.112.4\n", | |
"Connecting to github.com (github.com)|140.82.112.4|:443... connected.\n", | |
"HTTP request sent, awaiting response... 302 Found\n", | |
"Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/166008577/d012b9ed-449a-44e6-a945-ab162813e817?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230904%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230904T092746Z&X-Amz-Expires=300&X-Amz-Signature=c578e609c44508704b247274420e185e89947187fcfa9d18474711e3a042a4e5&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=166008577&response-content-disposition=attachment%3B%20filename%3Doclcpuexp-2023.16.6.0.28_rel.tar.gz&response-content-type=application%2Foctet-stream [following]\n", | |
"--2023-09-04 09:27:46-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/166008577/d012b9ed-449a-44e6-a945-ab162813e817?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230904%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230904T092746Z&X-Amz-Expires=300&X-Amz-Signature=c578e609c44508704b247274420e185e89947187fcfa9d18474711e3a042a4e5&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=166008577&response-content-disposition=attachment%3B%20filename%3Doclcpuexp-2023.16.6.0.28_rel.tar.gz&response-content-type=application%2Foctet-stream\n", | |
"Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...\n", | |
"Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.\n", | |
"HTTP request sent, awaiting response... 200 OK\n", | |
"Length: 148579727 (142M) [application/octet-stream]\n", | |
"Saving to: ‘oclcpuexp-2023.16.6.0.28_rel.tar.gz’\n", | |
"\n", | |
"oclcpuexp-2023.16.6 100%[===================>] 141.70M 163MB/s in 0.9s \n", | |
"\n", | |
"2023-09-04 09:27:47 (163 MB/s) - ‘oclcpuexp-2023.16.6.0.28_rel.tar.gz’ saved [148579727/148579727]\n", | |
"\n", | |
"oclcpuexp-2023.16.6.0.28_rel\n", | |
"x64/\n", | |
"x64/__ocl_svml_e9.so\n", | |
"x64/clbltfnz1.rtl\n", | |
"x64/clbltfne9.rtl\n", | |
"x64/cllibraryz1.o\n", | |
"x64/libintlc.so.5\n", | |
"x64/__ocl_svml_l9.so\n", | |
"x64/libintelocl.so.2023.16.6.0\n", | |
"x64/libintelocl.so\n", | |
"x64/cllibraryz0.o\n", | |
"x64/__ocl_svml_z0.so\n", | |
"x64/libimf.so\n", | |
"x64/clbltfnz0.rtl\n", | |
"x64/libintelocl.so-gdb.py\n", | |
"x64/cllibraryl9.o\n", | |
"x64/libcommon_clang.so\n", | |
"x64/libirng.so\n", | |
"x64/__ocl_svml_z1.so\n", | |
"x64/libOpenCL.so.1\n", | |
"x64/cllibrarye9.o\n", | |
"x64/clbltfnh8.rtl\n", | |
"x64/__ocl_svml_h8.so\n", | |
"x64/cllibraryh8.o\n", | |
"x64/cl.cfg\n", | |
"x64/clbltfnl9.rtl\n", | |
"x64/cllibrary.rtl\n", | |
"x64/libOpenCL.so.1.2\n", | |
"x64/libOpenCL.so\n", | |
"x64/libsvml.so\n", | |
"clbltfnshared.rtl\n", | |
"Reading package lists... Done\n", | |
"Building dependency tree... Done\n", | |
"Reading state information... Done\n", | |
"libopengl0 is already the newest version (1.4.0-1).\n", | |
"0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.\n" | |
] | |
} | |
], | |
"source": [ | |
"## Setup OpenCL: https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md#install-low-level-runtime\n", | |
"\n", | |
"# download OpenCL CPU-only RunTime (RT)\n", | |
"!wget \"https://github.com/intel/llvm/releases/download/2023-WW27/oclcpuexp-2023.16.6.0.28_rel.tar.gz\"\n", | |
"cpu_version=\"oclcpuexp-2023.16.6.0.28_rel\"\n", | |
"!echo $cpu_version\n", | |
"\n", | |
"# Extract OpenCL CPU RT\n", | |
"!mkdir -p /opt/intel/oclcpuexp_{cpu_version}\n", | |
"!cd /opt/intel/oclcpuexp_{cpu_version}\n", | |
"!tar -zxvf {cpu_version}.tar.gz\n", | |
"!cp -r x64/ /opt/intel/oclcpuexp_{cpu_version}/\n", | |
"\n", | |
"# OpenCL CPU RT\n", | |
"!mkdir -p /etc/OpenCL/vendors\n", | |
"!echo /opt/intel/oclcpuexp_{cpu_version}/x64/libintelocl.so > \\\n", | |
" /etc/OpenCL/vendors/intel_expcpu.icd\n", | |
"\n", | |
"!echo /opt/intel/oclcpuexp_{cpu_version}/x64 >> \\\n", | |
" /etc/ld.so.conf.d/libintelopenclexp.conf\n", | |
"!ldconfig -f /etc/ld.so.conf.d/libintelopenclexp.conf\n", | |
"\n", | |
"## Setup OpenGL\n", | |
"!sudo apt-get install -y libopengl0" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!ls /etc/OpenCL/vendors/\n", | |
"!clinfo" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "FMNIFAiuRo0C", | |
"outputId": "61a65c2c-2874-4f77-99f8-10315e1f2d1e" | |
}, | |
"execution_count": 2, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"intel_expcpu.icd\n", | |
"Number of platforms 1\n", | |
" Platform Name Intel(R) OpenCL\n", | |
" Platform Vendor Intel(R) Corporation\n", | |
" Platform Version OpenCL 3.0 LINUX\n", | |
" Platform Profile FULL_PROFILE\n", | |
" Platform Extensions cl_khr_spirv_linkonce_odr cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_icd cl_khr_il_program cl_khr_subgroup_shuffle cl_khr_subgroup_shuffle_relative cl_khr_subgroup_extended_types cl_khr_subgroup_non_uniform_arithmetic cl_intel_subgroups cl_intel_subgroups_char cl_intel_subgroups_short cl_intel_subgroups_long cl_intel_required_subgroup_size cl_intel_spirv_subgroups cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_intel_unified_shared_memory cl_intel_device_attribute_query cl_intel_exec_by_local_thread cl_intel_vec_len_hint cl_intel_device_partition_by_names cl_khr_spir cl_khr_image2d_from_buffer\n", | |
" Platform Extensions with Version cl_khr_spirv_linkonce_odr 0x400000 (1.0.0)\n", | |
" cl_khr_fp64 0x400000 (1.0.0)\n", | |
" cl_khr_global_int32_base_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_global_int32_extended_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_local_int32_base_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_local_int32_extended_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_3d_image_writes 0x400000 (1.0.0)\n", | |
" cl_khr_byte_addressable_store 0x400000 (1.0.0)\n", | |
" cl_khr_depth_images 0x400000 (1.0.0)\n", | |
" cl_khr_icd 0x400000 (1.0.0)\n", | |
" cl_khr_il_program 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_shuffle 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_shuffle_relative 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_extended_types 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_non_uniform_arithmetic 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups_char 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups_short 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups_long 0x400000 (1.0.0)\n", | |
" cl_intel_required_subgroup_size 0x400000 (1.0.0)\n", | |
" cl_intel_spirv_subgroups 0x400000 (1.0.0)\n", | |
" cl_khr_int64_base_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_int64_extended_atomics 0x400000 (1.0.0)\n", | |
" cl_intel_unified_shared_memory 0x400000 (1.0.0)\n", | |
" cl_intel_device_attribute_query 0x400000 (1.0.0)\n", | |
" cl_intel_exec_by_local_thread 0x400000 (1.0.0)\n", | |
" cl_intel_vec_len_hint 0x400000 (1.0.0)\n", | |
" cl_intel_device_partition_by_names 0x400000 (1.0.0)\n", | |
" cl_khr_spir 0x400000 (1.0.0)\n", | |
" cl_khr_image2d_from_buffer 0x400000 (1.0.0)\n", | |
" Platform Numeric Version 0xc00000 (3.0.0)\n", | |
" Platform Extensions function suffix INTEL\n", | |
" Platform Host timer resolution 1ns\n", | |
"\n", | |
" Platform Name Intel(R) OpenCL\n", | |
"Number of devices 1\n", | |
" Device Name Intel(R) Xeon(R) CPU @ 2.20GHz\n", | |
" Device Vendor Intel(R) Corporation\n", | |
" Device Vendor ID 0x8086\n", | |
" Device Version OpenCL 3.0 (Build 0)\n", | |
" Device Numeric Version 0xc00000 (3.0.0)\n", | |
" Driver Version 2023.16.6.0.28_042959\n", | |
" Device OpenCL C Version OpenCL C 3.0 \n", | |
" Device OpenCL C all versions OpenCL C 0xc00000 (3.0.0)\n", | |
" OpenCL C 0x800000 (2.0.0)\n", | |
" OpenCL C 0x402000 (1.2.0)\n", | |
" OpenCL C 0x401000 (1.1.0)\n", | |
" OpenCL C 0x400000 (1.0.0)\n", | |
" Device OpenCL C features __opencl_c_3d_image_writes 0xc00000 (3.0.0)\n", | |
" __opencl_c_atomic_order_acq_rel 0xc00000 (3.0.0)\n", | |
" __opencl_c_atomic_order_seq_cst 0xc00000 (3.0.0)\n", | |
" __opencl_c_atomic_scope_device 0xc00000 (3.0.0)\n", | |
" __opencl_c_atomic_scope_all_devices 0xc00000 (3.0.0)\n", | |
" __opencl_c_device_enqueue 0xc00000 (3.0.0)\n", | |
" __opencl_c_generic_address_space 0xc00000 (3.0.0)\n", | |
" __opencl_c_fp64 0xc00000 (3.0.0)\n", | |
" __opencl_c_images 0xc00000 (3.0.0)\n", | |
" __opencl_c_int64 0xc00000 (3.0.0)\n", | |
" __opencl_c_pipes 0xc00000 (3.0.0)\n", | |
" __opencl_c_program_scope_global_variables 0xc00000 (3.0.0)\n", | |
" __opencl_c_read_write_images 0xc00000 (3.0.0)\n", | |
" __opencl_c_subgroups 0xc00000 (3.0.0)\n", | |
" __opencl_c_work_group_collective_functions 0xc00000 (3.0.0)\n", | |
" Latest comfornace test passed v2022-10-05-00\n", | |
" Device Type CPU\n", | |
" Device Profile FULL_PROFILE\n", | |
" Device Available Yes\n", | |
" Compiler Available Yes\n", | |
" Linker Available Yes\n", | |
" Max compute units 2\n", | |
" Max clock frequency 2200MHz\n", | |
" Device Partition (core)\n", | |
" Max number of sub-devices 2\n", | |
" Supported partition types by counts, equally, by names (Intel)\n", | |
" Supported affinity domains (n/a)\n", | |
" Max work item dimensions 3\n", | |
" Max work item sizes 8192x8192x8192\n", | |
" Max work group size 8192\n", | |
" Preferred work group size multiple (device) 128\n", | |
" Preferred work group size multiple (kernel) <getWGsizes:1474: create context : error -2>\n", | |
" Max sub-groups per work group 2048\n", | |
" Sub-group sizes (Intel) 4, 8, 16, 32, 64\n", | |
" Preferred / native vector sizes \n", | |
" char 1 / 32 \n", | |
" short 1 / 16 \n", | |
" int 1 / 8 \n", | |
" long 1 / 4 \n", | |
" half 0 / 0 (n/a)\n", | |
" float 1 / 8 \n", | |
" double 1 / 4 (cl_khr_fp64)\n", | |
" Half-precision Floating-point support (n/a)\n", | |
" Single-precision Floating-point support (core)\n", | |
" Denormals Yes\n", | |
" Infinity and NANs Yes\n", | |
" Round to nearest Yes\n", | |
" Round to zero No\n", | |
" Round to infinity No\n", | |
" IEEE754-2008 fused multiply-add No\n", | |
" Support is emulated in software No\n", | |
" Correctly-rounded divide and sqrt operations No\n", | |
" Double-precision Floating-point support (cl_khr_fp64)\n", | |
" Denormals Yes\n", | |
" Infinity and NANs Yes\n", | |
" Round to nearest Yes\n", | |
" Round to zero Yes\n", | |
" Round to infinity Yes\n", | |
" IEEE754-2008 fused multiply-add Yes\n", | |
" Support is emulated in software No\n", | |
" Address bits 64, Little-Endian\n", | |
" Global memory size 13613305856 (12.68GiB)\n", | |
" Error Correction support No\n", | |
" Max memory allocation 6806652928 (6.339GiB)\n", | |
" Unified memory for Host and Device Yes\n", | |
" Shared Virtual Memory (SVM) capabilities (core)\n", | |
" Coarse-grained buffer sharing Yes\n", | |
" Fine-grained buffer sharing Yes\n", | |
" Fine-grained system sharing Yes\n", | |
" Atomics Yes\n", | |
" Minimum alignment for any data type 128 bytes\n", | |
" Alignment of base address 1024 bits (128 bytes)\n", | |
" Preferred alignment for atomics \n", | |
" SVM 64 bytes\n", | |
" Global 64 bytes\n", | |
" Local 0 bytes\n", | |
" Atomic memory capabilities relaxed, acquire/release, sequentially-consistent, work-group scope, device scope, all-devices scope\n", | |
" Atomic fence capabilities relaxed, acquire/release, sequentially-consistent, work-item scope, work-group scope, device scope, all-devices scope\n", | |
" Max size for global variable 65536 (64KiB)\n", | |
" Preferred total size of global vars 65536 (64KiB)\n", | |
" Global Memory cache type Read/Write\n", | |
" Global Memory cache size 262144 (256KiB)\n", | |
" Global Memory cache line size 64 bytes\n", | |
" Image support Yes\n", | |
" Max number of samplers per kernel 480\n", | |
" Max size for 1D images from buffer 425415808 pixels\n", | |
" Max 1D or 2D image array size 2048 images\n", | |
" Base address alignment for 2D image buffers 64 bytes\n", | |
" Pitch alignment for 2D image buffers 64 pixels\n", | |
" Max 2D image size 16384x16384 pixels\n", | |
" Max 3D image size 2048x2048x2048 pixels\n", | |
" Max number of read image args 480\n", | |
" Max number of write image args 480\n", | |
" Max number of read/write image args 480\n", | |
" Pipe support Yes\n", | |
" Max number of pipe args 16\n", | |
" Max active pipe reservations 131071\n", | |
" Max pipe packet size 1024\n", | |
" Local memory type Global\n", | |
" Local memory size 32768 (32KiB)\n", | |
" Max number of constant args 480\n", | |
" Max constant buffer size 131072 (128KiB)\n", | |
" Generic address space support Yes\n", | |
" Max size of kernel argument 3840 (3.75KiB)\n", | |
" Queue properties (on host) \n", | |
" Out-of-order execution Yes\n", | |
" Profiling Yes\n", | |
" Local thread execution (Intel) Yes\n", | |
" Device enqueue capabilities supported, replaceable default queue\n", | |
" Queue properties (on device) \n", | |
" Out-of-order execution Yes\n", | |
" Profiling Yes\n", | |
" Preferred size 4294967295 (4GiB)\n", | |
" Max size 4294967295 (4GiB)\n", | |
" Max queues on device 4294967295\n", | |
" Max events on device 4294967295\n", | |
" Prefer user sync for interop No\n", | |
" Profiling timer resolution 1ns\n", | |
" Execution capabilities \n", | |
" Run OpenCL kernels Yes\n", | |
" Run native kernels Yes\n", | |
" Non-uniform work-groups Yes\n", | |
" Work-group collective functions Yes\n", | |
" Sub-group independent forward progress No\n", | |
" IL version SPIR-V_1.0\n", | |
" ILs with version SPIR-V 0x400000 (1.0.0)\n", | |
" SPIR versions 1.2\n", | |
" printf() buffer size 1048576 (1024KiB)\n", | |
" Built-in kernels (n/a)\n", | |
" Built-in kernels with version (n/a)\n", | |
" Device Extensions cl_khr_spirv_linkonce_odr cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_icd cl_khr_il_program cl_khr_subgroup_shuffle cl_khr_subgroup_shuffle_relative cl_khr_subgroup_extended_types cl_khr_subgroup_non_uniform_arithmetic cl_intel_subgroups cl_intel_subgroups_char cl_intel_subgroups_short cl_intel_subgroups_long cl_intel_required_subgroup_size cl_intel_spirv_subgroups cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_intel_unified_shared_memory cl_intel_device_attribute_query cl_intel_exec_by_local_thread cl_intel_vec_len_hint cl_intel_device_partition_by_names cl_khr_spir cl_khr_image2d_from_buffer\n", | |
" Device Extensions with Version cl_khr_spirv_linkonce_odr 0x400000 (1.0.0)\n", | |
" cl_khr_fp64 0x400000 (1.0.0)\n", | |
" cl_khr_global_int32_base_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_global_int32_extended_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_local_int32_base_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_local_int32_extended_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_3d_image_writes 0x400000 (1.0.0)\n", | |
" cl_khr_byte_addressable_store 0x400000 (1.0.0)\n", | |
" cl_khr_depth_images 0x400000 (1.0.0)\n", | |
" cl_khr_icd 0x400000 (1.0.0)\n", | |
" cl_khr_il_program 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_shuffle 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_shuffle_relative 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_extended_types 0x400000 (1.0.0)\n", | |
" cl_khr_subgroup_non_uniform_arithmetic 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups_char 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups_short 0x400000 (1.0.0)\n", | |
" cl_intel_subgroups_long 0x400000 (1.0.0)\n", | |
" cl_intel_required_subgroup_size 0x400000 (1.0.0)\n", | |
" cl_intel_spirv_subgroups 0x400000 (1.0.0)\n", | |
" cl_khr_int64_base_atomics 0x400000 (1.0.0)\n", | |
" cl_khr_int64_extended_atomics 0x400000 (1.0.0)\n", | |
" cl_intel_unified_shared_memory 0x400000 (1.0.0)\n", | |
" cl_intel_device_attribute_query 0x400000 (1.0.0)\n", | |
" cl_intel_exec_by_local_thread 0x400000 (1.0.0)\n", | |
" cl_intel_vec_len_hint 0x400000 (1.0.0)\n", | |
" cl_intel_device_partition_by_names 0x400000 (1.0.0)\n", | |
" cl_khr_spir 0x400000 (1.0.0)\n", | |
" cl_khr_image2d_from_buffer 0x400000 (1.0.0)\n", | |
"\n", | |
"NULL platform behavior\n", | |
" clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) No platform\n", | |
" clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) No platform\n", | |
" clCreateContext(NULL, ...) [default] No platform\n", | |
" clCreateContext(NULL, ...) [other] <checkNullCtx:3402: create context with device from non-default platform : error -2>\n", | |
" clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) No devices available in platform\n", | |
" clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices available in platform\n", | |
" clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform\n", | |
" clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform\n", | |
" clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform\n", | |
" clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No devices available in platform\n", | |
"\n", | |
"ICD loader properties\n", | |
" ICD loader Name Khronos OpenCL ICD Loader\n", | |
" ICD loader Vendor Khronos Group\n", | |
" ICD loader Version 3.0.5\n", | |
" ICD loader Profile OpenCL 3.0\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"# install pyFAST\n", | |
"!pip install pyFAST matplotlib" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "K6yZu93tZvsZ", | |
"outputId": "6626b46f-aedb-4e7a-ec0e-d4c4b33d7614" | |
}, | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Collecting pyFAST\n", | |
" Downloading pyFAST-4.7.1-cp36-abi3-manylinux1_x86_64.whl (385.8 MB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m385.8/385.8 MB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (3.7.1)\n", | |
"Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from pyFAST) (1.23.5)\n", | |
"Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (1.1.0)\n", | |
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (0.11.0)\n", | |
"Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (4.42.1)\n", | |
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (1.4.4)\n", | |
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (23.1)\n", | |
"Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (9.4.0)\n", | |
"Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (3.1.1)\n", | |
"Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (2.8.2)\n", | |
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)\n", | |
"Installing collected packages: pyFAST\n", | |
"Successfully installed pyFAST-4.7.1\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!wget https://folk.ntnu.no/andpeder/FastPathology/test_data/WSI/CMU-1.svs" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "r1nJxKBGnpIg", | |
"outputId": "61a54c39-7682-4e5f-9b18-3299488bfefb" | |
}, | |
"execution_count": 4, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"--2023-09-04 09:28:39-- https://folk.ntnu.no/andpeder/FastPathology/test_data/WSI/CMU-1.svs\n", | |
"Resolving folk.ntnu.no (folk.ntnu.no)... 129.241.56.95, 2001:700:300:3::95\n", | |
"Connecting to folk.ntnu.no (folk.ntnu.no)|129.241.56.95|:443... connected.\n", | |
"HTTP request sent, awaiting response... 200 OK\n", | |
"Length: 177552579 (169M) [image/tiff]\n", | |
"Saving to: ‘CMU-1.svs’\n", | |
"\n", | |
"CMU-1.svs 100%[===================>] 169.33M 24.8MB/s in 7.6s \n", | |
"\n", | |
"2023-09-04 09:28:47 (22.4 MB/s) - ‘CMU-1.svs’ saved [177552579/177552579]\n", | |
"\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"# create tissue segmentation pipeline\n", | |
"!git clone https://github.com/andreped/FP-DSA-plugin.git" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "LCwiqDA0HeO0", | |
"outputId": "4e089f93-e3d4-451d-bdca-145530bed228" | |
}, | |
"execution_count": 5, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Cloning into 'FP-DSA-plugin'...\n", | |
"remote: Enumerating objects: 447, done.\u001b[K\n", | |
"remote: Counting objects: 100% (59/59), done.\u001b[K\n", | |
"remote: Compressing objects: 100% (52/52), done.\u001b[K\n", | |
"remote: Total 447 (delta 25), reused 22 (delta 7), pack-reused 388\u001b[K\n", | |
"Receiving objects: 100% (447/447), 6.91 MiB | 21.32 MiB/s, done.\n", | |
"Resolving deltas: 100% (261/261), done.\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!runPipeline \"FP-DSA-plugin/dsa/fastpathology/fastpathology/pipelines/tissue_segmentation.fpl\" --verbose --opencl-platform intel --input CMU-1.svs --output result" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "S5I5Y90GITWA", | |
"outputId": "622e038a-1460-45e0-fa38-9e4707605b24" | |
}, | |
"execution_count": 6, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"\u001b[32;1m\n", | |
" - Powered by - \n", | |
" _______ __________ \n", | |
" / __/ _ | / __/_ __/ https://fast.eriksmistad.no\n", | |
" / _// __ |_\\ \\ / / v4.7.1\n", | |
"/_/ /_/ |_/___/ /_/ \n", | |
"\n", | |
"\u001b[0mINFO [139296783949504] Processing token --opencl-platform\u001b[0m\n", | |
"INFO [139296783949504] Processing token --input\u001b[0m\n", | |
"INFO [139296783949504] Processing token CMU-1.svs\u001b[0m\n", | |
"INFO [139296783949504] CommandLineParser: Assigning variable input with value CMU-1.svs\u001b[0m\n", | |
"INFO [139296783949504] Processing token --output\u001b[0m\n", | |
"INFO [139296783949504] Processing token result\u001b[0m\n", | |
"INFO [139296783949504] CommandLineParser: Assigning variable output with value result\u001b[0m\n", | |
"INFO [139296783949504] Running pipeline in headless mode\u001b[0m\n", | |
"INFO [139296783949504] Loaded configuration file: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin/fast_configuration.txt\u001b[0m\n", | |
"INFO [139296783949504] Test data path: /root/FAST/data/\u001b[0m\n", | |
"INFO [139296783949504] Kernel source path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//kernels/\u001b[0m\n", | |
"INFO [139296783949504] Kernel binary path: /root/FAST//kernel_binaries/\u001b[0m\n", | |
"INFO [139296783949504] Documentation path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//doc/\u001b[0m\n", | |
"INFO [139296783949504] Pipeline path: /root/FAST//pipelines/\u001b[0m\n", | |
"INFO [139296783949504] Qt plugins path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//plugins/\u001b[0m\n", | |
"INFO [139296783949504] Library path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//lib/\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"INFO [139296783949504] Found variable input in pipeline file\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"INFO [139296783949504] Found variable output in pipeline file\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"Pipeline execution started.\n", | |
"INFO [139296783949504] Found pipeline attribute classes in pipeline file with value Background;Tissue\u001b[0m\n", | |
"INFO [139296783949504] Creating new QApp\u001b[0m\n", | |
"\u001b[1mWARNING [139296783949504] Unable to open X display. Disabling visualization.\u001b[0m\n", | |
"QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'\n", | |
"INFO [139296783949504] Found 1 OpenCL platforms.\u001b[0m\n", | |
"INFO [139296783949504] 1 platforms selected for inspection.\u001b[0m\n", | |
"INFO [139296783949504] Platform 0: Intel(R) Corporation\u001b[0m\n", | |
"INFO [139296783949504] This platform has 1 available devices in total\u001b[0m\n", | |
"INFO [139296783949504] Looking for GPU devices only.\u001b[0m\n", | |
"INFO [139296783949504] 0 selected.\u001b[0m\n", | |
"INFO [139296783949504] NO suitable GPU found! Trying to find other devices\u001b[0m\n", | |
"INFO [139296783949504] Found 1 OpenCL platforms.\u001b[0m\n", | |
"INFO [139296783949504] 1 platforms selected for inspection.\u001b[0m\n", | |
"INFO [139296783949504] Platform 0: Intel(R) Corporation\u001b[0m\n", | |
"INFO [139296783949504] This platform has 1 available devices in total\u001b[0m\n", | |
"INFO [139296783949504] Looking for all types of devices.\u001b[0m\n", | |
"INFO [139296783949504] 1 selected.\u001b[0m\n", | |
"INFO [139296783949504] Inspecting device 0 with the name Intel(R) Xeon(R) CPU @ 2.20GHz\u001b[0m\n", | |
"INFO [139296783949504] The device was accepted.\u001b[0m\n", | |
"INFO [139296783949504] Intel(R) Xeon(R) CPU @ 2.20GHz has 2 compute units\u001b[0m\n", | |
"INFO [139296783949504] The device Intel(R) Xeon(R) CPU @ 2.20GHz got a score of 2\u001b[0m\n", | |
"INFO [139296783949504] The platform Intel(R) OpenCL was selected as the best platform.\u001b[0m\n", | |
"INFO [139296783949504] A total of 1 devices were selected for the context from this platform:\u001b[0m\n", | |
"INFO [139296783949504] The best device was: Intel(R) Xeon(R) CPU @ 2.20GHz\u001b[0m\n", | |
"\u001b[31;1mERROR [139296783949504] Terminated with unhandled exception: clCreateContext\n", | |
"\u001b[0m" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!runPipeline --datahub nuclei-segmentation --verbose --opencl-platform intel --filename CMU-1.svs" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "JNBxu8lDmlqp", | |
"outputId": "39072438-9a3c-4452-bbc1-9fd266dd7982" | |
}, | |
"execution_count": 7, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"\u001b[32;1m\n", | |
" - Powered by - \n", | |
" _______ __________ \n", | |
" / __/ _ | / __/_ __/ https://fast.eriksmistad.no\n", | |
" / _// __ |_\\ \\ / / v4.7.1\n", | |
"/_/ /_/ |_/___/ /_/ \n", | |
"\n", | |
"\u001b[0mINFO [136329872953024] Processing token --opencl-platform\u001b[0m\n", | |
"INFO [136329872953024] Processing token --filename\u001b[0m\n", | |
"INFO [136329872953024] Processing token CMU-1.svs\u001b[0m\n", | |
"INFO [136329872953024] CommandLineParser: Assigning variable filename with value CMU-1.svs\u001b[0m\n", | |
"INFO [136329872953024] Running pipeline in headless mode\u001b[0m\n", | |
"INFO [136329872953024] Loaded configuration file: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin/fast_configuration.txt\u001b[0m\n", | |
"INFO [136329872953024] Test data path: /root/FAST/data/\u001b[0m\n", | |
"INFO [136329872953024] Kernel source path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//kernels/\u001b[0m\n", | |
"INFO [136329872953024] Kernel binary path: /root/FAST//kernel_binaries/\u001b[0m\n", | |
"INFO [136329872953024] Documentation path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//doc/\u001b[0m\n", | |
"INFO [136329872953024] Pipeline path: /root/FAST//pipelines/\u001b[0m\n", | |
"INFO [136329872953024] Qt plugins path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//plugins/\u001b[0m\n", | |
"INFO [136329872953024] Library path: /usr/local/lib/python3.10/dist-packages/fast/bin/../bin//..//lib/\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"INFO [136329872953024] Creating new QApp\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Unable to open X display. Disabling visualization.\u001b[0m\n", | |
"QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'\n", | |
"Retrieving 'Nuclei segmentation' pipeline from FAST Data Hub\n", | |
"Retrieving 'Nuclei segmentation model' model from FAST Data Hub\n", | |
"License: CC BY 4.0\n", | |
"Downloading [] 100% | 27MB / 27MB | ETA 0.0 mins\n", | |
"Complete.\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"INFO [136329872953024] Found variable filename in pipeline file\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"\u001b[1mWARNING [136329872953024] Test data was NOT found at /root/FAST/data/. Download the test data by running ./downloadTestData or fast.downloadTestDataIfNotExists() in Python.\u001b[0m\n", | |
"Pipeline execution started.\n", | |
"INFO [136329872953024] QApp already exists..\u001b[0m\n", | |
"INFO [136329872953024] Found 1 OpenCL platforms.\u001b[0m\n", | |
"INFO [136329872953024] 1 platforms selected for inspection.\u001b[0m\n", | |
"INFO [136329872953024] Platform 0: Intel(R) Corporation\u001b[0m\n", | |
"INFO [136329872953024] This platform has 1 available devices in total\u001b[0m\n", | |
"INFO [136329872953024] Looking for GPU devices only.\u001b[0m\n", | |
"INFO [136329872953024] 0 selected.\u001b[0m\n", | |
"INFO [136329872953024] NO suitable GPU found! Trying to find other devices\u001b[0m\n", | |
"INFO [136329872953024] Found 1 OpenCL platforms.\u001b[0m\n", | |
"INFO [136329872953024] 1 platforms selected for inspection.\u001b[0m\n", | |
"INFO [136329872953024] Platform 0: Intel(R) Corporation\u001b[0m\n", | |
"INFO [136329872953024] This platform has 1 available devices in total\u001b[0m\n", | |
"INFO [136329872953024] Looking for all types of devices.\u001b[0m\n", | |
"INFO [136329872953024] 1 selected.\u001b[0m\n", | |
"INFO [136329872953024] Inspecting device 0 with the name Intel(R) Xeon(R) CPU @ 2.20GHz\u001b[0m\n", | |
"INFO [136329872953024] The device was accepted.\u001b[0m\n", | |
"INFO [136329872953024] Intel(R) Xeon(R) CPU @ 2.20GHz has 2 compute units\u001b[0m\n", | |
"INFO [136329872953024] The device Intel(R) Xeon(R) CPU @ 2.20GHz got a score of 2\u001b[0m\n", | |
"INFO [136329872953024] The platform Intel(R) OpenCL was selected as the best platform.\u001b[0m\n", | |
"INFO [136329872953024] A total of 1 devices were selected for the context from this platform:\u001b[0m\n", | |
"INFO [136329872953024] The best device was: Intel(R) Xeon(R) CPU @ 2.20GHz\u001b[0m\n", | |
"\u001b[31;1mERROR [136329872953024] Terminated with unhandled exception: clCreateContext\n", | |
"\u001b[0m" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"# run simple WSI patch generation pipeline\n", | |
"import fast\n", | |
"import matplotlib.pyplot as plt\n", | |
"\n", | |
"# This will download the test data needed to run the example\n", | |
"fast.downloadTestDataIfNotExists()\n", | |
"\n", | |
"importer = fast.WholeSlideImageImporter.create(\n", | |
" fast.Config.getTestDataPath() + 'WSI/A05.svs')\n", | |
"\n", | |
"tissueSegmentation = fast.TissueSegmentation.create().connect(importer)\n", | |
"\n", | |
"patchGenerator = fast.PatchGenerator.create(512, 512, level=0)\\\n", | |
" .connect(0, importer)\\\n", | |
" .connect(1, tissueSegmentation)\n", | |
"\n", | |
"# Create a 3x3 subplot for every set of 9 patches\n", | |
"patch_list = []\n", | |
"for patch in fast.DataStream(patchGenerator):\n", | |
" patch_list.append(patch)\n", | |
" if len(patch_list) == 9:\n", | |
" # Display the 9 last patches\n", | |
" f, axes = plt.subplots(3,3, figsize=(10,10))\n", | |
" for i in range(3):\n", | |
" for j in range(3):\n", | |
" axes[i, j].imshow(patch_list[i + j*3])\n", | |
" #plt.show()\n", | |
" patch_list.clear()\n", | |
" break\n" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 399 | |
}, | |
"id": "qZRaLbR_Zzpz", | |
"outputId": "02d5b3fa-beca-4318-a0e5-b054f3a410e6" | |
}, | |
"execution_count": 8, | |
"outputs": [ | |
{ | |
"output_type": "error", | |
"ename": "RuntimeError", | |
"evalue": "ignored", | |
"traceback": [ | |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | |
"\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", | |
"\u001b[0;32m<ipython-input-8-9f65d4035c61>\u001b[0m in \u001b[0;36m<cell line: 2>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# run simple WSI patch generation pipeline\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mfast\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mmatplotlib\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpyplot\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m# This will download the test data needed to run the example\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", | |
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/fast/__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[0mfast\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mConfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msetTerminateHandlerDisabled\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mTrue\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mx\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margv\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m'UFFviewer'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'runPipeline'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'systemCheck'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 22\u001b[0;31m \u001b[0mfast\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mImageFileImporter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m''\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# Trigger splash, GL context initialization etc.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", | |
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/fast/fast.py\u001b[0m in \u001b[0;36mcreate\u001b[0;34m(filename, grayscale)\u001b[0m\n\u001b[1;32m 14342\u001b[0m \u001b[0;34m:\u001b[0m\u001b[0;32mreturn\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0minstance\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 14343\u001b[0m \"\"\"\n\u001b[0;32m> 14344\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_fast\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mImageFileImporter_create\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgrayscale\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 14345\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 14346\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0msetGrayscale\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgrayscale\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m\"bool\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;34m\"void\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", | |
"\u001b[0;31mRuntimeError\u001b[0m: clCreateContext" | |
] | |
} | |
] | |
} | |
], | |
"metadata": { | |
"colab": { | |
"provenance": [], | |
"gpuType": "T4", | |
"authorship_tag": "ABX9TyORScOWaBAfJnRFlKXb/pIO", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"display_name": "Python 3", | |
"name": "python3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment