基础环境:wsl2安装Ubuntu22.04 + miniconda

服务器相关信息:

Thinkpad p1 gen5 64G 2T 3080ti,自带的有nvidia-smi显卡驱动。使用wsl2安装Ubuntu22.04 + miniconda目标:安装gpu版本的PyTorch2.1.2(torch2.1.2/cu117 + torchvision0.16.2/cu117)
处理器	12th Gen Intel(R) Core(TM) i9-12900H   2.50 GHz
机带 RAM	64.0 GB (63.7 GB 可用)
系统类型	64 位操作系统, 基于 x64 的处理器
显卡: 3080TI
版本	Windows 11 专业版
版本	23H2
安装日期	‎2024/‎4/‎15
操作系统版本	22631.3447
体验	Windows Feature Experience Pack 1000.22688.1000.0$ nvidia-smi
Fri Apr 19 09:15:30 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.76.01              Driver Version: 552.22         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3080 ...    On  |   00000000:01:00.0 Off |                  N/A |
| N/A   47C    P0             26W /   95W |       0MiB /  16384MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------++-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

cuda环境搭建

1、CUDA Toolkit 11.7 Update 1 Downloads
下载地址:https://developer.nvidia.com/cuda-11-7-1-download-archive

在这里插入图片描述

$ wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
--2024-04-19 09:19:29--  https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.39.144
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.39.144|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://developer.download.nvidia.cn/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run [following]
--2024-04-19 09:19:29--  https://developer.download.nvidia.cn/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
Resolving developer.download.nvidia.cn (developer.download.nvidia.cn)... 36.153.62.131, 36.153.62.132, 36.153.62.130, ...
Connecting to developer.download.nvidia.cn (developer.download.nvidia.cn)|36.153.62.131|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3524358811 (3.3G) [application/octet-stream]
Saving to: ‘cuda_11.7.1_515.65.01_linux.run’cuda_11.7.1_515.65.01_linux.run         100%[=============================================================================>]   3.28G  28.4MB/s    in 92s2024-04-19 09:21:03 (36.6 MB/s) - ‘cuda_11.7.1_515.65.01_linux.run’ saved [3524358811/3524358811]
安装依赖库文件
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
sudo apt-get -y install  libfreeimage3 libfreeimage-dev
~$gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.~$ ls
cuda_11.7.1_515.65.01_linux.run
~$ sudo sh cuda_11.7.1_515.65.01_linux.run
===========
= Summary =
===========Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.7/Please make sure that-   PATH includes /usr/local/cuda-11.7/bin-   LD_LIBRARY_PATH includes /usr/local/cuda-11.7/lib64, or, add /usr/local/cuda-11.7/lib64 to /etc/ld.so.conf and run ldconfig as rootTo uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.7/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 515.00 is required for CUDA 11.7 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:sudo <CudaInstaller>.run --silent --driverLogfile is /var/log/cuda-installer.log
最后的summary最重要的是这两句:Please make sure that-   PATH includes /usr/local/cuda-11.7/bin-   LD_LIBRARY_PATH includes /usr/local/cuda-11.7/lib64, or, add /usr/local/cuda-11.7/lib64 to /etc/ld.so.conf and run ldconfig as root在路径中添加/usr/local/cuda-10.7/bin和/usr/local/cuda-10.7/lib64
在 vim ~/.bashrc末尾添加:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export PATH=$PATH:/usr/local/cuda/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cudasource ~/.bashrcnvcc -V

安装cudnn

