很火的显卡测试-毒蘑菇测试

2024-02-11 14:59
文章标签 测试 显卡 很火 毒蘑菇

本文主要是介绍很火的显卡测试-毒蘑菇测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

前言

最近,网上有一种很火的手机电脑测试——毒蘑菇测试

他长这样

乍一看,是不是挺美,其实:

哎,我可怜的GPU呀

分析

下面,咱们来分析一下

首先,这个网站的内存占用其实并不高:才22.7MB,百度都46MB了

这就说明,并不是大量的代码造成的,说到代码,我们再来看一看

也就290多行,其中好多都是拖动的代码:

代码

不想看的直接跳过,看也看不懂……

<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="user-scalable=no"><title>volumeshader_bm</title><style>body {background: #131115;}#c1 {background: #fbf7fe;}#btn {position: fixed;left: 0px;top: 0px;}#c1 {position: fixed;left: 0px;top: 0px;}#main {transform-origin: 0px 0px;position: fixed;left: 0px;top: 0px;}#config {position: fixed;left: 0px;top: 30px;display: none;}</style>
</head>
<body style="overflow-x:hidden;overflow-y:hidden">
<div id="main"><canvas id="c1" width="1024" height="1024"><span>不支持canvas浏览器</span></canvas>
</div><button id="btn">CONFIG</button><div id="config"><textarea name="" id="kernel" cols="30" rows="10"></textarea><br /><button id="apply">APPLY</button><button id="cancle">CANCLE</button></div><script>
alert("trigonometric and inverse trigonometric functions test.\ncreated by cznull@bilibili");var cx, cy;var glposition;var glright;var glforward;var glup;var glorigin;var glx;var gly;var gllen;var canvas;var gl;var date = new Date();var md = 0,mx,my;var t2,t1 = date.getTime();var mx = 0, my = 0, mx1 = 0, my1 = 0, lasttimen = 0;var ml = 0, mr = 0, mm = 0;var len = 1.6;var ang1 = 2.8;var ang2 = 0.4;var cenx = 0.0;var ceny = 0.0;var cenz = 0.0;var KERNEL = "float kernal(vec3 ver){\n" +"   vec3 a;\n" +"float b,c,d,e;\n" +"   a=ver;\n" +"   for(int i=0;i<5;i++){\n" +"       b=length(a);\n" +"       c=atan(a.y,a.x)*8.0;\n" +"       e=1.0/b;\n" +"       d=acos(a.z/b)*8.0;\n" +"       b=pow(b,8.0);\n" +"       a=vec3(b*sin(d)*cos(c),b*sin(d)*sin(c),b*cos(d))+ver;\n" +"       if(b>6.0){\n" +"           break;\n" +"       }\n" +"   }" +"   return 4.0-a.x*a.x-a.y*a.y-a.z*a.z;" +"}";var vertshade;var fragshader;var shaderProgram;function ontimer() {ang1+=0.01;draw();window.requestAnimationFrame(ontimer);}document.addEventListener("mousedown",function (ev) {var oEvent = ev || event;if (oEvent.button == 0) {ml = 1;mm = 0;}if (oEvent.button == 2) {mr = 1;mm = 0;}mx = oEvent.clientX;my = oEvent.clientY;},false);document.addEventListener("mouseup",function (ev) {var oEvent = ev || event;if (oEvent.button == 0) {ml = 0;}if (oEvent.button == 2) {mr = 0;}},false);document.addEventListener("mousemove",function (ev) {var oEvent = ev || event;if (ml == 1) {ang1 += (oEvent.clientX - mx) * 0.002;ang2 += (oEvent.clientY - my) * 0.002;if (oEvent.clientX != mx || oEvent.clientY != my) {mm = 1;}}if (mr == 1) {var l = len * 4.0 / (cx + cy);cenx += l * (-(oEvent.clientX - mx) * Math.sin(ang1) - (oEvent.clientY - my) * Math.sin(ang2) * Math.cos(ang1));ceny += l * ((oEvent.clientY - my) * Math.cos(ang2));cenz += l * ((oEvent.clientX - mx) * Math.cos(ang1) - (oEvent.clientY - my) * Math.sin(ang2) * Math.sin(ang1));if (oEvent.clientX != mx || oEvent.clientY != my) {mm = 1;}}mx = oEvent.clientX;my = oEvent.clientY;},false);document.addEventListener("mousewheel",function (ev) {ev.preventDefault();var oEvent = ev || event;len *= Math.exp(-0.001 * oEvent.wheelDelta);},false);document.addEventListener("touchstart",function (ev) {var n = ev.touches.length;if (n == 1) {var oEvent = ev.touches[0];mx = oEvent.clientX;my = oEvent.clientY;}else if (n == 2) {var oEvent = ev.touches[0];mx = oEvent.clientX;my = oEvent.clientY;oEvent = ev.touches[1];mx1 = oEvent.clientX;my1 = oEvent.clientY;}lasttimen = n;},false);document.addEventListener("touchend",function (ev) {var n = ev.touches.length;if (n == 1) {var oEvent = ev.touches[0];mx = oEvent.clientX;my = oEvent.clientY;}else if (n == 2) {var oEvent = ev.touches[0];mx = oEvent.clientX;my = oEvent.clientY;oEvent = ev.touches[1];mx1 = oEvent.clientX;my1 = oEvent.clientY;}lasttimen = n;},false);document.addEventListener("touchmove",function (ev) {ev.preventDefault();var n = ev.touches.length;if (n == 1&&lasttimen==1) {var oEvent = ev.touches[0];ang1 += (oEvent.clientX - mx) * 0.002;ang2 += (oEvent.clientY - my) * 0.002;mx = oEvent.clientX;my = oEvent.clientY;}else if (n == 2) {var oEvent = ev.touches[0];var oEvent1 = ev.touches[1];var l = len * 2.0 / (cx + cy), l1;cenx += l * (-(oEvent.clientX + oEvent1.clientX - mx - mx1) * Math.sin(ang1) - (oEvent.clientY + oEvent1.clientY - my - my1) * Math.sin(ang2) * Math.cos(ang1));ceny += l * ((oEvent.clientY + oEvent1.clientY - my - my1) * Math.cos(ang2));cenz += l * ((oEvent.clientX + oEvent1.clientX - mx - mx1) * Math.cos(ang1) - (oEvent.clientY + oEvent1.clientY - my - my1) * Math.sin(ang2) * Math.sin(ang1));l1 = Math.sqrt((mx - mx1) * (mx - mx1) + (my - my1) * (my - my1)+1.0);mx = oEvent.clientX;my = oEvent.clientY;mx1 = oEvent1.clientX;my1 = oEvent1.clientY;l = Math.sqrt((mx - mx1) * (mx - mx1) + (my - my1) * (my - my1) + 1.0);len *= l1 / l;}lasttimen = n;},false);document.oncontextmenu = function (event) {if (mm == 1) {event.preventDefault();}};function draw() {date = new Date();var t2 = date.getTime();//ang1 += (t2 - t1)*0.001;t1 = t2;//ang1 += 0.1;gl.uniform1f(glx, cx * 2.0 / (cx + cy));gl.uniform1f(gly, cy * 2.0 / (cx + cy));gl.uniform1f(gllen, len);gl.uniform3f(glorigin, len * Math.cos(ang1) * Math.cos(ang2) + cenx, len * Math.sin(ang2) + ceny, len * Math.sin(ang1) * Math.cos(ang2) + cenz);gl.uniform3f(glright, Math.sin(ang1), 0, -Math.cos(ang1));gl.uniform3f(glup, -Math.sin(ang2) * Math.cos(ang1), Math.cos(ang2), -Math.sin(ang2) * Math.sin(ang1));gl.uniform3f(glforward, -Math.cos(ang1) * Math.cos(ang2), -Math.sin(ang2), -Math.sin(ang1) * Math.cos(ang2));gl.drawArrays(gl.TRIANGLES, 0, 6);gl.finish();}window.onresize = function () {cx = document.body.clientWidth;cy = document.body.clientHeight;if(cx>cy){cx=cy;}else{cy=cx;}document.getElementById("main").style.width=1024+"px";document.getElementById("main").style.height=1024+"px";document.getElementById("main").style.transform="scale("+cx/1024+","+cy/1024+")";}window.onload = function () {cx = document.body.clientWidth;cy = document.body.clientHeight;if(cx>cy){cx=cy;}else{cy=cx;}document.getElementById("main").style.width=1024+"px";document.getElementById("main").style.height=1024+"px";document.getElementById("main").style.transform="scale("+cx/1024+","+cy/1024+")";var positions = [-1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0, 1.0, 0.0];var VSHADER_SOURCE ="#version 100 \n"+"precision highp float;\n" +"attribute vec4 position;" +"varying vec3 dir, localdir;" +"uniform vec3 right, forward, up, origin;" +"uniform float x,y;" +"void main() {" +"   gl_Position = position; " +"   dir = forward + right * position.x*x + up * position.y*y;" +"   localdir.x = position.x*x;" +"   localdir.y = position.y*y;" +"   localdir.z = -1.0;" +"} ";var FSHADER_SOURCE ="#version 100 \n" +"#define PI 3.14159265358979324\n" +"#define M_L 0.3819660113\n" +"#define M_R 0.6180339887\n" +"#define MAXR 8\n" +"#define SOLVER 8\n" +"precision highp float;\n" +"float kernal(vec3 ver)\n;" +"uniform vec3 right, forward, up, origin;\n" +"varying vec3 dir, localdir;\n" +"uniform float len;\n" +"vec3 ver;\n" +"int sign;"+"float v, v1, v2;\n" +"float r1, r2, r3, r4, m1, m2, m3, m4;\n" +"vec3 n, reflect;\n" +"const float step = 0.002;\n" +"vec3 color;\n" +"void main() {\n" +"   color.r=0.0;\n" +"   color.g=0.0;\n" +"   color.b=0.0;\n" +"   sign=0;"+"   v1 = kernal(origin + dir * (step*len));\n" +"   v2 = kernal(origin);\n" +"   for (int k = 2; k < 1002; k++) {\n" +"      ver = origin + dir * (step*len*float(k));\n" +"      v = kernal(ver);\n" +"      if (v > 0.0 && v1 < 0.0) {\n" +"         r1 = step * len*float(k - 1);\n" +"         r2 = step * len*float(k);\n" +"         m1 = kernal(origin + dir * r1);\n" +"         m2 = kernal(origin + dir * r2);\n" +"         for (int l = 0; l < SOLVER; l++) {\n" +"            r3 = r1 * 0.5 + r2 * 0.5;\n" +"            m3 = kernal(origin + dir * r3);\n" +"            if (m3 > 0.0) {\n" +"               r2 = r3;\n" +"               m2 = m3;\n" +"            }\n" +"            else {\n" +"               r1 = r3;\n" +"               m1 = m3;\n" +"            }\n" +"         }\n" +"         if (r3 < 2.0 * len) {\n" +"               sign=1;" +"            break;\n" +"         }\n" +"      }\n" +"      if (v < v1&&v1>v2&&v1 < 0.0 && (v1*2.0 > v || v1 * 2.0 > v2)) {\n" +"         r1 = step * len*float(k - 2);\n" +"         r2 = step * len*(float(k) - 2.0 + 2.0*M_L);\n" +"         r3 = step * len*(float(k) - 2.0 + 2.0*M_R);\n" +"         r4 = step * len*float(k);\n" +"         m2 = kernal(origin + dir * r2);\n" +"         m3 = kernal(origin + dir * r3);\n" +"         for (int l = 0; l < MAXR; l++) {\n" +"            if (m2 > m3) {\n" +"               r4 = r3;\n" +"               r3 = r2;\n" +"               r2 = r4 * M_L + r1 * M_R;\n" +"               m3 = m2;\n" +"               m2 = kernal(origin + dir * r2);\n" +"            }\n" +"            else {\n" +"               r1 = r2;\n" +"               r2 = r3;\n" +"               r3 = r4 * M_R + r1 * M_L;\n" +"               m2 = m3;\n" +"               m3 = kernal(origin + dir * r3);\n" +"            }\n" +"         }\n" +"         if (m2 > 0.0) {\n" +"            r1 = step * len*float(k - 2);\n" +"            r2 = r2;\n" +"            m1 = kernal(origin + dir * r1);\n" +"            m2 = kernal(origin + dir * r2);\n" +"            for (int l = 0; l < SOLVER; l++) {\n" +"               r3 = r1 * 0.5 + r2 * 0.5;\n" +"               m3 = kernal(origin + dir * r3);\n" +"               if (m3 > 0.0) {\n" +"                  r2 = r3;\n" +"                  m2 = m3;\n" +"               }\n" +"               else {\n" +"                  r1 = r3;\n" +"                  m1 = m3;\n" +"               }\n" +"            }\n" +"            if (r3 < 2.0 * len&&r3> step*len) {\n" +"                   sign=1;" +"               break;\n" +"            }\n" +"         }\n" +"         else if (m3 > 0.0) {\n" +"            r1 = step * len*float(k - 2);\n" +"            r2 = r3;\n" +"            m1 = kernal(origin + dir * r1);\n" +"            m2 = kernal(origin + dir * r2);\n" +"            for (int l = 0; l < SOLVER; l++) {\n" +"               r3 = r1 * 0.5 + r2 * 0.5;\n" +"               m3 = kernal(origin + dir * r3);\n" +"               if (m3 > 0.0) {\n" +"                  r2 = r3;\n" +"                  m2 = m3;\n" +"               }\n" +"               else {\n" +"                  r1 = r3;\n" +"                  m1 = m3;\n" +"               }\n" +"            }\n" +"            if (r3 < 2.0 * len&&r3> step*len) {\n" +"                   sign=1;" +"               break;\n" +"            }\n" +"         }\n" +"      }\n" +"      v2 = v1;\n" +"      v1 = v;\n" +"   }\n" +"   if (sign==1) {\n" +"      ver = origin + dir*r3 ;\n" +"       r1=ver.x*ver.x+ver.y*ver.y+ver.z*ver.z;" +"      n.x = kernal(ver - right * (r3*0.00025)) - kernal(ver + right * (r3*0.00025));\n" +"      n.y = kernal(ver - up * (r3*0.00025)) - kernal(ver + up * (r3*0.00025));\n" +"      n.z = kernal(ver + forward * (r3*0.00025)) - kernal(ver - forward * (r3*0.00025));\n" +"      r3 = n.x*n.x+n.y*n.y+n.z*n.z;\n" +"      n = n * (1.0 / sqrt(r3));\n" +"      ver = localdir;\n" +"      r3 = ver.x*ver.x+ver.y*ver.y+ver.z*ver.z;\n" +"      ver = ver * (1.0 / sqrt(r3));\n" +"      reflect = n * (-2.0*dot(ver, n)) + ver;\n" +"      r3 = reflect.x*0.276+reflect.y*0.920+reflect.z*0.276;\n" +"      r4 = n.x*0.276+n.y*0.920+n.z*0.276;\n" +"      r3 = max(0.0,r3);\n" +"      r3 = r3 * r3*r3*r3;\n" +"      r3 = r3 * 0.45 + r4 * 0.25 + 0.3;\n" +"      n.x = sin(r1*10.0)*0.5+0.5;\n" +"      n.y = sin(r1*10.0+2.05)*0.5+0.5;\n" +"      n.z = sin(r1*10.0-2.05)*0.5+0.5;\n" +"      color = n*r3;\n" +"   }\n" +"   gl_FragColor = vec4(color.x, color.y, color.z, 1.0);" +"}";canvas = document.getElementById('c1');gl = canvas.getContext('webgl');vertshader = gl.createShader(gl.VERTEX_SHADER);fragshader = gl.createShader(gl.FRAGMENT_SHADER);shaderProgram = gl.createProgram();gl.shaderSource(vertshader, VSHADER_SOURCE);gl.compileShader(vertshader);var infov = gl.getShaderInfoLog(vertshader);gl.shaderSource(fragshader, FSHADER_SOURCE + KERNEL);gl.compileShader(fragshader);var infof = gl.getShaderInfoLog(fragshader);gl.attachShader(shaderProgram, vertshader);gl.attachShader(shaderProgram, fragshader);gl.linkProgram(shaderProgram);gl.useProgram(shaderProgram);if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {var info = gl.getProgramInfoLog(shaderProgram);throw 'Could not compile WebGL program. \n\n' + infov + infof + info;}glposition = gl.getAttribLocation(shaderProgram, 'position');glright = gl.getUniformLocation(shaderProgram, 'right');glforward = gl.getUniformLocation(shaderProgram, 'forward');glup = gl.getUniformLocation(shaderProgram, 'up');glorigin = gl.getUniformLocation(shaderProgram, 'origin');glx = gl.getUniformLocation(shaderProgram, 'x');gly = gl.getUniformLocation(shaderProgram, 'y');gllen = gl.getUniformLocation(shaderProgram, 'len');var buffer = gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER, buffer);gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);gl.vertexAttribPointer(glposition, 3, gl.FLOAT, false, 0, 0);gl.enableVertexAttribArray(glposition);gl.viewport(0, 0, 1024, 1024);draw();window.requestAnimationFrame(ontimer);document.getElementById("kernel").value = KERNEL;document.getElementById("btn").addEventListener("click", function() {var state = this.innerText == "CONFIG";this.innerText = state ? "HIDE" : "CONFIG";document.getElementById("config").style.display = state ? "inline" : "none";});document.getElementById("apply").addEventListener("click", function() {KERNEL = document.getElementById("kernel").value;gl.shaderSource(fragshader, FSHADER_SOURCE + KERNEL);gl.compileShader(fragshader);var infof = gl.getShaderInfoLog(fragshader);gl.linkProgram(shaderProgram);gl.useProgram(shaderProgram);if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {var info = gl.getProgramInfoLog(shaderProgram);alert(infof + info);}glposition = gl.getAttribLocation(shaderProgram, 'position');glright = gl.getUniformLocation(shaderProgram, 'right');glforward = gl.getUniformLocation(shaderProgram, 'forward');glup = gl.getUniformLocation(shaderProgram, 'up');glorigin = gl.getUniformLocation(shaderProgram, 'origin');glx = gl.getUniformLocation(shaderProgram, 'x');gly = gl.getUniformLocation(shaderProgram, 'y');gllen = gl.getUniformLocation(shaderProgram, 'len');});document.getElementById("cancle").addEventListener("click", function() {document.getElementById("kernel").value = KERNEL;});}</script>
</body>
</html>

原因

不是内存,不是代码,那只能是程序本身了,我把网站上的一张图片下了下来

我发现光是打开图片都要很高的占用率:

平时都是1%,下载直接20%

细看图片,发现其像素点之复杂,不是放大5000倍可以解决的

可以看到,这个倍数下还是没有清晰的像素点呈现:

所以,这是对GPU渲染性能的极大考验,也就是说,这么一小块图片都要20%,那么整个网站的帧率是20,每秒就要加载20张,不100%才怪呢(仅限轻薄本)

gpu渲染原理 - 百度文库

总结

找到了原因,舒服多了,不会在为显卡不行而发愁了,测试网站:volumeshader_bm

温馨提示:手机不建议测试o

那么各位,你们的电脑配置有怎样呢,能抗住毒蘑菇么,各位可以把各自的GPU占用率晒出来,比比性能o!

这篇关于很火的显卡测试-毒蘑菇测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/700094

相关文章

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

字节面试 | 如何测试RocketMQ、RocketMQ?

字节面试:RocketMQ是怎么测试的呢? 答: 首先保证消息的消费正确、设计逆向用例,在验证消息内容为空等情况时的消费正确性; 推送大批量MQ,通过Admin控制台查看MQ消费的情况,是否出现消费假死、TPS是否正常等等问题。(上述都是临场发挥,但是RocketMQ真正的测试点,还真的需要探讨) 01 先了解RocketMQ 作为测试也是要简单了解RocketMQ。简单来说,就是一个分

【测试】输入正确用户名和密码,点击登录没有响应的可能性原因

目录 一、前端问题 1. 界面交互问题 2. 输入数据校验问题 二、网络问题 1. 网络连接中断 2. 代理设置问题 三、后端问题 1. 服务器故障 2. 数据库问题 3. 权限问题: 四、其他问题 1. 缓存问题 2. 第三方服务问题 3. 配置问题 一、前端问题 1. 界面交互问题 登录按钮的点击事件未正确绑定,导致点击后无法触发登录操作。 页面可能存在

业务中14个需要进行A/B测试的时刻[信息图]

在本指南中,我们将全面了解有关 A/B测试 的所有内容。 我们将介绍不同类型的A/B测试,如何有效地规划和启动测试,如何评估测试是否成功,您应该关注哪些指标,多年来我们发现的常见错误等等。 什么是A/B测试? A/B测试(有时称为“分割测试”)是一种实验类型,其中您创建两种或多种内容变体——如登录页面、电子邮件或广告——并将它们显示给不同的受众群体,以查看哪一种效果最好。 本质上,A/B测

MiniGPT-3D, 首个高效的3D点云大语言模型,仅需一张RTX3090显卡,训练一天时间,已开源

项目主页:https://tangyuan96.github.io/minigpt_3d_project_page/ 代码:https://github.com/TangYuan96/MiniGPT-3D 论文:https://arxiv.org/pdf/2405.01413 MiniGPT-3D在多个任务上取得了SoTA,被ACM MM2024接收,只拥有47.8M的可训练参数,在一张RTX

Verybot之OpenCV应用一:安装与图像采集测试

在Verybot上安装OpenCV是很简单的,只需要执行:         sudo apt-get update         sudo apt-get install libopencv-dev         sudo apt-get install python-opencv         下面就对安装好的OpenCV进行一下测试,编写一个通过USB摄像头采

BIRT 报表的自动化测试

来源:http://www.ibm.com/developerworks/cn/opensource/os-cn-ecl-birttest/如何为 BIRT 报表编写自动化测试用例 BIRT 是一项很受欢迎的报表制作工具,但目前对其的测试还是以人工测试为主。本文介绍了如何对 BIRT 报表进行自动化测试,以及在实际项目中的一些测试实践,从而提高了测试的效率和准确性 -------

可测试,可维护,可移植:上位机软件分层设计的重要性

互联网中,软件工程师岗位会分前端工程师,后端工程师。这是由于互联网软件规模庞大,从业人员众多。前后端分别根据各自需求发展不一样的技术栈。那么上位机软件呢?它规模小,通常一个人就能开发一个项目。它还有必要分前后端吗? 有必要。本文从三个方面论述。分别是可测试,可维护,可移植。 可测试 软件黑盒测试更普遍,但很难覆盖所有应用场景。于是有了接口测试、模块化测试以及单元测试。都是通过降低测试对象

day45-测试平台搭建之前端vue学习-基础4

目录 一、生命周期         1.1.概念         1.2.常用的生命周期钩子         1.3.关于销毁Vue实例         1.4.原理​编辑         1.5.代码 二、非单文件组件         2.1.组件         2.2.使用组件的三大步骤         2.3.注意点         2.4.关于VueComponen

笔记本电脑配置:选择独立显卡还是集成显卡

2.4.1  笔记本电脑配置:选择独立显卡还是集成显卡   一般个人用笔记本电脑划分高低档次的方法主要是看CPU的档次和有无独立显卡。由于笔记本电脑的显卡通常设计成不能升级的部件,一旦选择后,显卡的配置就不能再变,而显卡通常会影响是否能玩哪些游戏或影响3D程序的运行速度,因此需要重点考虑。   集成显卡的特点是功耗小、发热量小、显存从内存中分配、价格便宜,适合上网、办公应用、学习、炒