#添加修改权限 [root@localhost ~]# chmod -v u+w /etc/sudoers mode of "/etc/sudoers" changed from 0440 (r--r-----) to 0640 (rw-r-----) [root@localhost ~]# vim /etc/sudoers ## Allow root to run any commands anywher root ALL=(ALL) ALL #这个是新增的用户 common_usr1 ALL=(ALL) ALL
# 收回读写权限并登录 [root@localhost ~]# chmod -v u-w /etc/sudoers mode of "/etc/sudoers" changed from 0640 (rw-r-----) to 0440 (r--r-----) [root@localhost ~]# su common_usr1 [common_usr1@localhost ~]$
# 创建分区 (base) [root@localhost ~]# fdisk /dev/sdb 命令(输入 m 获取帮助):m 命令操作 a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) 命令(输入 m 获取帮助):n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p 分区号 (1-4,默认 1):1 起始 扇区 (2048-4294967295,默认为 2048): 将使用默认值 2048 Last 扇区, +扇区 or +size{K,M,G} (2048-4294967294,默认为 4294967294): 将使用默认值 4294967294 分区 1 已设置为 Linux 类型,大小设为 2 TiB 命令(输入 m 获取帮助):w The partition table has been altered! # 删除分区 # 删除分区前需要先umount卸载分区 [root@freeman ~]# fdisk /dev/sdb <-进入sdb硬盘 Command (m for help): p <- 输入p打印当前硬盘的分区信息 Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xcca98924 Device Boot Start End Blocks Id System /dev/sdb1 1 523 4200966 83 Linux /dev/sdb2 524 537 112455 83 Linux /dev/sdb3 538 563 208845 5 Extended /dev/sdb5 538 563 208813+ 83 Linux /dev/sdb6 409 422 112423+ 83 Linux Command (m for help): d <- 输入d删除分区 Partition number (1-5): <- 输入要删除的分区编号 ... Command (m for help): w <- 分区删除完毕,输入w,写入磁盘分区表 The partition table has been altered!
# 对新磁盘进行分区,由于fdisk仅支持2T以内的磁盘分区 (base) [root@localhost ~]# parted /dev/sdb (parted) help# 可以查看帮助信息 (parted) mklabel gpt # 执行命令mklabel gpt,把sdb改成gpt大分区格式 Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? yes (parted) mkpart primary 0 4001GB # 创建分区 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? cancel # 注意,此处提示为磁盘为对齐,会影响性能,所以在此处要进行对齐
An NVIDIA kernel module 'nvidia-uvm' appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer.
因为一些docker 容器正在使用该驱动,需要输入一下命令:
1 2 3 4
sudo service lightdm stop sudo stop nvidia-digits-server sudo service docker stop sudo rmmod nvidia-uvm
或者需要屏蔽nouveau,以及把docker采用了gpu的已有的服务关闭stop.
屏蔽nouveau
1
sudo vim /etc/modprobe.d/blacklist-nouveau.conf
加入:
1 2
blacklist nouveau options nouveau modeset=0
更新使其生效
1
sudo update-initramfs -u
修改运行级别为文本模式
1
systemctl set-default multi-user.target
重启
1
sudo reboot
检验是否生效,输入以下命令,如果无信息输出,则生效
1
lsmod | grep nouveau
查看nvidia-smi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[root@localhost sbin]# nvidia-smi Sat Oct 9 14:54:38 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Tesla V100-FHHL... Off | 00000000:AF:00.0 Off | 0 | | N/A 55C P0 32W / 150W | 12MiB / 16160MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+
Do you accept the license terms? [yes|no] Please answer 'yes' or 'no':' >>> yes Anaconda3 will now be installed into this location: /root/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/root/anaconda3] >>> /usr/local/anaconda3 PREFIX=/usr/local/anaconda3 installing: python-3.7.3-h0371630_0 ...
创建Anaconda用户组
1 2 3 4 5 6 7 8
groupadd anaconda
# 添加用户到用户组 usermod -a -G anaconda <username>
# 一号机用户组 usermod -a -G anaconda <username> usermod -a -G anaconda_back <username>
# 查看conda 环境 [myuser@Master wx]$ conda info --env WARNING: The conda.compat module is deprecated and will be removed in a future release. # conda environments: # base * /usr/local/anaconda3 myuser /usr/local/anaconda3/envs/mysuer
# 激活环境 [myuser@Master /]$ /usr/local/anaconda3/bin/conda init bash WARNING: The conda.compat module is deprecated and will be removed in a future release. no change /usr/local/anaconda3/condabin/conda no change /usr/local/anaconda3/bin/conda no change /usr/local/anaconda3/bin/conda-env no change /usr/local/anaconda3/bin/activate no change /usr/local/anaconda3/bin/deactivate no change /usr/local/anaconda3/etc/profile.d/conda.sh no change /usr/local/anaconda3/etc/fish/conf.d/conda.fish no change /usr/local/anaconda3/shell/condabin/Conda.psm1 no change /usr/local/anaconda3/shell/condabin/conda-hook.ps1 no change /usr/local/anaconda3/lib/python3.7/site-packages/xonsh/conda.xsh no change /usr/local/anaconda3/etc/profile.d/conda.csh modified /home/hisense/.bashrc
==> For changes to take effect, close and re-open your current shell. <==