方法一:
sudo dpkg -i cudnn-local-repo-ubuntu2204-8.9.7.29_1.0-1_amd64.deb
sudo cp /var/cudnn-local-repo-ubuntu2004-8.9.7.29/cudnn-local-30472A84-keyring.gpg /usr/share/keyrings/
cd /var/cudnn-local-repo-ubuntu2204-8.9.7.29
sudo dpkg -i libcudnn8_8.9.7.29-1+cuda11.8_amd64.deb
sudo dpkg -i libcudnn8-dev_8.9.7.29-1+cuda11.8_amd64.deb
sudo dpkg -i libcudnn8-samples_8.9.7.29-1+cuda11.8_amd64.debcp -r /usr/src/cudnn_samples_v8/ $HOME
cd  $HOME/cudnn_samples_v8/mnistCUDNN
make clean && make
./mnistCUDNN方法二(建议使用):
tar -xzf cudnn-linux-x86_64-8.9.7.29_cuda11-archive.tar.xz
cp cudnn-linux-x86_64-8.9.7.29_cuda11-archive/include/cudnn.h /usr/local/cuda/include
cp cudnn-linux-x86_64-8.9.7.29_cuda11-archive/lib64/libcudnn* /usr/local/cuda/lib64
chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

安装nccl

NCCL下载地址:NVIDIA Collective Communications Library (NCCL) | NVIDIA Developer

下载地址:
https://developer.nvidia.com/nccl/nccl-legacy-downloadssudo dpkg -i  nccl-local-repo-ubuntu2204-2.14.3-cuda11.7_1.0-1_amd64.debsudo cp /var/nccl-local-repo-ubuntu2204-2.14.3-cuda11.7/nccl-local-F0C3C384-keyring.gpg     /usr/share/keyrings/sudo apt install libnccl2 libnccl-devsudo apt update

官方教程地址:https://docs.nvidia.com/deeplearning/nccl/install-guide/#down
3.1. Ubuntu
Installing NCCL on Ubuntu requires you to first add a repository to the APT system containing the NCCL packages, then installing the NCCL packages through APT. There are two repositories available; a local repository and a network repository. Choosing the latter is recommended to easily retrieve upgrades when newer versions are posted.
In the following commands, please replace with your CPU architecture: x86_64, ppc64le, or sbsa, and replace with the Ubuntu version, for example ubuntu1604, ubuntu1804, or ubuntu2004.
Install the repository.
For a local NCCL repository:
sudo dpkg -i nccl-repo-.deb
Note:
The local repository installation will prompt you to install the local key it embeds and with which packages are signed. Make sure to follow the instructions to install the local key, or the install phase will fail later.

For the network repository:
wget https://developer.download.nvidia.com/compute/cuda/repos///cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
Update the APT database:
sudo apt update
Install the libnccl2 package with APT. Additionally, if you need to compile applications with NCCL, you can install the libnccl-dev package as well:
Note: If you are using the network repository, the following command will upgrade CUDA to the latest version.
sudo apt install libnccl2 libnccl-dev
If you prefer to keep an older version of CUDA, specify a specific version, for example:
sudo apt install libnccl2=2.4.8-1+cuda10.0 libnccl-dev=2.4.8-1+cuda10.0
Refer to the download page for exact package versions.

## 安装miniconda

chop@zhangjiapeng:~$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_23.11.0-1-Linux-x86_64.sh
–2024-04-19 16:41:15-- https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_23.11.0-1-Linux-x86_64.sh
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)… 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 131882602 (126M) [application/octet-stream]
Saving to: ‘Miniconda3-py38_23.11.0-1-Linux-x86_64.sh’

Miniconda3-py38_23.11.0-1-Linux-x86_64. 100%[=============================================================================>] 125.77M 378KB/s in 5m 28s

2024-04-19 16:46:43 (393 KB/s) - ‘Miniconda3-py38_23.11.0-1-Linux-x86_64.sh’ saved [131882602/131882602]

chop@zhangjiapeng:~$ bash Miniconda3-py38_23.11.0-1-Linux-x86_64.sh

Welcome to Miniconda3 py38_23.11.0-1

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue

======================================
End User License Agreement - Miniconda

Copyright 2015-2023, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

This End User License Agreement (the “Agreement”) is a legal agreement between you and Anaconda, Inc. (“Anaconda”) and governs your use of Miniconda.

Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, non-transferable license to:

  • Install and use the Miniconda,
  • Modify and create derivative works of sample source code delivered in Miniconda subject to the Terms of Service for the Repository (as defined hereinafter
    ) available at https://www.anaconda.com/terms-of-service, and
  • Redistribute code files in source (if provided to you by Anaconda as source) and binary forms, with or without modification subject to the requirements se
    t forth below.

Anaconda may, at its option, make available patches, workarounds or other updates to Miniconda. Unless the updates are provided with their separate governing
terms, they are deemed part of Miniconda licensed to you as provided in this Agreement. This Agreement does not entitle you to any support for Miniconda.

Anaconda reserves all rights not expressly granted to you in this Agreement.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
    other materials provided with the distribution.
  • Neither the name of Anaconda nor the names of its contributors may be used to endorse or promote products derived from this software without specific prio
    r written permission.

You acknowledge that, as between you and Anaconda, Anaconda owns all right, title, and interest, including all intellectual property rights, in and to Minicon
da and, with respect to third-party products distributed with or through Miniconda, the applicable third-party licensors own all right, title and interest, in
cluding all intellectual property rights, in and to such products. If you send or transmit any communications or materials to Anaconda suggesting or recommend
ing changes to the software or documentation, including without limitation, new features or functionality relating thereto, or any comments, questions, sugges
tions or the like (“Feedback”), Anaconda is free to use such Feedback. You hereby assign to Anaconda all right, title, and interest in, and Anaconda is free t
o use, without any attribution or compensation to any party, any ideas, know-how, concepts, techniques or other intellectual property rights contained in the
Feedback, for any purpose whatsoever, although Anaconda is not required to use any Feedback.

DISCLAIMER

THIS SOFTWARE IS PROVIDED BY ANACONDA AND ITS CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIE
S OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANACONDA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS IN
TERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY W
AY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TO THE MAXIMUM EXTENT PERMITTED BY LAW, ANACONDA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY
LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS AGREEME
NT OR THE USE OR PERFORMANCE OF MINICONDA, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEG
LIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY. IN NO EVENT WILL THE TOTAL CUMULATIVE LIABILITY OF ANACONDA AND ITS AFFILIATE
S UNDER OR ARISING OUT OF THIS AGREEMENT EXCEED 10.00 U.S. DOLLARS.

Miscellaneous

If you want to terminate this Agreement, you may do so by discontinuing use of Miniconda. Anaconda may, at any time, terminate this Agreement and the license
granted hereunder if you fail to comply with any term of this Agreement. Upon any termination of this Agreement, you agree to promptly discontinue use of the
Miniconda and destroy all copies in your possession or control. Upon any termination of this Agreement all provisions survive except for the licenses granted
to you.

This Agreement is governed by and construed in accordance with the internal laws of the State of Texas without giving effect to any choice or conflict of law
provision or rule that would require or permit the application of the laws of any jurisdiction other than those of the State of Texas. Any legal suit, action,
or proceeding arising out of or related to this Agreement or the licenses granted hereunder by you must be instituted exclusively in the federal courts of th
e United States or the courts of the State of Texas in each case located in Travis County, Texas, and you irrevocably submit to the jurisdiction of such court
s in any such suit, action, or proceeding.

Notice of Third Party Software Licenses

Miniconda provides access to a repository (the “Repository”) which contains software packages or tools licensed on an open source basis from third parties and
binary packages of these third party tools. These third party software packages or tools are provided on an “as is” basis and are subject to their respective
license agreements as well as this Agreement and the Terms of Service for the Repository located at https://www.anaconda.com/terms-of-service; provided, howe
ver, no restriction contained in the Terms of Service shall be construed so as to limit Your ability to download the packages contained in Miniconda provided
you comply with the license for each such package. These licenses may be accessed from within the Miniconda software[1] or https://www.anaconda.com/legal. Inf
ormation regarding which license is applicable is available from within many of the third party software packages and tools and at https://repo.anaconda.com/p
kgs/main/ and https://repo.anaconda.com/pkgs/r/. Anaconda reserves the right, in its sole discretion, to change which third party tools are included in the Re
pository accessible through Miniconda.

Intel Math Kernel Library

Miniconda provides access to re-distributable, run-time, shared-library files from the Intel Math Kernel Library (“MKL binaries”).

Copyright 2018 Intel Corporation. License available at https://software.intel.com/en-us/license/intel-simplified-software-license (the “MKL License”).

You may use and redistribute the MKL binaries, without modification, provided the following conditions are met:

  • Redistributions must reproduce the above copyright notice and the following terms of use in the MKL binaries and in the documentation and/or other materia
    ls provided with the distribution.
  • Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from the MKL binaries without specific prior w
    ritten permission.
  • No reverse engineering, decompilation, or disassembly of the MKL binaries is permitted.

You are specifically authorized to use and redistribute the MKL binaries with your installation of Miniconda subject to the terms set forth in the MKL License
. You are also authorized to redistribute the MKL binaries with Miniconda or in the Anaconda package that contains the MKL binaries. If needed, instructions f
or removing the MKL binaries after installation of Miniconda are available at https://docs.anaconda.com.

cuDNN Software

Miniconda also provides access to cuDNN software binaries (“cuDNN binaries”) from NVIDIA Corporation. You are specifically authorized to use the cuDNN binarie
s with your installation of Miniconda subject to your compliance with the license agreement located at https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/inde
x.html. You are also authorized to redistribute the cuDNN binaries with an Miniconda package that contains the cuDNN binaries. You can add or remove the cuDNN
binaries utilizing the install and uninstall features in Miniconda.

cuDNN binaries contain source code provided by NVIDIA Corporation.

Arm Performance Libraries

Arm Performance Libraries (Free Version): Anaconda provides access to software and related documentation from the Arm Performance Libraries (“Arm PL”) provide
d by Arm Limited. By installing or otherwise accessing the Arm PL, you acknowledge and agree that use and distribution of the Arm PL is subject to your compli
ance with the Arm PL end user license agreement located at: https://developer.arm.com/tools-and-software/server-and-hpc/downloads/arm-performance-libraries/eu
la.

Export; Cryptography Notice

You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end us
ers, and end use. Miniconda includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, a
nd/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country’s laws, regulations and policies c
oncerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See the Wassenaar Arrangement http://www.wassenaa
r.org/ for more information.

Anaconda has self-classified this software as Export Commodity Control Number (ECCN) EAR99, which includes mass market information security software using or
performing cryptographic functions with asymmetric algorithms. No license is required for export of this software to non-embargoed countries.

The Intel Math Kernel Library contained in Miniconda is classified by Intel as ECCN 5D992.c with no license required for export to non-embargoed countries.

The following packages listed on https://www.anaconda.com/cryptography are included in the Repository accessible through Miniconda that relate to cryptography
.

Last updated March 21, 2022

Do you accept the license terms? [yes|no]

yes

Miniconda3 will now be installed into this location:
/home/chop/miniconda3

  • Press ENTER to confirm the location
  • Press CTRL-C to abort the installation
  • Or specify a different location below

[/home/chop/miniconda3] >>>
PREFIX=/home/chop/miniconda3
Unpacking payload …

Installing base environment…

Downloading and Extracting Packages:

Downloading and Extracting Packages:

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you’d prefer that conda’s base environment not be activated on startup,
run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running conda init --reverse $SHELL? [yes|no]
[no] >>> yes
no change /home/chop/miniconda3/condabin/conda
no change /home/chop/miniconda3/bin/conda
no change /home/chop/miniconda3/bin/conda-env
no change /home/chop/miniconda3/bin/activate
no change /home/chop/miniconda3/bin/deactivate
no change /home/chop/miniconda3/etc/profile.d/conda.sh
no change /home/chop/miniconda3/etc/fish/conf.d/conda.fish
no change /home/chop/miniconda3/shell/condabin/Conda.psm1
no change /home/chop/miniconda3/shell/condabin/conda-hook.ps1
no change /home/chop/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change /home/chop/miniconda3/etc/profile.d/conda.csh
modified /home/chop/.bashrc

> For changes to take effect, close and re-open your current shell. <

Thank you for installing Miniconda3!

/home/chop/miniconda3/shell/condabin/Conda.psm1
no change     /home/chop/miniconda3/shell/condabin/conda-hook.ps1
no change     /home/chop/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change     /home/chop/miniconda3/etc/profile.d/conda.csh
modified      /home/chop/.bashrc==> For changes to take effect, close and re-open your current shell. <==Thank you for installing Miniconda3!

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

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

相关文章

ubuntu扩展根目录磁盘空间

ubuntu扩展根目录磁盘空间 扩展虚拟机磁盘空间 查看现有磁盘状态 查询现有分区状态&#xff0c;/dev/sda是我们要扩展的磁盘 fdisk -l 开始进行磁盘空间的扩容 parted /dev/sda#扩展3号分区的空间 resizepart 3刷新分区空间 resize2fs /dev/sda3查询扩展结果&#xff0c;…

Java 网络编程之TCP(五):分析服务端注册OP_WRITE写数据的各种场景(一)

在前面的文章中&#xff0c;我们分析了在NIO模式下&#xff0c;服务端接收和读取多个客户端数据的情况&#xff1b; 本文&#xff0c;我们看下NIO模式下&#xff0c;使用Selector如何把数据发送给客户端。 一、直接通过java.nio.channels.SocketChannel#write(java.nio.ByteB…

Linux安装Matlab运行时

一般而言&#xff0c;安装Matlab的linux系统是带桌面版的&#xff0c;如果没带&#xff0c;不在本教程范围内。 一、下载Matlab 下载地址&#xff1a;MATLAB Runtime - MATLAB Compiler - MATLAB 本教程使用R2020b(9.9) 二、linux系统中进行解压 将zip传入linux系统&#xf…

Java23种设计模式-行为型模式之策略模式

策略模式&#xff08;Strategy Pattern&#xff09;&#xff1a;将算法的使用从算法的实现中分离出来&#xff0c;从而让算法的变化不会影响到使用算法的用户。 通常涉及三个角色&#xff1a; 1.上下文&#xff08;Context&#xff09;&#xff1a;持有策略接口的引用&#xf…

EigenLayer生态全解析:再质押与AVS崛起的序章

基于以太坊网络的再质押协议EigenLayer提出了利用为以太坊网络验证而质押的ETH来与其他协议共享安全性和资本效率&#xff0c;同时为协议参与者提供额外利息。在AVS、再质押、积分系统等概念的推动下&#xff0c;逐渐形成一个庞大的生态系统&#xff0c;从2024年初到现在EigenL…

Linux内核驱动开发-001字符设备开发-内核中断驱动独立按键

