背景:

在实验室的集群上,有个人账号,却没有sudo权限。(也不好意思要,怕以后出问题)

安装了conda来管理虚拟环境(本来用的virtualenv,但是后来发现还是conda好,因为conda进入虚拟环境之后仍然可以使用global的一些包和命令,但是virtualenv不行,是不能见到外部的,又没有sudo权限,不能随便安装包)。

问题来源:

一些经典老代码是tensoflow1.15 这个版本只能单独安装tensoflow-gpu 而且还要搭配cuda-10.0使用,然后集群机器上的版本是10.2,所以需要自己在虚拟环境下手动安装。

首先在stackoverflow上找到了一个方法:

https://stackoverflow.com/questions/39379792/install-cuda-without-root

Update The installation UI for 10.1 changed. The following works:

  • Deselect driver installation (pressing ENTERon it)
  • Change options -> root install path to a non-sudo directory.
  • Press A on the line marked with a + to access advanced options. Deselect create symbolic link, and change the toolkit install path.
  • Now installation should work without root permissions

Thank you very much for the hints in the question! I just want to complete it with an approach that worked for me, also inspired in this gist and that hopefully helps in situations where a valid driver is installed, and installing a more recent CUDA on Linux without root permissions is still needed.

TL;DR: Here are the steps to install CUDA9+CUDNN7 on Debian, and installing a pre-compiled version of TensorFlow1.4 on Python2.7 to test that everything works. Everything without root privileges and via terminal. Should also work for other CUDA, CUDNN, TensorFlow and Python versions on other Linux systems too.


