How to use sw_opengl_vendor method of phodevi_system class

Best Phoronix-test-suite code snippet using phodevi_system.sw_opengl_vendor

phodevi_system.php

Source:phodevi_system.php Github

copy

Full Screen

...67 case 'opencl-driver':68 $property = new phodevi_device_property('sw_opencl_driver', phodevi::std_caching);69 break;70 case 'opengl-vendor':71 $property = new phodevi_device_property('sw_opengl_vendor', phodevi::smart_caching);72 break;73 case 'desktop-environment':74 $property = new phodevi_device_property('sw_desktop_environment', phodevi::smart_caching);75 break;76 case 'operating-system':77 $property = new phodevi_device_property('sw_operating_system', phodevi::smart_caching);78 break;79 case 'os-version':80 $property = new phodevi_device_property('sw_os_version', phodevi::smart_caching);81 break;82 case 'kernel':83 $property = new phodevi_device_property('sw_kernel', phodevi::smart_caching);84 break;85 case 'kernel-architecture':86 $property = new phodevi_device_property('sw_kernel_architecture', phodevi::smart_caching);87 break;88 case 'kernel-date':89 $property = new phodevi_device_property('sw_kernel_date', phodevi::smart_caching);90 break;91 case 'kernel-string':92 $property = new phodevi_device_property('sw_kernel_string', phodevi::smart_caching);93 break;94 case 'kernel-parameters':95 $property = new phodevi_device_property('sw_kernel_parameters', phodevi::std_caching);96 break;97 case 'compiler':98 $property = new phodevi_device_property('sw_compiler', phodevi::std_caching);99 break;100 case 'system-layer':101 $property = new phodevi_device_property('sw_system_layer', phodevi::std_caching);102 break;103 case 'environment-variables':104 $property = new phodevi_device_property('sw_environment_variables', phodevi::std_caching);105 break;106 }107 return $property;108 }109 public static function sw_username()110 {111 // Gets the system user's name112 if(function_exists('posix_getpwuid') && function_exists('posix_getuid'))113 {114 $userinfo = posix_getpwuid(posix_getuid());115 $username = $userinfo['name'];116 }117 else118 {119 $username = trim(getenv('USERNAME'));120 }121 return $username;122 }123 public static function sw_system_layer()124 {125 $layer = null;126 if(phodevi::is_windows() && pts_client::executable_in_path('winecfg.exe') && ($wine = phodevi::read_property('system', 'wine-version')))127 {128 $layer = $wine;129 }130 else131 {132 // Report virtualization133 $layer = phodevi::read_property('system', 'virtualized-mode');134 }135 return $layer;136 }137 public static function sw_hostname()138 {139 $hostname = 'Unknown';140 if(($bin = pts_client::executable_in_path('hostname')))141 {142 $hostname = trim(shell_exec($bin . ' 2>&1'));143 }144 else if(phodevi::is_windows())145 {146 $hostname = getenv('USERDOMAIN');147 }148 return $hostname;149 }150 public static function sw_vendor_identifier()151 {152 // Returns the vendor identifier used with the External Dependencies and other distro-specific features153 $vendor = phodevi::is_linux() ? phodevi_linux_parser::read_lsb_distributor_id() : false;154 if(!$vendor)155 {156 $vendor = phodevi::read_property('system', 'operating-system');157 if(($spos = strpos($vendor, ' ')) > 1)158 {159 $vendor = substr($vendor, 0, $spos);160 }161 }162 return str_replace(array(' ', '/'), '', strtolower($vendor));163 }164 public static function sw_filesystem()165 {166 // Determine file-system type167 $fs = null;168 if(phodevi::is_macosx())169 {170 $fs = phodevi_osx_parser::read_osx_system_profiler('SPSerialATADataType', 'FileSystem');171 if($fs == null && pts_client::executable_in_path('mount'))172 {173 $mount = shell_exec('mount 2>&1');174 if(stripos($mount, ' on / (hfs, local, journaled)') !== false)175 {176 $fs = 'Journaled HFS+';177 }178 else if(stripos($mount, ' on / (hfs') !== false)179 {180 $fs = 'HFS+';181 }182 }183 }184 else if(phodevi::is_bsd())185 {186 if(pts_client::executable_in_path('mount'))187 {188 $mount = shell_exec('mount 2>&1');189 if(($start = strpos($mount, 'on / (')) != false)190 {191 // FreeBSD, DragonflyBSD mount formatting192 /*193 -bash-4.0$ mount194 ROOT on / (hammer, local)195 /dev/da0s1a on /boot (ufs, local)196 /pfs/@@-1:00001 on /var (null, local)197 /pfs/@@-1:00002 on /tmp (null, local)198 /pfs/@@-1:00003 on /usr (null, local)199 /pfs/@@-1:00004 on /home (null, local)200 /pfs/@@-1:00005 on /usr/obj (null, local)201 /pfs/@@-1:00006 on /var/crash (null, local)202 /pfs/@@-1:00007 on /var/tmp (null, local)203 procfs on /proc (procfs, local)204 */205 // TODO: improve this in case there are other partitions, etc206 $fs = substr($mount, $start + 6);207 $fs = substr($fs, 0, strpos($fs, ','));208 }209 else if(($start = strpos($mount, 'on / type')) != false)210 {211 // OpenBSD 5.0 formatting is slightly different from above FreeBSD example212 // TODO: improve this in case there are other partitions, etc213 $fs = substr($mount, $start + 10);214 $fs = substr($fs, 0, strpos($fs, ' '));215 }216 }217 }218 else if(phodevi::is_hurd())219 {220 // Very rudimentary Hurd filesystem detection support but works for at least a clean Debian GNU/Hurd EXT2 install221 if(pts_client::executable_in_path('mount'))222 {223 $mount = shell_exec('mount 2>&1');224 if(($start = strpos($mount, 'on / type')) != false)225 {226 $fs = substr($mount, $start + 10);227 $fs = substr($fs, 0, strpos($fs, ' '));228 if(substr($fs, -2) == 'fs')229 {230 $fs = substr($fs, 0, -2);231 }232 }233 }234 }235 else if(phodevi::is_linux() || phodevi::is_solaris())236 {237 $fs = trim(shell_exec('stat ' . pts_client::test_install_root_path() . ' -L -f -c %T 2> /dev/null'));238 switch($fs)239 {240 case 'ext2/ext3':241 if(isset(phodevi::$vfs->mounts))242 {243 $fstab = phodevi::$vfs->mounts;244 $fstab = str_replace('/boot ', 'IGNORE', $fstab);245 $using_ext2 = strpos($fstab, ' ext2') !== false;246 $using_ext3 = strpos($fstab, ' ext3') !== false;247 $using_ext4 = strpos($fstab, ' ext4') !== false;248 if(!$using_ext2 && !$using_ext3 && $using_ext4)249 {250 $fs = 'ext4';251 }252 else if(!$using_ext2 && !$using_ext4 && $using_ext3)253 {254 $fs = 'ext3';255 }256 else if(!$using_ext3 && !$using_ext4 && $using_ext2)257 {258 $fs = 'ext2';259 }260 else if(is_dir('/proc/fs/ext4/'))261 {262 $fs = 'ext4';263 }264 else if(is_dir('/proc/fs/ext3/'))265 {266 $fs = 'ext3';267 }268 }269 break;270 case 'Case-sensitive Journaled HFS+':271 $fs = 'HFS+';272 break;273 case 'MS-DOS FAT32':274 $fs = 'FAT32';275 break;276 case 'UFSD_NTFS_COMPR':277 $fs = 'NTFS';278 break;279 case 'ecryptfs':280 if(isset(phodevi::$vfs->mounts))281 {282 // An easy attempt to determine what file-system is underneath ecryptfs if being compared283 // For now just attempt to figure out the root file-system.284 if(($s = strrpos(phodevi::$vfs->mounts, ' / ')) !== false)285 {286 $s = substr(phodevi::$vfs->mounts, ($s + 3));287 $s = substr($s, 0, strpos($s, ' '));288 if($s != null && !isset($s[18]) && $s != 'rootfs'&& pts_strings::string_only_contains($s, pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC))289 {290 $fs = $s . ' (ecryptfs)';291 }292 }293 }294 break;295 default:296 if(substr($fs, 0, 9) == 'UNKNOWN (')297 {298 $magic_block = substr($fs, 9, -1);299 $known_magic_blocks = array(300 '0x9123683e' => 'Btrfs',301 '0x2fc12fc1' => 'zfs', // KQ Infotech ZFS302 '0x482b' => 'HFS+',303 '0x65735546' => 'FUSE',304 '0x565a4653' => 'ReiserFS',305 '0x52345362' => 'Reiser4',306 '0x3434' => 'NILFS2',307 '0x5346414f' => 'OpenAFS',308 '0x47504653' => 'GPFS',309 '0x5941ff53' => 'YAFFS',310 '0xff534d42' => 'CIFS',311 '0x24051905' => 'UBIFS',312 '0x1021994' => 'TMPFS',313 '0x73717368' => 'SquashFS',314 '0xc97e8168' => 'LogFS',315 '0x5346544E' => 'NTFS',316 '0xf15f' => 'eCryptfs',317 '0x61756673' => 'AuFS',318 '0xbd00bd0' => 'Lustre',319 '0xaad7aaea' => 'PanFS', // Panasas FS320 '0xf2f52010' => 'F2FS',321 '0xc36400' => 'CephFS',322 '0xca451a4e' => 'BcacheFS'323 );324 foreach($known_magic_blocks as $hex => $name)325 {326 if($magic_block == $hex)327 {328 $fs = $name;329 break;330 }331 }332 }333 break;334 }335 if(strpos($fs, 'UNKNOWN') !== false && isset(phodevi::$vfs->mounts))336 {337 $mounts = phodevi::$vfs->mounts;338 $fs_r = array();339 $fs_checks = array(340 'squashfs' => 'SquashFS',341 'aufs' => 'AuFS',342 'unionfs' => 'UnionFS'343 );344 foreach($fs_checks as $fs_module => $fs_name)345 {346 if(strpos($mounts, $fs_module) != false)347 {348 array_push($fs_r, $fs_name);349 }350 }351 if(count($fs_r) > 0)352 {353 $fs = implode(' + ', $fs_r);354 }355 }356 }357 else if(phodevi::is_windows())358 {359 return null;360 }361 if(empty($fs))362 {363 $fs = 'Unknown';364 }365 return $fs;366 }367 public static function sw_virtualized_mode()368 {369 // Reports if system is running virtualized370 $virtualized = null;371 $mobo = phodevi::read_name('motherboard');372 $gpu = phodevi::read_name('gpu');373 $cpu = phodevi::read_property('cpu', 'model');374 if(strpos($cpu, 'QEMU') !== false || (is_readable('/sys/class/dmi/id/bios_vendor') && pts_file_io::file_get_contents('/sys/class/dmi/id/bios_vendor') == 'QEMU'))375 {376 $virtualized = 'QEMU';377 if(strpos($cpu, 'QEMU Virtual') !== false)378 {379 $qemu_version = substr($cpu, (strrpos($cpu, ' ') + 1));380 if(pts_strings::is_version($qemu_version))381 {382 $virtualized .= ' ' . $qemu_version;383 }384 }385 }386 else if(stripos($gpu, 'VMware') !== false || (is_readable('/sys/class/dmi/id/product_name') && stripos(pts_file_io::file_get_contents('/sys/class/dmi/id/product_name'), 'VMware') !== false))387 {388 $virtualized = 'VMware';389 }390 else if(stripos($gpu, 'VirtualBox') !== false || stripos(phodevi::read_name('motherboard'), 'VirtualBox') !== false)391 {392 $virtualized = 'VirtualBox';393 if($vbox_manage = pts_client::executable_in_path('VBoxManage'))394 {395 $vbox_manage = trim(shell_exec($vbox_manage . ' --version 2> /dev/null'));396 if(is_numeric(substr($vbox_manage, 0, 1)))397 {398 $virtualized .= ' ' . $vbox_manage;399 }400 }401 else if($modinfo = pts_client::executable_in_path('modinfo'))402 {403 $modinfo = trim(shell_exec('modinfo -F version vboxguest 2> /dev/null'));404 if($modinfo != null && pts_strings::is_version(str_ireplace(array('_', 'RC', 'beta'), null, $modinfo)))405 {406 $virtualized .= ' ' . $modinfo;407 }408 }409 }410 else if(is_file('/sys/class/dmi/id/sys_vendor') && pts_file_io::file_get_contents('/sys/class/dmi/id/sys_vendor') == 'Xen')411 {412 $virtualized = pts_file_io::file_get_contents('/sys/class/dmi/id/product_name');413 if(strpos($virtualized, 'Xen') === false)414 {415 $virtualized = 'Xen ' . $virtualized;416 }417 // version string418 $virtualized .= ' ' . pts_file_io::file_get_contents('/sys/class/dmi/id/product_version');419 // $virtualized should be then e.g. 'Xen HVM domU 4.1.1'420 }421 else if(stripos($gpu, 'Microsoft Hyper-V') !== false)422 {423 $virtualized = 'Microsoft Hyper-V Server';424 }425 else if(stripos($mobo, 'Parallels Software') !== false)426 {427 $virtualized = 'Parallels Virtualization';428 }429 else if(is_file('/sys/hypervisor/type'))430 {431 $type = pts_file_io::file_get_contents('/sys/hypervisor/type');432 $version = array();433 foreach(array('major', 'minor', 'extra') as $v)434 {435 if(is_file('/sys/hypervisor/version/' . $v))436 {437 $v = pts_file_io::file_get_contents('/sys/hypervisor/version/' . $v);438 }439 else440 {441 continue;442 }443 if($v != null)444 {445 if(!empty($version) && substr($v, 0, 1) != '.')446 {447 $v = '.' . $v;448 }449 array_push($version, $v);450 }451 }452 $virtualized = ucwords($type) . ' ' . implode('', $version) . ' Hypervisor';453 }454 if($systemd_virt = pts_client::executable_in_path('systemd-detect-virt'))455 {456 $systemd_virt = trim(shell_exec($systemd_virt . ' 2> /dev/null'));457 if($systemd_virt != null && $systemd_virt != 'none')458 {459 switch($systemd_virt)460 {461 case 'kvm':462 $systemd_virt = 'KVM';463 break;464 case 'oracle':465 $systemd_virt = 'Oracle';466 break;467 }468 if($virtualized != null && stripos($virtualized, $systemd_virt) === false && stripos($systemd_virt, $virtualized) === false)469 {470 $virtualized = $systemd_virt . ' ' . $virtualized;471 }472 else if($virtualized == null)473 {474 $virtualized = $systemd_virt;475 }476 }477 }478 return $virtualized;479 }480 public static function sw_environment_variables()481 {482 $check_variables = array('LIBGL', '__GL', 'DRI_');483 $to_report = array();484 if(stripos(phodevi::read_property('system', 'opengl-driver'), 'Mesa'))485 {486 array_push($check_variables, 'MESA', 'GALLIUM');487 }488 if(isset($_SERVER))489 {490 foreach($_SERVER as $name => &$value)491 {492 foreach($check_variables as $var)493 {494 if(stripos($name, $var) !== false && $name != '__GL_SYNC_TO_VBLANK')495 {496 array_push($to_report, $name . '=' . $value);497 break;498 }499 }500 }501 }502 return implode(' ', array_unique($to_report));503 }504 public static function sw_compiler()505 {506 // Returns version of the compiler (if present)507 $compilers = array();508 if($gcc = pts_client::executable_in_path('gcc'))509 {510 if(!is_link($gcc) || strpos(readlink($gcc), 'gcc') !== false)511 {512 // GCC513 // If it's a link, ensure that it's not linking to llvm/clang or something514 $version = trim(shell_exec('gcc -dumpversion 2>&1'));515 if(pts_strings::is_version($version))516 {517 $v = shell_exec('gcc -v 2>&1');518 if(($t = strrpos($v, $version . ' ')) !== false)519 {520 $v = substr($v, ($t + strlen($version) + 1));521 $v = substr($v, 0, strpos($v, ' '));522 if($v != null && is_numeric($v))523 {524 // On development versions the release date is expressed525 // e.g. gcc version 4.7.0 20120314 (prerelease) (GCC)526 $version .= ' ' . $v;527 }528 else529 {530 $v = shell_exec('gcc --version 2>&1');531 if(($t = strrpos($v, $version)) !== false)532 {533 $v = substr($v, $t);534 $v = substr($v, 0, strpos(str_replace(PHP_EOL, ' ', $v), ' '));535 if(($t = strpos($v, ')')) !== false)536 {537 $v = substr($v, 0, $t);538 }539 if(pts_strings::is_version($version))540 {541 $version = $v;542 }543 }544 }545 }546 $compilers['gcc'] = 'GCC ' . $version;547 }548 }549 }550 if(pts_client::executable_in_path('opencc'))551 {552 // Open64553 $compilers['opencc'] = 'Open64 ' . trim(shell_exec('opencc -dumpversion 2>&1'));554 }555 if(pts_client::executable_in_path('pathcc'))556 {557 // PathCC / EKOPath / PathScale Compiler Suite558 $compilers['pathcc'] = 'PathScale ' . trim(shell_exec('pathcc -dumpversion 2>&1'));559 }560 if(pts_client::executable_in_path('tcc'))561 {562 // TCC - Tiny C Compiler563 $tcc = explode(' ', trim(shell_exec('tcc -v 2>&1')));564 if($tcc[1] == 'version')565 {566 $compilers['opencc'] = 'TCC ' . $tcc[2];567 }568 }569 if(pts_client::executable_in_path('pcc'))570 {571 // PCC - Portable C Compiler572 $pcc = explode(' ', trim(shell_exec('pcc -version 2>&1')));573 if($pcc[0] == 'pcc')574 {575 $compilers['pcc'] = 'PCC ' . $pcc[1] . (is_numeric($pcc[2]) ? ' ' . $pcc[2] : null);576 }577 }578 if(pts_client::executable_in_path('pgcpp') || pts_client::executable_in_path('pgCC'))579 {580 // The Portland Group Compilers581 $compilers['pgcpp'] = 'PGI C-C++ Workstation';582 }583 if(pts_client::executable_in_path('clang'))584 {585 // Clang586 $compiler_info = shell_exec('clang --version 2> /dev/null');587 if(($cv_pos = stripos($compiler_info, 'clang version')) !== false)588 {589 // With Clang 3.0 and prior, the --version produces output where the first line is:590 // e.g. clang version 3.0 (branches/release_30 142590)591 $compiler_info = substr($compiler_info, ($cv_pos + 14));592 $clang_version = substr($compiler_info, 0, strpos($compiler_info, ' '));593 // XXX: the below check bypass now because e.g. Ubuntu appends '-ubuntuX', etc that breaks check594 if(pts_strings::is_version($clang_version) || true)595 {596 // Also see if there is a Clang SVN tag to fetch597 $compiler_info = substr($compiler_info, 0, strpos($compiler_info, PHP_EOL));598 if(($cv_pos = strpos($compiler_info, ')')) !== false)599 {600 $compiler_info = substr($compiler_info, 0, $cv_pos);601 $compiler_info = substr($compiler_info, (strrpos($compiler_info, ' ') + 1));602 if(is_numeric($compiler_info))603 {604 // Right now Clang/LLVM uses SVN system and their revisions are only numeric605 $clang_version .= ' (SVN ' . $compiler_info . ')';606 }607 }608 $compiler_info = 'Clang ' . $clang_version;609 }610 else611 {612 $compiler_info = null;613 }614 }615 else616 {617 $compiler_info = substr($compiler_info, 0, strpos($compiler_info, PHP_EOL));618 }619 // Clang620 if(empty($compiler_info) && stripos($compiler_info, 'not found'))621 {622 // At least with Clang ~3.0 the -dumpversion is reporting '4.2.1' ratherthan the useful information...623 // This is likely just for GCC command compatibility, so only use this as a fallback624 $compiler_info = 'Clang ' . trim(shell_exec('clang -dumpversion 2> /dev/null'));625 }626 $compilers['clang'] = $compiler_info;627 }628 if(($llvm_ld = pts_client::executable_in_path('llvm-link')) || ($llvm_ld = pts_client::executable_in_path('llvm-ld')))629 {630 // LLVM - Low Level Virtual Machine631 // Reading the version from llvm-ld (the LLVM linker) should be safe as well for finding out version of LLVM in use632 // As of LLVM 3.2svn, llvm-ld seems to be llvm-link633 $info = trim(shell_exec($llvm_ld . ' -version 2> /dev/null'));634 if(($s = strpos($info, 'version')) != false)635 {636 $info = substr($info, 0, strpos($info, PHP_EOL, $s));637 $info = substr($info, (strrpos($info, ' ') + 1));638 if(pts_strings::is_version(str_replace('svn', null, $info)))639 {640 $compilers['llvmc'] = 'LLVM ' . $info;641 }642 }643 }644 else if(pts_client::executable_in_path('llvm-config'))645 {646 // LLVM - Low Level Virtual Machine config647 $info = trim(shell_exec('llvm-config --version 2> /dev/null'));648 if(pts_strings::is_version(str_replace('svn', null, $info)))649 {650 $compilers['llvmc'] = 'LLVM ' . $info;651 }652 }653 else if(pts_client::executable_in_path('llvmc'))654 {655 // LLVM - Low Level Virtual Machine (llvmc)656 $info = trim(shell_exec('llvmc -version 2>&1'));657 if(($s = strpos($info, 'version')) != false)658 {659 $info = substr($info, 0, strpos($info, "\n", $s));660 $info = substr($info, strrpos($info, "\n"));661 $compilers['llvmc'] = trim($info);662 }663 }664 if(pts_client::executable_in_path('suncc'))665 {666 // Sun Studio / SunCC667 $info = trim(shell_exec('suncc -V 2>&1'));668 if(($s = strpos($info, 'Sun C')) != false)669 {670 $info = substr($info, $s);671 $info = substr($info, 0, strpos($info, "\n"));672 $compilers['suncc'] = $info;673 }674 }675 if(pts_client::executable_in_path('ioc'))676 {677 // Intel Offline Compiler (IOC) SDK for OpenCL678 // -v e.g. : Intel(R) SDK for OpenCL* - Offline Compiler 2012 Command-Line Client, version 1.0.2679 $info = trim(shell_exec('ioc -version 2>&1')) . ' ';680 if(($s = strpos($info, 'Offline Compiler ')) != false)681 {682 $compilers['ioc'] = 'Intel IOC SDK';683 $sv = substr($info, ($s + 17));684 $sv = substr($sv, 0, strpos($sv, ' '));685 if(is_numeric($sv))686 {687 $compilers['ioc'] .= ' ' . $sv;688 }689 if(($s = strpos($info, 'version ')) != false)690 {691 $sv = substr($info, ($s + 8));692 $sv = substr($sv, 0, strpos($sv, ' '));693 if(pts_strings::is_version($sv))694 {695 $compilers['ioc'] .= ' v' . $sv;696 }697 }698 }699 }700 if(pts_client::executable_in_path('icc'))701 {702 // Intel C++ Compiler703 $compilers['icc'] = 'ICC';704 }705 if(phodevi::is_macosx() && pts_client::executable_in_path('xcodebuild'))706 {707 $xcode = phodevi_osx_parser::read_osx_system_profiler('SPDeveloperToolsDataType', 'Xcode');708 $xcode = substr($xcode, 0, strpos($xcode, ' '));709 if($xcode)710 {711 $compilers['Xcode'] = 'Xcode ' . $xcode;712 }713 }714 if(($nvcc = pts_client::executable_in_path('nvcc')) || is_executable(($nvcc = '/usr/local/cuda/bin/nvcc')))715 {716 // Check outside of PATH too since by default the CUDA Toolkit goes to '/usr/local/cuda/' and relies upon user to update system717 // NVIDIA CUDA Compiler Driver718 $nvcc = shell_exec($nvcc . ' --version 2>&1');719 if(($s = strpos($nvcc, 'release ')) !== false)720 {721 $nvcc = str_replace(array(','), null, substr($nvcc, ($s + 8)));722 $nvcc = substr($nvcc, 0, strpos($nvcc, ' '));723 if(pts_strings::is_version($nvcc))724 {725 $compilers['CUDA'] = 'CUDA ' . $nvcc;726 }727 }728 }729 // Try to make the compiler that's used by default to appear first730 if(pts_client::read_env('CC') && isset($compilers[basename(pts_strings::first_in_string(pts_client::read_env('CC'), ' '))]))731 {732 $cc_env = basename(pts_strings::first_in_string(pts_client::read_env('CC'), ' '));733 $default_compiler = $compilers[$cc_env];734 unset($compilers[$cc_env]);735 array_unshift($compilers, $default_compiler);736 }737 else if(pts_client::executable_in_path('cc') && is_link(pts_client::executable_in_path('cc')))738 {739 $cc_link = basename(readlink(pts_client::executable_in_path('cc')));740 if(isset($compilers[$cc_link]))741 {742 $default_compiler = $compilers[$cc_link];743 unset($compilers[pts_client::read_env('CC')]);744 array_unshift($compilers, $default_compiler);745 }746 }747 return implode(' + ', array_unique($compilers));748 }749 public static function sw_kernel_string()750 {751 return trim(phodevi::read_property('system', 'kernel') . ' (' . phodevi::read_property('system', 'kernel-architecture') . ') ' . phodevi::read_property('system', 'kernel-date'));752 }753 public static function sw_kernel_date()754 {755 $date = null;756 $k = phodevi::read_property('system', 'kernel');757 if(strpos($k, '99') !== false || stripos($k, 'rc') !== false)758 {759 // For now at least only report kernel build date when it looks like it's a devel kernel760 $v = php_uname('v');761 if(($x = stripos($v, 'SMP ')) !== false)762 {763 $v = substr($v, ($x + 4));764 $date = strtotime($v);765 if($date != false)766 {767 $date = date('Ymd', $date);768 }769 }770 }771 return $date;772 }773 public static function sw_kernel()774 {775 return php_uname('r');776 }777 public static function sw_kernel_parameters()778 {779 $parameters = null;780 if(is_file('/proc/cmdline') && is_file('/proc/modules'))781 {782 $modules = array();783 foreach(explode(PHP_EOL, pts_file_io::file_get_contents('/proc/modules')) as $module_line)784 {785 $module_line = explode(' ', $module_line);786 if(isset($module_line[0]) && !empty($module_line[0]))787 {788 array_push($modules, $module_line[0]);789 }790 }791 if(!empty($modules))792 {793 $to_report = array();794 $cmdline = explode(' ', pts_file_io::file_get_contents('/proc/cmdline'));795 foreach($cmdline as $option)796 {797 if(($t = strpos($option, '.')) !== false)798 {799 if(in_array(substr($option, 0, $t), $modules))800 {801 array_push($to_report, $option);802 }803 }804 }805 if(!empty($to_report))806 {807 $parameters = implode(' ', $to_report);808 }809 }810 }811 return $parameters;812 }813 public static function sw_kernel_architecture()814 {815 // Find out the kernel archiecture816 if(phodevi::is_windows())817 {818 //$kernel_arch = strpos($_SERVER['PROCESSOR_ARCHITECTURE'], 64) !== false || strpos($_SERVER['PROCESSOR_ARCHITEW6432'], 64 != false) ? 'x86_64' : 'i686';819 if(isset($_SERVER['PROCESSOR_ARCHITEW6432']))820 {821 $kernel_arch = $_SERVER['PROCESSOR_ARCHITEW6432'] == 'AMD64' ? 'x86_64' : 'i686';822 }823 else824 {825 $kernel_arch = 'x86_64';826 }827 }828 else829 {830 $kernel_arch = php_uname('m');831 switch($kernel_arch)832 {833 case 'X86-64':834 case 'amd64':835 $kernel_arch = 'x86_64';836 break;837 case 'i86pc':838 case 'i586':839 case 'i686-AT386':840 $kernel_arch = 'i686';841 break;842 }843 }844 return $kernel_arch;845 }846 public static function sw_os_version()847 {848 // Returns OS version849 if(phodevi::is_macosx())850 {851 $os = phodevi_osx_parser::read_osx_system_profiler('SPSoftwareDataType', 'SystemVersion');852 853 $start_pos = strpos($os, '.');854 $end_pos = strrpos($os, '.');855 $start_pos = strrpos(substr($os, 0, $start_pos), ' ');856 $end_pos = strpos($os, ' ', $end_pos);857 858 $os_version = substr($os, $start_pos + 1, $end_pos - $start_pos);859 }860 else if(phodevi::is_linux())861 {862 $os_version = phodevi_linux_parser::read_lsb('Release');863 if($os_version == null)864 {865 if(is_readable('/etc/os-release'))866 $os_release = parse_ini_file('/etc/os-release');867 else if(is_readable('/usr/lib/os-release'))868 $os_release = parse_ini_file('/usr/lib/os-release');869 else870 $os_release = null;871 if(isset($os_release['VERSION_ID']) && !empty($os_release['VERSION_ID']))872 {873 $os_version = $os_release['VERSION_ID'];874 }875 else if(isset($os_release['VERSION']) && !empty($os_release['VERSION']))876 {877 $os_version = $os_release['VERSION'];878 }879 $os_version = pts_strings::keep_in_string($os_version, pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DECIMAL | pts_strings::CHAR_SPACE | pts_strings::CHAR_DASH | pts_strings::CHAR_UNDERSCORE);880 }881 }882 else883 {884 $os_version = php_uname('r');885 }886 887 return $os_version;888 }889 public static function sw_operating_system()890 {891 if(!PTS_IS_CLIENT)892 {893 // TODO: Figure out why this function is sometimes called from OpenBenchmarking.org....894 return false;895 }896 // Determine the operating system release897 if(phodevi::is_linux())898 {899 $vendor = phodevi_linux_parser::read_lsb_distributor_id();900 if($vendor == null)901 {902 if(is_readable('/etc/os-release'))903 $os_release = parse_ini_file('/etc/os-release');904 else if(is_readable('/usr/lib/os-release'))905 $os_release = parse_ini_file('/usr/lib/os-release');906 else907 $os_release = null;908 if(isset($os_release['PRETTY_NAME']) && !empty($os_release['PRETTY_NAME']))909 {910 $vendor = $os_release['PRETTY_NAME'];911 }912 else if(isset($os_release['NAME']) && !empty($os_release['NAME']))913 {914 $vendor = $os_release['NAME'];915 }916 }917 if(($x = stripos($vendor, ' for ')) !== false)918 {919 $vendor = substr($vendor, 0, $x);920 }921 $vendor = str_replace(array(' Software'), null, $vendor);922 }923 else if(phodevi::is_hurd())924 {925 $vendor = php_uname('v');926 }927 else928 {929 $vendor = null;930 }931 $version = phodevi::read_property('system', 'os-version');932 if(!$vendor)933 {934 $os = null;935 // Try to detect distro for those not supplying lsb_release936 $files = pts_file_io::glob('/etc/*-version');937 for($i = 0; $i < count($files) && $os == null; $i++)938 {939 $file = file_get_contents($files[$i]);940 if(trim($file) != null)941 {942 $os = substr($file, 0, strpos($file, "\n"));943 }944 }945 946 if($os == null)947 {948 $files = pts_file_io::glob('/etc/*-release');949 for($i = 0; $i < count($files) && $os == null; $i++)950 {951 $file = file_get_contents($files[$i]);952 if(trim($file) != null)953 {954 $proposed_os = substr($file, 0, strpos($file, PHP_EOL));955 if(strpos($proposed_os, '=') == false)956 {957 $os = $proposed_os;958 }959 }960 else if($i == (count($files) - 1))961 {962 $os = ucwords(substr(($n = basename($files[$i])), 0, strpos($n, '-')));963 } 964 }965 }966 if($os == null && is_file('/etc/release'))967 {968 $file = file_get_contents('/etc/release');969 $os = substr($file, 0, strpos($file, "\n"));970 }971 if($os == null && is_file('/etc/palm-build-info'))972 {973 // Palm / webOS Support974 $os = phodevi_parser::parse_equal_delimited_file('/etc/palm-build-info', 'PRODUCT_VERSION_STRING');975 }976 if($os == null)977 {978 if(phodevi::is_windows())979 {980 $os = trim(exec('ver'));981 }982 if(is_file('/etc/debian_version'))983 {984 $os = 'Debian ' . php_uname('s') . ' ' . ucwords(pts_file_io::file_get_contents('/etc/debian_version'));985 }986 else987 {988 $os = php_uname('s');989 }990 }991 else if(strpos($os, ' ') === false)992 {993 // The OS string is only one word, likely a problem...994 if(is_file('/etc/arch-release') && stripos($os, 'Arch') === false)995 {996 // On at least some Arch installs (ARM) the file is empty so would have missed above check997 $os = trim('Arch Linux ' . $os);998 }999 }1000 }1001 else if(stripos($vendor, $version) === false)1002 {1003 $os = $vendor . ' ' . $version;1004 }1005 else1006 {1007 $os = $vendor;1008 }1009 if(($break_point = strpos($os, ':')) > 0)1010 {1011 $os = substr($os, $break_point + 1);1012 }1013 1014 if(phodevi::is_macosx())1015 {1016 $os = phodevi_osx_parser::read_osx_system_profiler('SPSoftwareDataType', 'SystemVersion');1017 }1018 if(($break_point = strpos($os, '(')) > 0)1019 {1020 $os = substr($os, 0, $break_point);1021 }1022 $os = trim($os);1023 return $os;1024 }1025 public static function sw_desktop_environment()1026 {1027 $desktop = null;1028 $desktop_environment = null;1029 $desktop_version = null;1030 $desktop_session = pts_client::read_env('DESKTOP_SESSION');1031 if(pts_client::is_process_running('gnome-shell'))1032 {1033 // GNOME 3.0 / GNOME Shell1034 $desktop_environment = 'GNOME Shell';1035 if(pts_client::executable_in_path('gnome-shell'))1036 {1037 $desktop_version = pts_strings::last_in_string(trim(shell_exec('gnome-shell --version 2> /dev/null')));1038 }1039 }1040 else if(pts_client::is_process_running('gnome-panel') || $desktop_session == 'gnome')1041 {1042 // GNOME1043 $desktop_environment = 'GNOME';1044 if(pts_client::executable_in_path('gnome-about'))1045 {1046 $desktop_version = pts_strings::last_in_string(trim(shell_exec('gnome-about --version 2> /dev/null')));1047 }1048 else if(pts_client::executable_in_path('gnome-session'))1049 {1050 $desktop_version = pts_strings::last_in_string(trim(shell_exec('gnome-session --version 2> /dev/null')));1051 }1052 }1053 else if(pts_client::is_process_running('unity-2d-panel') || $desktop_session == 'ubuntu-2d')1054 {1055 // Canonical / Ubuntu Unity 2D Desktop1056 $desktop_environment = 'Unity 2D';1057 if(pts_client::executable_in_path('unity'))1058 {1059 $desktop_version = pts_strings::last_in_string(trim(shell_exec('unity --version 2> /dev/null')));1060 }1061 }1062 else if(pts_client::is_process_running('unity-panel-service') || $desktop_session == 'ubuntu')1063 {1064 // Canonical / Ubuntu Unity Desktop1065 $desktop_environment = 'Unity';1066 if(pts_client::executable_in_path('unity'))1067 {1068 $desktop_version = pts_strings::last_in_string(trim(shell_exec('unity --version 2> /dev/null')));1069 }1070 }1071 else if($desktop_session == 'mate')1072 {1073 $desktop_environment = 'MATE';1074 if(pts_client::executable_in_path('mate-about'))1075 {1076 $desktop_version = pts_strings::last_in_string(trim(shell_exec('mate-about --version 2> /dev/null')));1077 }1078 }1079 else if(($kde5 = pts_client::is_process_running('kded5')))1080 {1081 // KDE 5.x1082 $desktop_environment = 'KDE Frameworks 5';1083 $desktop_version = null; // TODO XXX1084 }1085 else if(($dde = pts_client::is_process_running('dde-desktop')))1086 {1087 // KDE 5.x1088 $desktop_environment = 'Deepin Desktop Environment';1089 $desktop_version = null; // TODO XXX1090 }1091 else if(($kde4 = pts_client::is_process_running('kded4')) || pts_client::is_process_running('kded'))1092 {1093 // KDE 4.x1094 $desktop_environment = 'KDE';1095 $kde_output = trim(shell_exec(($kde4 ? 'kde4-config' : 'kde-config') . ' --version 2>&1'));1096 $kde_lines = explode("\n", $kde_output);1097 for($i = 0; $i < count($kde_lines) && empty($desktop_version); $i++)1098 {1099 $line_segments = pts_strings::colon_explode($kde_lines[$i]);1100 if(in_array($line_segments[0], array('KDE', 'KDE Development Platform')) && isset($line_segments[1]))1101 {1102 $v = trim($line_segments[1]);1103 if(($cut = strpos($v, ' ')) > 0)1104 {1105 $v = substr($v, 0, $cut);1106 }1107 $desktop_version = $v;1108 }1109 }1110 }1111 else if(pts_client::is_process_running('chromeos-wm'))1112 {1113 $chrome_output = trim(shell_exec('chromeos-wm -version'));1114 if($chrome_output == 'chromeos-wm')1115 {1116 // No version actually reported1117 $chrome_output = 'Chrome OS';1118 }1119 $desktop_environment = $chrome_output;1120 }1121 else if(pts_client::is_process_running('lxsession') || $desktop_session == 'lxde')1122 {1123 $lx_output = trim(shell_exec('lxpanel --version'));1124 $version = substr($lx_output, strpos($lx_output, ' ') + 1);1125 $desktop_environment = 'LXDE';1126 $desktop_version = $version;1127 }1128 else if(pts_client::is_process_running('xfce4-session') || pts_client::is_process_running('xfce-mcs-manager') || $desktop_session == 'xfce')1129 {1130 // Xfce 4.x1131 $desktop_environment = 'Xfce';1132 $xfce_output = trim(shell_exec('xfce4-session-settings --version 2>&1'));1133 if(($open = strpos($xfce_output, '(Xfce')) > 0)1134 {1135 $xfce_output = substr($xfce_output, strpos($xfce_output, ' ', $open) + 1);1136 $desktop_version = substr($xfce_output, 0, strpos($xfce_output, ')'));1137 }1138 }1139 else if(pts_client::is_process_running('sugar-session'))1140 {1141 // Sugar Desktop Environment (namely for OLPC)1142 $desktop_environment = 'Sugar';1143 $desktop_version = null; // TODO: where can the Sugar version be figured out?1144 }1145 else if(pts_client::is_process_running('openbox'))1146 {1147 $desktop_environment = 'Openbox';1148 $openbox_output = trim(shell_exec('openbox --version 2>&1'));1149 if(($openbox_d = stripos($openbox_output, 'Openbox ')) !== false)1150 {1151 $openbox_output = substr($openbox_output, ($openbox_d + 8));1152 $desktop_version = substr($openbox_output, 0, strpos($openbox_output, PHP_EOL));1153 }1154 }1155 else if(pts_client::is_process_running('cinnamon'))1156 {1157 $desktop_environment = 'Cinnamon';1158 $desktop_version = pts_strings::last_in_string(trim(shell_exec('cinnamon --version 2> /dev/null')));1159 }1160 else if(pts_client::is_process_running('enlightenment'))1161 {1162 $desktop_environment = 'Enlightenment';1163 $desktop_version = null; // No known -v / --version command on any Enlightenment component1164 }1165 else if(pts_client::is_process_running('consort-panel'))1166 {1167 $desktop_environment = 'Consort';1168 $desktop_version = null; // TODO: Haven't tested Consort Desktop yet1169 }1170 else if(pts_client::is_process_running('razor-desktop'))1171 {1172 $desktop_environment = 'Razor-qt';1173 $desktop_version = null; // TODO: Figure out how to determine razor version1174 }1175 else if(pts_client::is_process_running('icewm'))1176 {1177 $desktop_environment = 'IceWM';1178 $desktop_version = null;1179 }1180 if(!empty($desktop_environment))1181 {1182 $desktop = $desktop_environment;1183 if(!empty($desktop_version) && pts_strings::is_version($desktop_version))1184 {1185 $desktop .= ' ' . $desktop_version;1186 }1187 }1188 return $desktop;1189 }1190 public static function sw_display_server()1191 {1192 $display_servers = array();1193 if(phodevi::is_windows())1194 {1195 // TODO: determine what to do for Windows support1196 }1197 else1198 {1199 if(pts_client::is_process_running('weston'))1200 {1201 $info = 'Wayland Weston';1202 $vinfo = trim(shell_exec('weston --version 2>&1'));1203 if(pts_strings::last_in_string($vinfo) && pts_strings::is_version(pts_strings::last_in_string($vinfo)))1204 {1205 $info .= ' ' . pts_strings::last_in_string($vinfo);1206 }1207 array_push($display_servers, $info);1208 }1209 if(pts_client::is_process_running('unity-system-compositor'))1210 {1211 $unity_system_comp = trim(str_replace('unity-system-compositor', null, shell_exec('unity-system-compositor --version 2>&1')));1212 if(pts_strings::is_version($unity_system_comp))1213 {1214 array_push($display_servers, 'Unity-System-Compositor ' . $unity_system_comp);1215 }1216 }1217 if(($x_bin = (is_executable('/usr/libexec/Xorg.bin') ? '/usr/libexec/Xorg.bin' : false)) || ($x_bin = pts_client::executable_in_path('Xorg')) || ($x_bin = pts_client::executable_in_path('X')))1218 {1219 // Find graphics subsystem version1220 $info = shell_exec($x_bin . ' ' . (phodevi::is_solaris() ? ':0' : '') . ' -version 2>&1');1221 $pos = (($p = strrpos($info, 'Release Date')) !== false ? $p : strrpos($info, 'Build Date'));1222 $info = trim(substr($info, 0, $pos));1223 if($pos === false || getenv('DISPLAY') == false)1224 {1225 $info = null;1226 }1227 else if(($pos = strrpos($info, '(')) === false)1228 {1229 $info = trim(substr($info, strrpos($info, ' ')));1230 }1231 else1232 {1233 $info = trim(substr($info, strrpos($info, 'Server') + 6));1234 }1235 if($info != null)1236 {1237 array_push($display_servers, 'X Server ' . $info);1238 }1239 }1240 if(pts_client::is_process_running('surfaceflinger'))1241 {1242 array_push($display_servers, 'SurfaceFlinger');1243 }1244 if(pts_client::is_process_running('gnome-shell-wayland'))1245 {1246 array_push($display_servers, 'GNOME Shell Wayland');1247 }1248 if(empty($display_servers) && getenv('WAYLAND_DISPLAY') != false)1249 {1250 array_push($display_servers, 'Wayland');1251 }1252 }1253 return implode(' + ', $display_servers);1254 }1255 public static function sw_display_driver($with_version = true)1256 {1257 if(phodevi::is_windows())1258 {1259 return null;1260 }1261 $display_driver = phodevi::read_property('system', 'dri-display-driver');1262 if(empty($display_driver))1263 {1264 if(phodevi::is_ati_graphics() && phodevi::is_linux())1265 {1266 $display_driver = 'fglrx';1267 }1268 else if(phodevi::is_nvidia_graphics() || is_file('/proc/driver/nvidia/version'))1269 {1270 $display_driver = 'nvidia';1271 }1272 else if((phodevi::is_mesa_graphics() || phodevi::is_bsd()) && stripos(phodevi::read_property('gpu', 'model'), 'NVIDIA') !== false)1273 {1274 if(is_file('/sys/class/drm/version'))1275 {1276 // If there's DRM loaded and NVIDIA, it should be Nouveau1277 $display_driver = 'nouveau';1278 }1279 else1280 {1281 // The dead xf86-video-nv doesn't use any DRM1282 $display_driver = 'nv';1283 }1284 }1285 else1286 {1287 // Fallback to hopefully detect the module, takes the first word off the GPU string and sees if it is the module1288 // This works in at least the case of the Cirrus driver1289 $display_driver = strtolower(pts_strings::first_in_string(phodevi::read_property('gpu', 'model')));1290 }1291 }1292 if(!empty($display_driver))1293 {1294 $driver_version = phodevi_parser::read_xorg_module_version($display_driver . '_drv');1295 if($driver_version == false || $driver_version == '1.0.0')1296 {1297 switch($display_driver)1298 {1299 case 'amd':1300 // See if it's radeon driver1301 $driver_version = phodevi_parser::read_xorg_module_version('radeon_drv');1302 if($driver_version != false)1303 {1304 $display_driver = 'radeon';1305 }1306 // See if it's the newer AMDGPU driver1307 $driver_version = phodevi_parser::read_xorg_module_version('amdgpu_drv');1308 if($driver_version != false)1309 {1310 $display_driver = 'amdgpu';1311 }1312 break;1313 case 'vmwgfx':1314 // See if it's VMware driver1315 $driver_version = phodevi_parser::read_xorg_module_version('vmware_drv');1316 if($driver_version != false)1317 {1318 $display_driver = 'vmware';1319 }1320 break;1321 case 'radeon':1322 // RadeonHD driver also reports DRI driver as 'radeon', so try reading that instead1323 $driver_version = phodevi_parser::read_xorg_module_version('radeonhd_drv');1324 if($driver_version != false)1325 {1326 $display_driver = 'radeonhd';1327 }1328 $driver_version = phodevi_parser::read_xorg_module_version('amdgpu_drv');1329 if($driver_version != false)1330 {1331 $display_driver = 'amdgpu';1332 }1333 break;1334 case 'nvidia':1335 case 'NVIDIA':1336 case 'nouveau':1337 // NVIDIA's binary driver usually ends up reporting 1.0.01338 if(($nvs_value = phodevi_parser::read_nvidia_extension('NvidiaDriverVersion')))1339 {1340 $display_driver = 'NVIDIA';1341 $driver_version = $nvs_value;1342 }1343 else1344 {1345 // NVIDIA's binary driver appends their driver version on the end of the OpenGL version string1346 $glxinfo = phodevi_parser::software_glxinfo_version();1347 if(($pos = strpos($glxinfo, 'NVIDIA ')) != false)1348 {1349 $display_driver = 'NVIDIA';1350 $driver_version = substr($glxinfo, ($pos + 7));1351 }1352 }1353 break;1354 default:1355 if(is_readable('/sys/class/graphics/fb0/name'))1356 {1357 // This path works for at least finding NVIDIA Tegra 2 DDX (via tegra_fb)1358 $display_driver = file_get_contents('/sys/class/graphics/fb0/name');1359 $display_driver = str_replace(array('drm', '_fb'), null, $display_driver);1360 $driver_version = phodevi_parser::read_xorg_module_version($display_driver . '_drv');1361 }1362 break;1363 }1364 }1365 if($driver_version == false)1366 {1367 // If the version is empty, chances are the DDX driver string is incorrect1368 $display_driver = null;1369 // See if the VESA or fbdev driver is in use1370 foreach(array('modesetting', 'fbdev', 'vesa') as $drv)1371 {1372 $drv_version = phodevi_parser::read_xorg_module_version($drv . '_drv');1373 if($drv_version)1374 {1375 $display_driver = $drv;1376 $driver_version = $drv_version;1377 break;1378 }1379 }1380 }1381 if(!empty($driver_version) && $with_version && $driver_version != '0.0.0')1382 {1383 $display_driver .= ' ' . $driver_version;1384 // XXX: The below check is disabled since the Catalyst Version no longer seems reliably reported (circa Catalyst 13.x)1385 if(false && phodevi::is_ati_graphics() && strpos($display_driver, 'fglrx') !== false)1386 {1387 $catalyst_version = phodevi_linux_parser::read_amd_pcsdb('AMDPCSROOT/SYSTEM/LDC,Catalyst_Version');1388 if($catalyst_version != null && $catalyst_version > 10.1 && $catalyst_version != 10.5 && $catalyst_version != 11.8)1389 {1390 // This option was introduced around Catalyst 10.5 but seems to not be updated properly until Catalyst 10.11/10.121391 $display_driver .= ' Catalyst ' . $catalyst_version . '';1392 }1393 }1394 }1395 }1396 return $display_driver;1397 }1398 public static function sw_opengl_driver()1399 {1400 // OpenGL version1401 $info = null;1402 if(phodevi::is_windows())1403 {1404 $info = null; // TODO: Windows support1405 }1406 else if(pts_client::executable_in_path('nvidia-settings'))1407 {1408 $info = phodevi_parser::read_nvidia_extension('OpenGLVersion');1409 }1410 if($info == null)1411 {1412 $info = phodevi_parser::software_glxinfo_version();1413 if($info && ($pos = strpos($info, ' ')) != false && strpos($info, 'Mesa') === false)1414 {1415 $info = substr($info, 0, $pos);1416 }1417 $renderer = phodevi_parser::read_glx_renderer();1418 if($renderer && ($s = strpos($renderer, 'Gallium')) !== false)1419 {1420 $gallium = substr($renderer, $s);1421 $gallium = substr($gallium, 0, strpos($gallium, ' ', strpos($gallium, '.')));1422 $info .= ' ' . $gallium . '';1423 }1424 if($renderer && ($s = strpos($renderer, 'LLVM ')) !== false)1425 {1426 $llvm = substr($renderer, $s);1427 $llvm = substr($llvm, 0, strpos($llvm, ')'));1428 $info .= ' (' . $llvm . ')';1429 }1430 }1431 return $info;1432 }1433 public static function sw_vulkan_driver()1434 {1435 // Vulkan driver/version1436 $info = null;1437 if(isset(phodevi::$vfs->vulkaninfo))1438 {1439 if(($pos = strpos(phodevi::$vfs->vulkaninfo, 'Vulkan API Version:')) !== false)1440 {1441 $info = substr(phodevi::$vfs->vulkaninfo, $pos + 20);1442 $info = trim(substr($info, 0, strpos($info, "\n")));1443 }1444 }1445 if($info == null)1446 {1447 // A less than ideal fallback for some detection now1448 foreach(array_merge(pts_file_io::glob('/etc/vulkan/icd.d/*.json'), pts_file_io::glob('/usr/share/vulkan/icd.d/*.json')) as $icd_json)1449 {1450 $icd_json = json_decode(file_get_contents($icd_json), true);1451 if(isset($icd_json['ICD']['api_version']) && !empty($icd_json['ICD']['api_version']))1452 {1453 $info = trim($icd_json['ICD']['api_version']);1454 break;1455 }1456 }1457 }1458 return $info;1459 }1460 public static function sw_opencl_driver()1461 {1462 // OpenCL driver/version1463 $info = array();1464 if(isset(phodevi::$vfs->clinfo))1465 {1466 $sea = phodevi::$vfs->clinfo;1467 while(($pos = strpos($sea, 'Platform Version')) != false)1468 {1469 $sea = substr($sea, $pos + 18);1470 $info[] = trim(substr($sea, 0, strpos($sea, "\n")));1471 }1472 }1473 return implode(' + ', $info);1474 }1475 public static function sw_opengl_vendor()1476 {1477 // OpenGL version1478 $info = null;1479 if(pts_client::executable_in_path('glxinfo'))1480 {1481 $info = shell_exec('glxinfo 2>&1 | grep vendor');1482 if(($pos = strpos($info, 'OpenGL vendor string:')) !== false)1483 {1484 $info = substr($info, $pos + 22);1485 $info = trim(substr($info, 0, strpos($info, "\n")));1486 }1487 }1488 else if(is_readable('/dev/nvidia0'))1489 {...

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1$phodevi = new phodevi_system();2$phodevi->load_module('sw_opengl_vendor');3$phodevi->load_module('sw_opengl_renderer');4$phodevi->load_module('sw_opengl_version');5$phodevi->load_module('sw_opengl_extensions');6$phodevi->load_module('sw_opengl_shading_language_version');7$phodevi->load_module('sw_opengl_shading_language_extensions');8$phodevi->load_module('sw_opengl_shading_language_vendor');9$phodevi->load_module('sw_opengl_shading_language_renderer');10$phodevi->load_module('sw_opengl_shading_language_version');11$phodevi->load_module('sw_opengl_shading_language_extensions');12$phodevi->load_module('sw_opengl_shading_language_vendor');13$phodevi->load_module('sw_opengl_shading_language_renderer');14$phodevi->load_module('sw_opengl_shading_language_version');15$phodevi->load_module('sw_opengl_shading_language_extensions');16$phodevi->load_module('sw_opengl_shading_language_vendor');17$phodevi->load_module('sw_opengl_shading_language_renderer');18$phodevi->load_module('sw_opengl_shading_language_version');19$phodevi->load_module('sw_opengl_shading_language_extensions');20$phodevi->load_module('sw_opengl_shading_language_vendor');21$phodevi->load_module('sw_opengl_shading_language_renderer');22$phodevi->load_module('sw_opengl_shading_language_version');23$phodevi->load_module('sw_opengl_shading_language_extensions');24$phodevi->load_module('sw_opengl_shading_language_vendor');25$phodevi->load_module('sw_opengl_shading_language_renderer');26$phodevi->load_module('sw_opengl_shading_language_version');27$phodevi->load_module('sw_opengl_shading_language_extensions');28$phodevi->load_module('sw_opengl_shading_language_vendor');29$phodevi->load_module('sw_opengl_shading_language_renderer');30$phodevi->load_module('sw_opengl_shading_language_version');31$phodevi->load_module('sw_opengl_shading_language_extensions');32$phodevi->load_module('sw_opengl_shading_language_vendor');

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1include_once('/usr/share/php/phodevi/system.php');2$vendor = phodevi_system::sw_opengl_vendor();3";4include_once('/usr/share/php/phodevi/system.php');5$renderer = phodevi_system::sw_opengl_renderer();6";7include_once('/usr/share/php/phodevi/system.php');8$version = phodevi_system::sw_opengl_version();9";10include_once('/usr/share/php/phodevi/system.php');11$shading_language = phodevi_system::sw_opengl_shading_language_version();12";13include_once('/usr/share/php/phodevi/system.php');14$extensions = phodevi_system::sw_opengl_extensions();15";16include_once('/usr/share/php/phodevi/system.php');17$extensions = phodevi_system::sw_opengl_extensions();18";19include_once('/usr/share/php/phodevi/system.php');20$extensions = phodevi_system::sw_opengl_extensions();21";22include_once('/usr/share/php/phodevi/system.php');23$extensions = phodevi_system::sw_opengl_extensions();24";25include_once('/usr/share/php/phodevi/system.php');26$extensions = phodevi_system::sw_opengl_extensions();

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1require_once("phodevi_system.php");2$phodevi = new phodevi_system();3$vendor = $phodevi->sw_opengl_vendor();4";5require_once("phodevi_system.php");6$phodevi = new phodevi_system();7$renderer = $phodevi->sw_opengl_renderer();8";9require_once("phodevi_system.php");10$phodevi = new phodevi_system();11$version = $phodevi->sw_opengl_version();12";13require_once("phodevi_system.php");14$phodevi = new phodevi_system();15$extensions = $phodevi->sw_opengl_extensions();16";17require_once("phodevi_system.php");18$phodevi = new phodevi_system();19$slv = $phodevi->sw_opengl_shading_language_version();20";21require_once("phodevi_system.php");22$phodevi = new phodevi_system();23$extensions = $phodevi->sw_opengl_extensions();24";25require_once("phodevi_system.php");26$phodevi = new phodevi_system();27$extensions = $phodevi->sw_opengl_extensions();28";29require_once("phodevi_system.php");30$phodevi = new phodevi_system();

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1echo 'OpenGL vendor: ' . phodevi::read_property('system', 'sw_opengl_vendor');2echo 'OpenGL version: ' . phodevi::read_property('system', 'sw_opengl_version');3echo 'OpenGL extensions: ' . phodevi::read_property('system', 'sw_opengl_extensions');4echo 'OpenGL shading language: ' . phodevi::read_property('system', 'sw_opengl_shading_language');5echo 'OpenGL renderer: ' . phodevi::read_property('system', 'sw_opengl_renderer');6echo 'OpenGL rendering: ' . phodevi::read_property('system', 'sw_opengl_rendering');7echo 'OpenGL rendering: ' . phodevi::read_property('system', 'sw_opengl_rendering');8echo 'OpenGL rendering: ' . phodevi::read_property('system', 'sw_opengl_rendering');9echo 'OpenGL rendering: ' . phodevi::read_property('system', 'sw_opengl_rendering');

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1require_once 'phodevi.php';2$vendor = phodevi::system_software_opengl_vendor();3echo $vendor;4require_once 'phodevi.php';5$vendor = phodevi::system_software_opengl_vendor();6echo $vendor;7require_once 'phodevi.php';8$vendor = phodevi::system_software_opengl_vendor();9echo $vendor;10require_once 'phodevi.php';11$vendor = phodevi::system_software_opengl_vendor();12echo $vendor;13require_once 'phodevi.php';14$vendor = phodevi::system_software_opengl_vendor();15echo $vendor;16require_once 'phodevi.php';17$vendor = phodevi::system_software_opengl_vendor();18echo $vendor;19require_once 'phodevi.php';20$vendor = phodevi::system_software_opengl_vendor();21echo $vendor;22require_once 'phodevi.php';23$vendor = phodevi::system_software_opengl_vendor();24echo $vendor;25require_once 'phodevi.php';26$vendor = phodevi::system_software_opengl_vendor();27echo $vendor;

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1require_once 'phodevi.php';2$vendor = phodevi_system::sw_opengl_vendor();3echo $vendor;4require_once 'phodevi.php';5$extensions = phodevi_system::sw_opengl_extensions();6echo $extensions;

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1$vendor = phodevi::read_property('gpu', 'vendor');2echo $vendor;3$name = phodevi::read_property('gpu', 'name');4echo $name;5$version = phodevi::read_property('gpu', 'version');6echo $version;7$extensions = phodevi::read_property('gpu', 'extensions');8echo $extensions;9$shading = phodevi::read_property('gpu', 'shading');10echo $shading;11$shading_extensions = phodevi::read_property('gpu', 'shading-extensions');12echo $shading_extensions;

Full Screen

Full Screen

sw_opengl_vendor

Using AI Code Generation

copy

Full Screen

1$vendor = $system->sw_opengl_vendor();2echo $vendor;3$renderer = $system->sw_opengl_renderer();4echo $renderer;5$version = $system->sw_opengl_version();6echo $version;7$shading_lang_ver = $system->sw_opengl_shading_language_version();8echo $shading_lang_ver;9$extensions = $system->sw_opengl_extensions();10echo $extensions;11$extensions = $system->sw_opengl_extensions();12echo $extensions;13$extensions = $system->sw_opengl_extensions();14echo $extensions;

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger sw_opengl_vendor code on LambdaTest Cloud Grid

Execute automation tests with sw_opengl_vendor on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful