NVIDIA /CUDA 里面的clock rate详细介绍

本文主要介绍:

  1. cuda中的时钟频率具体有哪些?
  2. clock rate怎么调节?

cuda中可以通过nvml 函数或者命令来调整时钟频率(clock rate)

介绍

命令行 nvdia-smi -q -i 0 可以查询device相关参数,可以用后面的命令过滤clock相关参数,

$ nvidia-smi -q -d CLOCK -i 0Clocks                             Graphics Clock                  : 1410 MHzSM Clock                        : 1410 MHzMemory Clock                    : 1215 MHzVideo Clock                     : 1275 MHzApplications Clocks                Graphics Clock                  : 1410 MHzMemory Clock                    : 1215 MHzDefault Applications Clocks        Graphics Clock                  : 765 MHzMemory Clock                    : 1215 MHzDeferred Clocks                    Memory Clock                    : N/AMax Clocks                         Graphics Clock                  : 1410 MHzSM Clock                        : 1410 MHzMemory Clock                    : 1215 MHzVideo Clock                     : 1290 MHzMax Customer Boost Clocks          Graphics Clock                  : 1410 MHzClock Policy                       Auto Boost                      : N/A  # (disable/enable)Auto Boost Default              : N/A  #(disable/enable)

通过上面可以了解到,最新的CUDA12 显示了以下几个clock

  • Clocks
    代表的是目前实时频率
  • Applications Clocks
    Application clock,也就是说CUDA runtime 启动后的时钟频率,启动后就和第一个”Clocks“一样的
    当application设置后,无程序跑的时候比较低大概200-600之间。idle clock,运行kernel,其值与Application Clocks一致。
    在不支持application的机器上,设置locked clock后,其值为设定的locked clock(当设定的clock rate > boost clock后,会动态变化> boost clock GPU Boost 4.0)
  • Default Applications Clocks
    这个是默认的 Applications Clocks ,当用户设置了Applications Clocks 后,再次返回的时候可以返回到这个默认值
  • Deferred Clocks
    没有研究
  • Max Clocks
    最大的时钟频率, 包括超频

对于clock还有其它的一些clock rate 没有在上面体现,具体为下面两项
Base Clock:
(nvidia-smi base-clocks -i 0)The Base Clock of a graphics card (also sometimes referred to as the “Core Clock”) is the minimum speed at which the GPU is advertised to run. In normal conditions, the GPU of the card will not drop below this clock speed unless conditions are significantly altered. This number is more significant in older cards but is becoming less and less relevant as boosting technologies take center stage.
Boost Clock:
The advertised Boost Clock of the card is the maximum clock speed that the graphics card can achieve under normal conditions before the GPU Boost is activated. This clock speed number is generally quite a bit higher than the Base Clock and the card uses up most of its power budget to achieve this number. Unless the card is thermally constrained, it will hit this advertised boost clock. This is also the parameter that is altered in “Factory Overclocked” cards from AIB partners.

其中大小关系是Base Clock <= Boost Clock <= Max Clocks <=max Boost Clocks.

Auto Boost相关说明入如下:

Auto Boost 大部分不支持:
GPU Boost technology allows the card to boost much higher than the advertised “Boost Clock” that may be listed on the box or on the product page.
Increase Performance with GPU Boost and K80 Autoboost | NVIDIA Technical Blog
nvmlDeviceSetAutoBoostedClocksEnabled (nvidia-smi --auto-boost-default=ENABLED -i 0)
所说的不支持指的是不支持打开和关闭
在这里插入图片描述

对于cuda的 cudaGetDeviceProperties.clock_rate对应的

cudaDeviceProp device_prop;err = cudaGetDeviceProperties(&device_prop, device);if (err != cudaSuccess) {return (Error_t)err;}
  1. 对于支持application clock rate的设备,对应的是上面的:Applications Clocks->Graphics Clock / SM Clock,
  2. 对于不支持application clock的卡,其值是boost clock,并不是locked clock,这一点需要注意,并且该值只能通过spec去查询,nvml中查询不到,只能查询到base clock

比如:RTX4090 properties.clock_rate = 2520 MHz, 其中通过命令行查询后如下,nvidia-smi -q -i 3 找不到2520Mhz
在这里插入图片描述
在这里插入图片描述

测试性能的时候,是否需要set max clock rate?或者reset default clock rate?

一定需要的。

可以通过命令行或者API(1.4会详细介绍)修改上面提到的具体运行clock rate , 我们的卡是多人使用,一旦这些参数被人篡改(比较低的值),测试性能急剧下降。并且不稳定。

nvidia-smi  --applications-clocks=9001,2520 -i 0nvidia-smi  --reset-applications-clocks -invidia-smi  --lock-gpu-clocks=3105,3105 -i 0nvidia-smi  --reset-gpu-clocksnvidia-smi  --lock-memory-clocks=680,680 -i0nvidia-smi  --reset-memory-clocks#查询
nvidia-smi --query-supported-clocks "gr" --format=csv -i 0
nvidia-smi -i 0 --query-supported-clocks=mem,gr --format=csv
--help-query-supported-clocks

那么能不能单纯的reset设置呢?

其实在reset default clock rate情况下,会让devie处于Dynamic Clocking(GPU BOOST)状态下.

Starting with our GPU and later, every application and game runs at a guaranteed, minimum Base Clock speed.

If there’s extra power available, a Boost Clock is enabled increasing clock speeds until the graphics card hits its predetermined Power Target.

This dynamic clock speed adjustment is controlled by GPU Boost, which monitors a raft of data and makes real-time changes to speeds and voltages several times per second, maximizing performance in each and every application.

在下面的图中可以看到,不同频率下包括Boost模式,性能是不一样的。
在这里插入图片描述
在这里插入图片描述

哪些函数能设置clock rate?

clocks set/reset相关函数:
SM clock rate
nvmlDeviceSetApplicationsClocks
nvmlDeviceResetApplicationsClocks
nvmlDeviceSetGpuLockedClocks
nvmlDeviceResetGPULockedClocks

Mem clock rate
nvmlDeviceSetApplicationsClocks
nvmlDeviceResetApplicationsClocks
nvmlDeviceSetMemoryLockedClocks
nvmlDeviceResetMemoryLockedClocks

两者区别:

nvmlDeviceSetApplicationsClocks/nvmlDeviceResetApplicationsClocks
当设置了application后,只有当有kernel在GPU上运行的时候才会锁定到设置的频率。

nvmlDeviceSetGpuLockedClocks/nvmlDeviceSetMemoryLockedClocks
当设置了lockedclock会让GPU 一直处于设置的频率,即使没有kernel在GPU上运行。

如下图所示,当设置了gpu/mem lockedclock,即使在没有进程的情况下,GPU的实际频率仍然为设置的2520,9001。

注意:部分机器比如A100支持nvmlDeviceSetGpuLockedClocks,不支持nvmlDeviceSetMemoryLockedClocks,但是设置了前者后,后者自动设置为最大值。
在这里插入图片描述
如下图所示,当reset gpu/mem lockedclock,在没有进程的情况下,GPU的实际频率为IDLE状态210,405
在这里插入图片描述

如何设置application clock?

Before you can change the application clocks you need to put the GPU in Persistence Mode(1.7介绍) and query the available application clock rates.

Persistence mode ensures that the driver stays loaded even when no CUDA or X applications are running on the GPU.

This maintains current state, including requested applications clocks.Persistence Mode is necessary to make application clock changes persistent until the application runs. Enable Persistence Mode with the following command line (for GPU 0).

Increase Performance with GPU Boost and K80 Autoboost | NVIDIA Technical Blog

nvmlReturn_t DECLDIR nvmlDeviceSetApplicationsClocks(nvmlDevice_t device, unsigned int memClockMHz, unsigned int graphicsClockMHz);
  1. Set clocks that applications will lock to.

  2. Sets the clocks that compute and graphics applications will be running at.

e.g. CUDA driver requests these clocks during context creation which means this property defines clocks at which CUDA applications will be running unless some overspec event occurs (e.g. over power, over thermal or external HW brake).

  1. Can be used as a setting to request constant performance.

  2. On Pascal and newer hardware, this will automatically disable automatic boosting of clocks.

  3. On K80 and newer Kepler and Maxwell GPUs, users desiring fixed performance should also call nvmlDeviceSetAutoBoostedClocksEnabled (nvidia-smi --auto-boost-default=ENABLED -i 0)to prevent clocks from automatically boosting above the clock value being set.

  4. For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices. Requires root/admin permissions.

  5. See nvmlDeviceGetSupportedMemoryClocks and nvmlDeviceGetSupportedGraphicsClocks for details on how to list available clocks combinations.(nvidia-smi -q -i 0 -d SUPPORTED_CLOCKS)

  6. After system reboot or driver reload applications clocks go back to their default value. See \ref nvmlDeviceResetApplicationsClocks.

reset application clock

nvmlReturn_t DECLDIR nvmlDeviceResetApplicationsClocks(nvmlDevice_t device);

Resets the application clock to the default value
This is the applications clock that will be used after system reboot or driver reload.
Default value is constant, but the current value an be changed using \ref nvmlDeviceSetApplicationsClocks.
On Pascal and newer hardware, if clocks were previously locked with \ref nvmlDeviceSetApplicationsClocks, this call will unlock clocks.
This returns clocks their default behavior of automatically boosting above base clocks as thermal limits allow.

application辅助函数 AutoBoosted clocks

作用:

Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates, to maximize performance as thermal limits allow.
AutoBoosted clocks should be disabled if fixed clock rates are desired.
1.4.3.1 set auto boosted clock 函数

/** @param device                               The identifier of the target device* @param enabled                              What state to try to set Auto Boosted clocks of the target device to** @return*         - \ref NVML_SUCCESS                 If the Auto Boosted clocks were successfully set to the state specified by \a enabled*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
*/
nvmlReturn_t DECLDIR nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled);
  1. Try to set the current state of Auto Boosted clocks on a device. For Kepler &tm; or newer fully supported devices.

  2. On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks. Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost behavior.

  3. Non-root users may use this API by default but can be restricted by root from using this API by calling \ref nvmlDeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS.

Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled.

reset auto boosted clock 函数

Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will return to when no compute running processes (e.g. CUDA application which have an active context) are running

/* @param device                               The identifier of the target device* @param enabled                              What state to try to set default Auto Boosted clocks of the target device to* @param flags                                Flags that change the default behavior. Currently Unused.*/
nvmlReturn_t DECLDIR nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags);

locked clock 函数

1.5.1 nvmlDeviceSetGpuLockedClocks/nvmlDeviceReSetMemoryLockedClocks
通过Locked Clock锁定clock rate后(<=boost clock rate),执行kernel的时候,频率会被限制在设定的范围内。
但是当lockedclock 设置的【min,max】,其中的min,max处于boost clock与max clock之间的话,那么实际clockrate 不一定是TBD,它会在之间某一个值之后不再增长。
比如RTX4090 TBD=3105MHz的时候,实际clockrate 为2775,这时候如果用3105计算时间,就会有误差。

/** @param device                               The identifier of the target device* @param minGpuClockMHz                       Requested minimum gpu clock in MHz* @param maxGpuClockMHz                       Requested maximum gpu clock in MHz** @return*         - \ref NVML_SUCCESS                 if new settings were successfully set*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz*                                                 is not a valid clock combination*         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error*/
nvmlReturn_t DECLDIR nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz);* @param device                               The identifier of the target device* @param minMemClockMHz                       Requested minimum memory clock in MHz* @param maxMemClockMHz                       Requested maximum memory clock in MHz** @return*         - \ref NVML_SUCCESS                 if new settings were successfully set*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz*                                                 is not a valid clock combination*         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error*/
nvmlReturn_t DECLDIR nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz);
  1. Set clocks that device will lock to.

  2. Sets the clocks that the device will be running at to the value in the range of minGpuClockMHz to maxGpuClockMHz.
    Setting this will supersede application clock values and take effect regardless if a cuda app is running.

  3. Can be used as a setting to request constant performance.

  4. This can be called with a pair of integer clock frequencies in MHz, or a pair of /ref nvmlClockLimitId_t values.

  • See the table below for valid combinations of these values.
  • minGpuClock | maxGpuClock | Effect
  • ------------±------------±-------------------------------------------------
  • tdp     |     tdp     | Lock clock to TDP
    
  • unlimited | tdp | Upper bound is TDP but clock may drift below this
  • tdp     |  unlimited  | Lower bound is TDP but clock may boost above this
    
  • unlimited | unlimited | Unlocked (== nvmlDeviceResetGpuLockedClocks)
  1. If one arg takes one of these values, the other must be one of these values as
    well. Mixed numeric and symbolic calls return NVML_ERROR_INVALID_ARGUMENT.

  2. Requires root/admin permissions.

  3. After system reboot or driver reload applications clocks go back to their default value.

  4. For Volta &tm; or newer fully supported devices.

问题:要不要设置AutoBoosted?

不用设置。

nvmlDeviceResetGpuLockedClocks/nvmlDeviceResetMemoryLockedClocks

* @param device                               The identifier of the target device** @return*         - \ref NVML_SUCCESS                 if new settings were successfully set*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error*/
nvmlReturn_t DECLDIR nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device);/ * @param device                               The identifier of the target device** @return*         - \ref NVML_SUCCESS                 if new settings were successfully set*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error*/
nvmlReturn_t DECLDIR nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device);
  1. Resets the gpu clock to the default value

  2. This is the gpu clock that will be used after system reboot or driver reload.
    Default values are idle clocks, but the current values can be changed using \ref nvmlDeviceSetApplicationsClocks.

  3. For Volta &tm; or newer fully supported devices.
    在支持application clock的机器上同时使用nvmlDeviceSetApplicationsClocks,nvmlDeviceSetGpuLockedClocks,
    会产生locked clock现象, clock rate为nvmlDeviceSetApplicationsClocks的值,自动忽略

详细如下:

详细如下:

项目Valueapplication clockreal clock(无kernel运行)real clock(有kernel运行)
nvidia-smi --applications-clocks=405,405 -i 0x405,405210,405405,405
nvidia-smi --lock-gpu-clocks=2520,9001 -m 0 -i 0nvidia-smi --applications-clocks=405,405 -i 0405,405405,405405,405
nvidia-smi --applications-clocks=405,405 -i 0nvidia-smi --lock-gpu-clocks=2520,9001 -m 0 -i 0405,405405,405405,405
xnvidia-smi --lock-gpu-clocks=2520,9001 -m 0 -i 02520,90012520,90012520,9001
综上:

对于支持Application的device,如果使用了nvmlDeviceSetApplicationsClocks,就不要再使用nvmlDeviceSetGpuLockedClocks
对于不支持Application的device,使用nvmlDeviceSetGpuLockedClocks。

Persistence mode

vidia-smi -i <target gpu> - q==============NVSMI LOG==============Timestamp                           : ----Driver Version                      : ----Attached GPUs                       : ----GPU 0000:01:00.0Product Name                    : ----Display Mode                    : ----Display Active                  : ----Persistence Mode                : EnabledAccounting Mode                 : ----

Persistence Mode is the term for a user-settable driver property that keeps a target GPU initialized even when no clients are connected to it.

The GPU state remains loaded in the driver whenever one or more clients have the device file open. Once all clients have closed the device file, the GPU state will be unloaded unless persistence mode is enabled.

Application start latency
Applications that trigger GPU initilization may incur a short (order of 1-3 second) startup cost per GPU due to ECC scrubbing behavior. If the GPU is already initialized this scrubbing does not take place.

Preservation of driver state
If the driver deinitializes a GPU some non-persistent state associated with that GPU will be lost and revert back to defaults the next time the GPU is initialized. See Data Persistence. To avoid this the GPU should be kept initialized.

nvidia-persistenced --help
persistence mode对NVML的影响如下,从表中可以看出enable下init影响很大
下面是API调用时间.

set max clockset default clockgetML info
application clock10.07ms16.63ms57.02ms
locked clock37.41ms20ms54.81

在disable状态下,只要进程退出(i.e. it is idle, technically: no contexts of any kind are instantiated on the GPU),再次进入,所花费的时间还是和上次一样的(比较久)。

所以最好在脚本上设置一下。

persistence mode设置命令 nvidia-smi -i 0, 会将当前driver设置为disable或者enable mode,会影响所有卡,-i 0 这条命令其实没有用。

相关函数:

nvmlDeviceGetPersistenceMode/nvmlDeviceGetPersistenceMode

/*** Retrieves the persistence mode associated with this device.** For all products.* For Linux only.** When driver persistence mode is enabled the driver software state is not torn down when the last* client disconnects. By default this feature is disabled.** See \ref nvmlEnableState_t for details on allowed modes.** @param device                               The identifier of the target device* @param mode                                 Reference in which to return the current driver persistence mode** @return*         - \ref NVML_SUCCESS                 if \a mode has been set*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error** @see nvmlDeviceSetPersistenceMode()*/
nvmlReturn_t DECLDIR nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t *mode);/*** Set the persistence mode for the device.** For all products.* For Linux only.* Requires root/admin permissions.** The persistence mode determines whether the GPU driver software is torn down after the last client* exits.** This operation takes effect immediately. It is not persistent across reboots. After each reboot the* persistence mode is reset to "Disabled".** See \ref nvmlEnableState_t for available modes.** After calling this API with mode set to NVML_FEATURE_DISABLED on a device that has its own NUMA* memory, the given device handle will no longer be valid, and to continue to interact with this* device, a new handle should be obtained from one of the nvmlDeviceGetHandleBy*() APIs. This* limitation is currently only applicable to devices that have a coherent NVLink connection to* system memory.** @param device                               The identifier of the target device* @param mode                                 The target persistence mode** @return*         - \ref NVML_SUCCESS                 if the persistence mode was set*         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized*         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is invalid*         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature*         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation*         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible*         - \ref NVML_ERROR_UNKNOWN           on any unexpected error** @see nvmlDeviceGetPersistenceMode()*/
nvmlReturn_t DECLDIR nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode);

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/62136.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

扫振牙刷设计思路以及技术解析

市面上目前常见的就两种&#xff1a;扫振牙刷和超声波牙刷 为了防水&#xff0c;表面还涂上了一层防水漆 一开始的电池管理芯片&#xff0c;可以让充电更加均衡。 如TP4056 第一阶段以恒流充电&#xff1b;当电压达到预定值时转入第二阶段进行恒压充电&#xff0c;此时电流逐…

电磁继电器

它的控制原理很简单&#xff0c;当我们给它的线圈接电&#xff0c;这个线圈就有了磁性&#xff0c;它上面的衔铁就会被吸引&#xff0c;这样小灯泡就会点亮 继电器于MOS管的差别在于&#xff0c;继电器可以很轻松的胜任高电压、大电流的场合 我们从外壳上可以看到 30VDC&#x…

【Jenkins】自动化部署 maven 项目笔记

文章目录 前言1. Jenkins 新增 Maven 项目2. Jenkins 配置 Github 信息3. Jenkins 清理 Workspace4. Jenkins 配置 后置Shell脚本后记 前言 目标&#xff1a;自动化部署自己的github项目 过程&#xff1a;jenkins 配置、 shell 脚本积累 相关连接 Jenkins 官方 docker 指导d…

LangGraph中的State管理

本教程将介绍如何使用LangGraph库构建和测试状态图。我们将通过一系列示例代码&#xff0c;逐步解释程序的运行逻辑。 1. 基本状态图构建 首先&#xff0c;我们定义一个状态图的基本结构和节点。 定义状态类 from langgraph.graph import StateGraph, START, END from typi…

Excel的图表使用和导出准备

目的 导出Excel图表是很多软件要求的功能之一&#xff0c;那如何导出Excel图表呢&#xff1f;或者说如何使用Excel图表。 一种方法是软件生成图片&#xff0c;然后把图片写到Excel上&#xff0c;这种方式&#xff0c;因为格式种种原因&#xff0c;导出的图片不漂亮&#xff0c…

vue实现滚动条滑动到底部分页调取后端接口加载数据

一、案例效果 二、前提条件 接口返回数据 三、案例代码 子组件 const $emit defineEmits([cloneItem, updateList]);const props defineProps({rightList: {type: Array,},chartTableData: {type: Array as () > ChartListType[],},deleteChartInfo: {type: Object,}…

Ubuntu中使用多版本的GCC

我的系统中已经安装了GCC11.4&#xff0c;在安装cuda时出现以下错误提示&#xff1a; 意思是当前的GCC版本过高&#xff0c;要在保留GCC11.4的同时安装GCC9并可以切换&#xff0c;可以通过以下步骤实现&#xff1a; 步骤 1: 安装 GCC 9 sudo apt-get update sudo apt-get ins…

【Android】RecyclerView回收复用机制

概述 RecyclerView 是 Android 中用于高效显示大量数据的视图组件&#xff0c;它是 ListView 的升级版本&#xff0c;支持更灵活的布局和功能。 我们创建一个RecyclerView的Adapter&#xff1a; public class MyRecyclerView extends RecyclerView.Adapter<MyRecyclerVie…

Kotlin DSL Gradle 指南

本文是关于 Kotlin DSL Gradle 的指南&#xff08;上篇&#xff09;&#xff0c;介绍了 Gradle 作为 Android 开发构建工具的作用及优势&#xff0c;包括初始配置、生命周期、依赖管理、Task 相关内容。如 Task 的创建、自定义、各种方法和属性&#xff0c;以及文件操作等&…

数据库导论

data 数据是数据库中存储的基本数据&#xff0c;描述事物的符号称为数据。 DB 数据库是长期存储在计算机内&#xff0c;有组织&#xff0c;可共享的大量数据的集合。数据库中的数据按照一定的数据模型组织&#xff0c;描述和存储&#xff0c;具有较小的冗余度&#xff0c;较…

HTML实现 扫雷游戏

前言&#xff1a; 游戏起源与发展 扫雷游戏的雏形可追溯到 1973 年的 “方块&#xff08;cube&#xff09;” 游戏&#xff0c;后经改编出现了 “rlogic” 游戏&#xff0c;玩家需为指挥中心探出安全路线避开地雷。在此基础上&#xff0c;开发者汤姆・安德森编写出了扫雷游戏的…

Spring Boot英语知识网站:开发策略

5系统详细实现 5.1 管理员模块的实现 5.1.1 用户信息管理 英语知识应用网站的系统管理员可以对用户信息添加修改删除以及查询操作。具体界面的展示如图5.1所示。 图5.1 用户信息管理界面 5.1.2 在线学习管理 系统管理员可以对在线学习信息进行添加&#xff0c;修改&#xff0…

HTML5和CSS3新增特性

HTML5的新特性 HTML5新增的语义化标签 HTML5 的新增特性主要是针对于以前的不足&#xff0c;增加了一些新的标签、新的表单和新的表单属性等。 这些新特性都有兼容性问题&#xff0c;基本是 IE9 以上版本的浏览器才支持&#xff0c;如果不考虑兼容性问题&#xff0c;可以大量…

width设置100vh但出现横向滚动条的问题

在去做flex左右固定,中间自适应宽度的布局时, 发现这样一个问题: 就是我明明是宽度占据整个视口, 但是却多出了横向的滚动条 效果是这样的 把width改成100%,就没有滚动条了 原因: body是有默认样式的, 会有一定的默认边距, 把默认边距清除就是正常的了 同时, 如果把高度设…

EasyExcel: 结合springboot实现表格导出入(单/多sheet), 全字段校验,批次等操作(全)

全文目录,一步到位 1.前言简介1.1 链接传送门1.1.1 easyExcel传送门 2. Excel表格导入过程2.1 easyExcel的使用准备工作2.1.1 导入maven依赖2.1.2 建立一个util包2.1.3 ExcelUtils统一功能封装(单/多sheet导入)2.1.4 ExcelDataListener数据监听器2.1.5 ResponseHelper响应值处理…

css:转换

转换 移动 /* transform: translate(100px, 200px); */transform: translateX(100px);transform: translateY(100px); /*一个意思*/ 如果后面跟百分数的意思是移动盒子自身x/y方向长度的百分比&#xff0c;可以用作子绝父相控制盒子水平居中垂直居中 translate里的xy值是相对…

webp 网页如何录屏?

工作中正好研究到了一点&#xff1a;记录下这里&#xff1a; 先看下效果&#xff1a; 具体实现代码&#xff1a; &#xfeff; <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><meta name"viewport&qu…

SpringCloud Gateway转发请求到同一个服务的不同端口

SpringCloud Gateway默认不支持将请求路由到一个服务的多个端口 本文将结合Gateway的处理流程&#xff0c;提供一些解决思路 需求背景 公司有一个IM项目&#xff0c;对外暴露了两个端口8081和8082&#xff0c;8081是springboot启动使用的端口&#xff0c;对外提供一些http接口…

SlickGrid复选框

分析 1、先在columns首列添加复选框&#xff1b; 2、在SlickGrid注册刚添加的复选框&#xff1b; 3、添加复选框变化事件&#xff1b; 4、注册按钮点击事件&#xff0c;点击获取已选中的行。 展示 代码 复选框样式&#xff08;CSS&#xff09; .slick-cell-checkboxsel {bac…

摄像头原始数据读取——V4L2(userptr模式,V4L2_MEMORY_USERPTR)

摄像头原始数据读取——V4L2(userptr模式,V4L2_MEMORY_USERPTR) 用户指针方式允许用户空间的应用程序分配内存&#xff0c;并将内存地址传递给内核中的驱动程序。驱动程序直接将数据填充到用户空间的内存中&#xff0c;从而避免了数据的拷贝过程。 流程&#xff1a; 通过VIDI…