conda 安装 cudatoolkit cudatoolkit-dev nvcc 的方法

还在为以下问题烦恼?
raise OSError('CUDA_HOME environment variable is not set. ’
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

conda install cudatoolkit -c conda-forge 找不到指定版本?
找不到cusolver.h
等等等等
。。。

nvidia现在官方提供了一键安装所有cuda依赖,再也不需要自己去单独安装cudatoolkit cudatoolkit-dev等等依赖了
命令如下,记得指定版本
conda install nvidia::cuda

其他问题

  1. docker安装完后只能通过root运行,让普通用户也能运行docker
    sudo usermod -aG docker $USER
    来源vscode

  2. ubuntu20 卸载了docker-desktop,重新安装docker后出现普通用户用不了docker的问题,错误显示如下
    Cannot connect to the Docker daemon at unix:///home//.docker/desktop/docker.sock. Is the docker daemon running?
    直接删除
    rm -r /home/$USER/.docker
    来源stackoverflow

  3. 修改docker port映射
    You can change the port mapping by directly editing the hostconfig.json file at /var/lib/docker/containers/[hash_of_the_container]/hostconfig.json

  4. vnc 初始化错误
    输入 vncserver 报错
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = “en_US.UTF-8”
    are supported and installed on your system.
    perl: warning: Falling back to the standard locale (“C”).
    vncserver: The USER environment variable is not set.
    解决位置问题:reference
    export LC_ALL=C
    解决vncserver: The USER environment variable is not set. 问题:reference
    USER=yourusername vncserver
    ?使用非root来运行vncserver

如果 view only passward设错了通过下面这个命令来修改
vncpasswd

新增用户 :
sudo adduser newuser
ubuntu 新增user后,使他可以用sudo:
usermod -aG sudo limstorm

Open file

su root 
nano /etc/sudoers
Then add the user below admin user like below syntax.

user_name ALL=(ALL)  ALL

docker安装gui界面
参考 https://www.cnblogs.com/limstorm/p/17320144.html
注意:
解决locale问题
apt-get install language-pack-en-base

解决 Failed to close file descriptor for child process (Operation not permitted) 问题
–security-opt seccomp=unconfined

按照mediapipe官方docker运行,安装opencv会有问题:需要修改
libdc1394-22-dev ==> libdc1394-dev

Logo

欢迎来到由智源人工智能研究院发起的Triton中文社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。

更多推荐