1驱动程序 /*************************************************************************> File Name: key_enit.c> Author: yas> Mail: rage_yashotmail.com> Created Time: 2024年04月22日 星期一 20时20分42秒**********************************************…

使用JS代理 实现大对象的功能拆解

序言 在Android开发中&#xff0c;可以通过webView的addJavascriptInterface方法注入一个对象到网页中。但是随着开发的需求越来越多。这个对象身上的方法也越来越多。这个对象对应的java类&#xff0c;体积越来越大&#xff0c;不利于维护。为了在不影响之前代码的基础上。把…

【C++干货基地】深度理解C++中的高效内存管理方式 new delete

&#x1f3ac; 鸽芷咕&#xff1a;个人主页 &#x1f525; 个人专栏: 《C干货基地》《粉丝福利》 ⛺️生活的理想&#xff0c;就是为了理想的生活! 引入 哈喽各位铁汁们好啊&#xff0c;我是博主鸽芷咕《C干货基地》是由我的襄阳家乡零食基地有感而发&#xff0c;不知道各位的…

Golang基础5-指针、结构体、方法、接口

指针 和c/c类似&#xff0c;但是go语言中指针不能进行偏移和运算&#xff0c;安全指针 &&#xff08;取地址) *(根据地址取值) nil(空指针&#xff09; make和new之前对比&#xff1a;make用于初始化slice&#xff0c;map&#xff0c;channel这样的引用类型 而new用于类…

Metasploit Framework(MSF)从入门到实战(一)

MSF的简介 目前最流行、最强大、最具扩展性的渗透测试平台软件 基于Metasploit进行渗透测试和漏洞分析的流程和方法 2003年由HD More发布第一版&#xff0c;2007年用ruby语言重写 架集成了渗透测试标准 (PETS&#xff09; 思想 一定程度上统一了渗透测试和漏洞研究的工作环…

针孔相机模型原理坐标系辨析内参标定流程内参变换

针孔相机的内参标定 针孔相机原理真空相机模型图片的伸缩和裁剪变换 内参标定———非线性优化张正定标定详细原理(含公式推导)通过多张棋盘格照片完成相机的内参标定流程(C代码)其他工具箱 相机分为短焦镜头和长焦镜头&#xff0c;短焦镜头看到的视野更广阔&#xff0c;同样距…

Debian常用命令

Debian是一种常见的Linux发行版&#xff0c;以下是一些常用的Debian命令&#xff1a; 1. apt-get&#xff1a;用于安装、升级和删除软件包。例如&#xff1a;apt-get install package_name。 2. dpkg&#xff1a;用于管理Debian软件包。例如&#xff1a;dpkg -i package_name…

白平衡简介

文章目录 白平衡的概念白平衡的调节常见的白平衡模式 白平衡的概念 白平衡是指摄影、摄像和显示技术中的一项重要概念&#xff0c;用于调节图像中的白色或中性灰色的色彩&#xff0c;使其看起来在不同光源条件下都是准确的白色或灰色。白平衡的主要目的是确保图像的色彩准确性…

C语言 | Leetcode C语言题解之第49题字母异位词分组

题目&#xff1a; 题解&#xff1a; /*1.将字符串原串与副本进行绑定成一个节点2.对字符串副本进行按ascii码表进行从小到大排序3.按照字符串进行比较排序4.合并 */ typedef struct Node{char*s;char*s_vice;int len; }Node;void sortShellChar(char*s,int len){for(int dista…

TS类型断言

类型断言&#xff08;Type Assertions&#xff09;在 TypeScript 中确实是一种在表达式级别上临时指定类型的机制&#xff0c;它允许开发者在编译时覆盖编译器的类型推断结果。类型断言有两种语法形式&#xff1a; “尖括号”语法&#xff1a; let someValue: any this is a s…

查找总价格为目标值的两个商品 ---- 双指针

题目链接 题目: 分析: 解法一: 暴力解法, 将每两个的和都算出来, 判断是否为目标值解法二: 数组中的数是按升序排序的, 我们可以定义左右指针 如果和小于目标值, 则应该让和变大, 所以左指针右移如果和大于目标值, 则应该让和变小, 所以右指针左移 思路: 定义left 0, righ…

python学习29:python中的字典dict

python中的字典dict 1.字典的定义&#xff1a; 同样是使用{},不过存储的元素是一个个的&#xff1a;键值对&#xff0c;如下语法&#xff1a; """ 字典的定义&#xff1a; #定义字典字面量&#xff1a;{key:value,key:value,....,key:value} #定义字典变量&am…

每天一个数据分析题(二百九十)——直方图与条形图

关于直方图与条形图的描述&#xff0c;下列说法正确的是&#xff08;&#xff09; A. 直方图用于展示分类型数据的分布情况 B. 直方图用来展示数值型数据的分布情况 C. 条形图只能用于展示顺序型数据的分布情况 D. 条形图只能用于展示分类型数据的分布情况 题目来源于CDA模…

绝地求生【商城更新】WIA联名上架//专属商店下架

大家好&#xff0c;我是闲游盒. 本周商城将在4.24&#xff08;周三&#xff09;更新&#xff0c;商城内容更新如下&#xff1a; 上架物品 ▲W.I.A联名皮肤大礼包 小礼包如下&#xff1a; 包含3套衣服以及MINI、DBS的联名皮肤&#xff0c;3个头饰还挺有特色的&#xff0c;你喜欢…

链栈算法库构建

学习贺利坚老师, 链栈 , 构建链栈算法库 数据结构之自建算法库——链栈_领会链栈结构和掌握链栈中的各种基本算法-CSDN博客文章浏览阅读3.9k次&#xff0c;点赞3次&#xff0c;收藏8次。本文针对数据结构基础系列网络课程(3)&#xff1a;栈和队列中第4课时栈的链式存储结构及其…