INSTALLATION

  1. Go to NVIDIA's official release web for CUDA (as for Nov. 2017, CUDA9 is out): https://developer.nvidia.com/cuda-downloads.

  2. Under your Linux distro, select the runfile (local)option. Note that the sudo indication present in the installation instructions is deceiving, since it is possible to run this installer without root permissions. On a server, one easy way is to copy the <LINK> of the Download button and, in any location of your home directory, run wget <LINK>. It will download the <INSTALLER> file.

  3. Run chmod +x <INSTALLER> to make it executable, and execute it ./<INSTALLER>.

  4. accept the EULA, say no to driver installation, and enter a <CUDA> location under your home directory to install the toolkit and a <CUDASAMPLES> for the samples.

  5. Not asked here but recommended: Download a compatible CUDNN file from the official web (you need to sign in). In my case, I downloaded the cudnn-9.0-linux-x64-v7.tgz, compatible with CUDA9 into the <CUDNN> folder. Uncompress it: tar -xzvf ....

  6. Optional: compile the samples. cd <CUDASAMPLES> && make. There are some very nice examples there and a very good starting point to write some CUDA scripts of yourself.

  7. (If you did 5.): Copy the required files from <CUDNN> into <CUDA>, and grant reading permission to user (not sure if needed):

  8. cp -P <CUDNN>/cuda/include/cudnn.h <CUDA>/include/
    cp -P <CUDNN>/cuda/lib64/libcudnn* <CUDA>/lib64
    chmod a+r <CUDA>/include/cudnn.h <CUDA>/lib64/libcudnn*
    
  9. Add the library to your environment. This is typically done adding this following two lines to your ~/.bashrc file (in this example, the <CUDA> directory was ~/cuda9/:
  10. export PATH=<CUDA>/bin:$PATH
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<CUDA>/lib64/

然后按照这个一顿操作后在命令行python 进如,输入print(tf.test.is_gpu_available()) 结果是True. 但是 运行我自己py文件的时候仍然找不到lib.so文件

很奇怪,懒得去找原因了

突然发现可以直接试试conda来安装

在虚拟环境下输入

conda install cudatoolkit==10.0

瞬间搞定。

带着镣铐跳舞:无sudo权限安装多个cuda版本相关推荐

  1. linux ubuntu安装pytorch(深度学习环境搭建记录,无sudo权限)踩坑全记录

    一些牢骚:深度学习没怎么学习几次,搭建环境已经把我搞秃了哈哈哈. 之前在网上找到的搭建环境的步骤,我没有root权限,很多操作都不行(比如运行.run文件,cuda 和cudnn的安装和修改也需要ro ...

  2. p7za无root权限安装/7z linux安装

    p7za无root权限安装/7z linux安装 最近在一个无root的服务器下载了超大的7z文件,结果解压的时候发现没有7za傻眼了,后面无root安装的时候还踩了几个坑,记录一下. 源码安装 首先 ...

  3. Linux无root权限安装cuda9.1和cudnn7.05以及编译框架时无lcuda.so的问题

    无root权限 centos 7 cuda 9.1 cudnn 7.05 for cuda 9.1 1 下载安装cuda cuda下载 https://developer.nvidia.com/cud ...

  4. Ubuntu无root权限安装miniconda到配置jupyter、GPU版本pytorch一条龙服务

    前言 倒腾学校服务器来回几次了,对学校给学生无root普通用户权限,老师要求的只能安装miniconda然后手动配jupyter.GPU版本pytorch等环境已经轻车熟路了. 如果你是老手,完全可以 ...

  5. linux下无root权限安装python2.7和pip以及安装cuda9.0,cudnn7.4,pytorch-gpu

    简介 因为自己电脑的gpu不足,想要使用学校的gpu.学校的基本配置如下 系统是centos7.3.里面有8个V100 因为没有root权限,所以只能在文件夹下安装自己的所有东西,刚开始想要安装ana ...

  6. Linux无root权限安装opencv3.4.0以及一些问题

    本文链接:https://blog.csdn.net/cowry5/article/details/80870251 本人的各种依赖的版本都很低,且无root权限,安装了很多次都失败,最后终于成功.特 ...

  7. linux无root权限安装软件

    在有些公司是不会给开发人员root权限的,但是开发人员有时候也需要装一些软件.没有root权限是否可以成功安装软件呢?答案是yes.本文以安装nginx为例说明下如何操作. 没有root权限时往往也就 ...

  8. 无root权限安装.iso软件包

    mount的使用 通常,有root权限安装.iso可以使用 mount [-t vfstype] [-o options] device dir ~~[-t vfstype] 指定文件类型,一般可以省 ...

  9. 记win10安装cupy的cuda版本成功踩得坑!!!血泪教训!!

    问题: 安装cupy踩坑总结.声明,我是菜狗子!我是菜狗子!我是菜狗子!我是菜狗子!重要的事情重复一万次!大家千万要记得,win10系统的用户名,就是你电脑的名字,千万不要带中文,千万不要带中文,千万 ...

最新文章

  1. Redis学习-String
  2. Fibonacci Sum HDU - 6755【2020 Multi-University Training Contest 1】斐波那契数列变形+二项式定理
  3. java guava限流,Guava的RateLimiter实现接口限流
  4. zabbix系统日志文件监控key
  5. 相机标定(五)—— 相机模型详细介绍
  6. 基于Vue2.x的小米商城移动端项目
  7. 通过命令行运行java出现错误: 找不到或无法加载主类 解决办法
  8. just show up失败让我们成长
  9. java求立方体表面积和体积_有关正方体、长方体表面积和体积的计算题
  10. java调用海康人脸识别机5603的sdk的使用总结(一)
  11. 【POP3协议介绍】
  12. App Tamer for mac常见问题
  13. JAVA储存_关于JAVA数据储存
  14. .dockerignore 文件从入门到实践
  15. python123第八周_GitHub - ChangYZ123/Python-100-Days: Python - 100天从新手到大师
  16. 时间都哪去了--电视连续剧《老牛家的战争》插曲【视频】
  17. linux测试读写的工具,Linux 下的硬盘读写速度测试工具
  18. 英语学习笔记——语法篇(持续更新)
  19. python中traceback获取异常信息
  20. GoF设计模式(十二) - 享元模式

热门文章

  1. FPGA中双向IO端口的应用
  2. 前端性能优化方法与实战14 高级进阶:瞒天过海的骨架屏及 SSR 优化手段
  3. c语言如何用printf输出数组,C语言如何用printf打印数组问题
  4. 译算法交易策略的成功测一
  5. 机器学习:矩阵、向量求导理解
  6. JSE基础总结2----面向对象
  7. 惊艳的功能——SOLIDWORKS装配体可视化
  8. 在cocos2d-x中使用DragonBones实现骨骼动画
  9. 通过pixhawk飞行日志读取飞行路线以及对应地图
  10. uniapp 顶部滑动状态栏加背景色