当前位置: 首页> 科技> IT业 > 网页设计与制作的原则_沈阳图书设计公司_查域名备案_免费快速网站

网页设计与制作的原则_沈阳图书设计公司_查域名备案_免费快速网站

时间:2025/7/11 23:24:08来源:https://blog.csdn.net/qq_38628046/article/details/139002782 浏览次数:0次
网页设计与制作的原则_沈阳图书设计公司_查域名备案_免费快速网站

Unborn安装CUDA Toolkit 12.2

  • Unborn安装CUDA Toolkit
    • 前言
    • 下载
    • 安装
    • 配置
    • 验证

Unborn安装CUDA Toolkit

前言

今天在某台Unborn系统上安装某个依赖库时,提示环境中缺少CUDA_HOME环境变量,导致在安装某些依赖时出现问题。具体异常如下:

Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting flash_attnDownloading https://mirrors.aliyun.com/pypi/packages/72/94/06f618bb338ec7203b48ac542e73087362b7750f9c568b13d213a3f181bb/flash_attn-2.5.8.tar.gz (2.5 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 1.6 MB/s eta 0:00:00Preparing metadata (setup.py) ... errorerror: subprocess-exited-with-error× python setup.py egg_info did not run successfully.│ exit code: 1╰─> [20 lines of output]fatal: not a git repository (or any of the parent directories): .git/tmp/pip-install-fg7pt8f4/flash-attn_1e4c76d3ba9f4a5d968930613e3c4bd7/setup.py:78: UserWarning: flash_attn was requested, but nvcc was not found.  Are you sure your environment has nvcc available?  If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.warnings.warn(Traceback (most recent call last):File "<string>", line 2, in <module>File "<pip-setuptools-caller>", line 34, in <module>File "/tmp/pip-install-fg7pt8f4/flash-attn_1e4c76d3ba9f4a5d968930613e3c4bd7/setup.py", line 134, in <module>CUDAExtension(File "/usr/local/program/miniconda3/envs/llama3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1077, in CUDAExtensionlibrary_dirs += library_paths(cuda=True)File "/usr/local/program/miniconda3/envs/llama3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1204, in library_pathsif (not os.path.exists(_join_cuda_home(lib_dir)) andFile "/usr/local/program/miniconda3/envs/llama3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2419, in _join_cuda_homeraise OSError('CUDA_HOME environment variable is not set. 'OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.torch.__version__  = 2.3.0+cu121[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed× Encountered error while generating package metadata.
╰─> See above for output.note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

下载

访问https://developer.nvidia.com/cuda-toolkit-archive

在这里插入图片描述
执行nvidia-smi命令,查看GPU的驱动与CUDA版本
在这里插入图片描述
由于GPU自身CUDA版本是12.2,因此这里选择下载CUDA Toolkit 12.2

这里选择:Linux系统、x86_64架构、Ubuntu系统、系统版本22.04、runfile(local)安装方式

在这里插入图片描述
同时页面下方也给出了安装说明
在这里插入图片描述

安装

下载与执行安装

wget https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.runsudo sh cuda_12.2.0_535.54.03_linux.run

选择Continue后回车
在这里插入图片描述
输入accept接受
在这里插入图片描述
取消Drive驱动的安装,默认勾选(x),取消后选择Install进行安装。
在这里插入图片描述
出现如下日志,表示安装成功

===========
= Summary =
===========Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-12.2/Please make sure that-   PATH includes /usr/local/cuda-12.2/bin-   LD_LIBRARY_PATH includes /usr/local/cuda-12.2/lib64, or, add /usr/local/cuda-12.2/lib64 to /etc/ld.so.conf and run ldconfig as rootTo uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-12.2/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 535.00 is required for CUDA 12.2 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

配置

编辑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/cuda

验证

查看cuda是否安装成功

root@master:~# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0
关键字:网页设计与制作的原则_沈阳图书设计公司_查域名备案_免费快速网站

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: