将BIOS+MBR启动的ubuntu20.4虚拟机转为EFI模式启动

首先修改虚拟机的启动模式为EFI,直接开不了机了,提示没有引导项目
需要将MBR引导的安装盘转换为EFI引导
处理步骤:
1.将MBR转换为GPT格式
a.使用国产的傲梅分区助手无损转换MBR到GPT
先安装一个Win10虚拟机,然后安装上傲梅分区助手
将ubuntu虚拟机的主盘挂载到新安装的虚拟机上,运行分区助手,执行到GPT的转换
(如果已经做过快照不要用这种方法,否则转换后虚拟机启动不来,会提示盘数据有修改之类的错)
b.使用微软的自动修复
先安装一个windows 10虚拟机,关机后,将这个启动盘挂载到ubuntu20.4这台虚拟机下
启动虚拟机,进入efi引导界面,选择新挂载的这个windows 10盘启动,
启动过程中windows会提示修复,执行修复就好

以上两个都是利用Windws系统做中转,
需要先将虚拟机中挂载的硬盘从SCIS控制器转换到SATA控制器下
否则会有异常,要么不认到盘,要么启动失败,不能正常进入windows

2. 执行boot-repair修复EFI引导
先在ubuntu20.4这台虚拟机上挂载ubuntu20.4的安装盘
开机启动,用光盘引导,选择try ubuntu 进入界面
先在应用中搜索执行 disk 磁盘工具,查看盘的现有分区信息,先确认已经是GPT格式,然后看分区的分区类型信息
如果已经是EFI分区,则不做操作否则需要做如下修改分区类型信息的操作
修改第一个FAT32的分区为 EFI System分区类型,修改名称为 EFI System Partition
修改第二个Ext4的分区为 Linux Filesystem分区类型

开一个terminal终端界面,执行如下命令

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

出现界面后,一般选择第一个Recommended repair,可以完成修复(按照界面提示,中间还有一两次需要执行命令行命令)
如果修复失败,按照提示做补充修订,使符合修复条件(一般是EFI分区没有处理好)
××××
click on “Advanced options”, go to the “GRUB location” tab.

If you do not see a “Separate /boot/efi partition” line, this means that your PC does not have any UEFI partition.
In this case, exit Boot-Repair, then create an UEFI partition (see the “Creating an UEFI partition” paragraph above).
If you see a “Separate /boot/efi partition” line, tick it then click the “Apply” button.
Set up your BIOS so that it boots the HDD in UEFI mode (see the “”Set up the BIOS in UEFI or Legacy mode” paragraph above).

Popularity: 1% [?]

Random Posts

ESXI中安装A5000显卡的一些注意事项

将A5000显卡直通到ubuntu20.4虚拟机后,虚拟机直接打开电源失败,需要在虚拟机配置的高级选项中添加如下配置值

pciPassthru.use64bitMMIO=TRUE
pciPassthru.64bitMMIOSizeGB=64

添加这个选项后,虚拟机可以开机启动,但是安装nvidia驱动后,通过nvidia-smi找不到A5000显卡,
一通折腾后,最后发现虚拟机需要以EFI模式启动,否则A5000卡不可用
将虚拟机的引导模式有MBR转换为GPT,然后使用boot-repair修复引导,以EFI模式重新启动虚拟机后再次安装显卡驱动,
使用nvidia-smi命令果然正常识别显示出来A5000卡
装显卡驱动几个点:

#禁用nouveau
sudo vi /etc/modprobe.d/blacklist.conf
#末尾添加
blacklist nouveau
options nouveau modeset=0
#保存后执行
sudo update-initramfs -u

#卸载之前的驱动
sudo apt-get remove --purge nvidia*

#执行nvidia的安装程序
sudo ./cuda_12.5.0_555.42.02_linux.run

安装驱动时注意不要安装任何 OpenGL文件,否则启动桌面时登录后会闪退到登录界面

Popularity: 1% [?]

Random Posts

虚拟机中Ubuntu更换内核版本后,分辨率最高只有1176×885的修复

手快,虚拟机中的ubuntu20.4升级内核后,不能满屏显示,查看了下最大显示只到 1176×885, 重装vmtools等都不起作用,

https://blog.csdn.net/qq_57973134/article/details/135183574

碰到的同样问题,使用其方法,修改 vmx 文件,将

svga.guestBackedPrimaryAware = "TRUE"

一行注释掉或删除后,重启,果然恢复了全屏显示能力。

Popularity: 1% [?]

Random Posts

ESXI挂载已经存在VMFS的盘

将另一台ESXI主机上拆下的盘接上,结果发现在存储列表中没有出现,需要注册挂载一下:
打开ESXI主机的ssh服务,登录上去使用如下一些命令行处理:
首先查看未挂载存储信息

 esxcli storage vmfs snapshot list

大约看到如下信息

580730ac-0d329d83-96d1-000af785e2ec
   Volume Name: datastore1 (2)
   VMFS UUID: 580730ac-0d329d83-96d1-000af785e2ec
   Can mount: true
   Reason for un-mountability:
   Can resignature: true
   Reason for non-resignaturability:
   Unresolved Extent Count: 1

记录下Volume Name值,使用下面的命令做挂载:

 esxcfg-volume -M "datastore1 (2)"

回到ESXI的控制台界面,在存储列表中已经列出来,
再在ESXI中将这个盘中存储的虚拟机逐个注册起来

Popularity: 1% [?]

Random Posts

ubuntu下运行p4v报错Could not load the Qt platform plugin “xcb” in “” even though it was found的问题解决

在ubuntu20.4上运行下载的p4v-2024.2版本p4v,报如下错误:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, offscreen, vnc, xcb.

按照官方排错方法,执行如下顺序的代码找到缺少的库,安装上即可:

$cd ~/p4v-2024.2.2634463/lib
$ export LD_LIBRARY_PATH=`pwd`
$ cd plugins/platforms
$ ldd libqxcb.so | grep "not found"
	libxcb-cursor.so.0 => not found
	libxcb-cursor.so.0 => not found

执行

sudo apt install libxcb-cursor0

重新运行解决问题

注:官方推荐使用命令

sudo apt search libxcb-cursor.so.0

找到缺少的库所在的包,但是我执行后没有找到任何数据,替换使用

sudo apt list |grep libxcb-cursor

命令找到包名称,但这种方法可能不通用

Popularity: 7% [?]

Random Posts

Ubuntu20.4 安装Cuda 碰到ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol ‘rcu_read_unlock_strict’

在ubuntu20.4上安装之前下载的cuda安装包,一直失败,查看/var/log/nvidia-installer.log 发现最后有错误 ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol ‘rcu_read_unlock_strict’

按照网上一些方法操作都没有成功,
1.将默认gcc9换成gcc7
2.更新安装核心驱动头文件
3….

最后处理方法
添加 /etc/modprobe.d/blacklist-nvidia-nouveau.conf
内容如下
blacklist nouveau
options nouveau modeset=0

然后到cuda官网重新下载最新的安装包
wget https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda_12.5.0_555.42.02_linux.run

wget https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_560.28.03_linux.run

重新安装,一切正常,没有再报错,通过 nvidia-smi 可以正常看到显卡信息

注意:为了顺利安装使用cuda,安装使用ubuntu系统时,不要选择升级系统,运行中也不要升级ubuntu系统,否则可能会有一堆核心文件不匹配造成的安装不了,运行不正常等问题。
官方安装说明中可以查看安装文件的系统兼容性说明

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

Popularity: 7% [?]

Random Posts

Hugging Face包安装碰到的一些问题

为了尝试体验AI模型,需要到hugging face下载模型数据,在机器上安装了一下hugging face支持包,碰到如下一些问题
1. Cargo, the Rust package manager, is not installed or is not on PATH
解决方法安装rust curl https://sh.rustup.rs -sSf |sh

2. error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
–> tokenizers-lib\src\models\bpe\trainer.rs:526:47
|
522 | let w = &words[*i] as *const _ as *mut _;
| ——————————– casting happend here …
526 | let word: &mut Word = &mut (*w);
| ^^^^^^^^^
|
= note: for more information, visit
= note: `#[deny(invalid_reference_casting)]` on by default
网上搜索尝试的方法
降级rust版本,失败
!rustup toolchain install 1.72.0
!rustup default 1.72.0
!rustc –version
卸载transfer,安装指定版本,失败
!pip install -U transformers
!pip install –upgrade transformers==4.06 –verbose
解决方法,先单独安装 tokenizers 库 pip install tokenizers 问题消失

Popularity: 9% [?]

Random Posts

各版本gcc对C++标准的支持情况

GCC所有版本支持C++和C语言情况

版本

发布时间

默认支持C标准

默认支持C++标准

GCC 13.1

April 26, 2023

C17

C++17

GCC 12.2

August 19, 2022

C17

C++17

GCC 10.4

June 28, 2022

C17

C++14

GCC 9.5

May 27, 2022

C17

C++14

GCC 12.1

May 6, 2022

C17

C++14

GCC 11.3

April 21, 2022

C17

C++17

GCC 11.2

July 28, 2021

C17

C++17

GCC 9.4

June 1, 2021

C17

C++14

GCC 8.5

May 14, 2021

C17

C++14

GCC 11.1

April 27, 2021

C17

C++17

GCC 10.3

April 8, 2021

C17

C++14

GCC 10.2

July 23, 2020

C17

C++14

GCC 10.1

May 7, 2020

C17

C++14

GCC 9.3

March 12, 2020

C17

C++14

GCC 8.4

March 4, 2020

C17

C++14

GCC 7.5

November 14, 2019

C11

C++14

GCC 9.2

August 12, 2019

C17

C++14

GCC 9.1

May 3, 2019

C17

C++14

GCC 8.3

February 22, 2019

C17

C++14

GCC 7.4

December 6, 2018

C11

C++14

GCC 6.5

October 26, 2018

C11

C++98

GCC 8.2

July 26, 2018

C17

C++14

GCC 8.1

May 2, 2018

C17

C++14

GCC 7.3

January 25, 2018

C11

C++14

GCC 5.5

October 10, 2017

C11

C++98

GCC 7.2

August 14, 2017

C11

C++14

GCC 6.4

July 4, 2017

C11

C++14

GCC 7.1

May 2, 2017

C11

C++14

GCC 6.3

December 21, 2016

C11

C++14

GCC 6.2

August 22, 2016

C11

C++14

GCC 4.9.4

August 3, 2016

C90

C++98

GCC 5.4

June 3, 2016

C11

C++98

GCC 6.1

April 27, 2016

C11

C++14

GCC 5.3

December 4, 2015

C11

C++98

GCC 5.2

July 16, 2015

C11

C++98

GCC 4.9.3

June 26, 2015

C90

C++98

GCC 4.8.5

June 23, 2015

C90

C++98

GCC 5.1

April 22, 2015

C90

C++98

GCC 4.8.4

December 19, 2014

C90

C++98

GCC 4.9.2

October 30, 2014

C90

C++98

GCC 4.9.1

July 16, 2014

C90

C++98

GCC 4.7.4

June 12, 2014

C90

C++98

GCC 4.8.3

May 22, 2014

C90

C++98

GCC对C++版本迭代支持情况

C++版本

GCC版本支持情况

GCC版本

指定版本的命令标志

C++98

完全支持

从GCC6.1之前版本的默认模式

-std=c++98 or std=gnn++98

C++11

完全支持

从GCC4.8.1版本完全支持

-std=c++11 or std=gnu++11

C++14

完全支持

从GCC6.1版本开始完全支持,从6.1-10(包括)的默认模式

-std=c++14 or std=gnu++14

C++17

完全支持

从GCC 5版本开始支持,到GCC 7版本已完全支持,是GCC 11到13版本的默认模式

-std=c++17 or std=gnu++17

C++20

未完全支持

从GCC 8版本开始支持

-std=c++20 or

std=gnu++20(GCC 9以及之前版本使用-std=c++2a)

C++23

未完全支持(标准开发中)

从GCC 11版本开始支持

-std=c++2b or

std=gnu++2b

Popularity: 10% [?]

Random Posts

给CentOS6添加高版本gcc8支持

先换yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

如果没有安装 centos-release-scl 工具包,可以使用如下方式先装它 (或在Extra光盘上找到它做安装)
wget https://copr.fedorainfracloud.org/coprs/rhscl/centos-release-scl/repo/epel-6/rhscl-centos-release-scl-epel-6.repo -O /etc/yum.repos.d/centos-release-scl.repo
yum install centos-release-scl

设置devtoolset-8的源信息
wget https://copr.fedorainfracloud.org/coprs/mayeut/devtoolset-8/repo/epel-6/mayeut-devtoolset-8-epel-6.repo -O /etc/yum.repos.d/devtoolset-8.repo
安装devtoolset-8-toolchain
yum install devtoolset-8-toolchain
安装过程中提示依赖包 strace 失败通不过,使用下面命令安装必须的编译器部分
yum install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils

启用它
scl enable devtoolset-8 bash

启用后,cmake未能正确识别新的gcc版本,可以在使用cmake时添加上命令行参数 -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-8/root/usr/bin/g++

Popularity: 10% [?]

Random Posts

“no space left on device”问题解决

一台服务器上服务起不来,看日志报错 “no space left on device”

利用

df -h

查看,发现硬盘空间一半都没有占用到,然后使用命令

df -i

发现是inode耗光了,需要找到在哪里占用了inode
利用如下命令找到inode最多的目录,然后将 in /* 替换成 in 新目录/* 逐层找下面最多inode节点的目录

for i in /*; do echo $i; find $i | wc -l; done

最后发现是在 /var/spool/postfix/maildrop目录下,大量耗费inode,使用命令

find /var/spool/postfix/maildrop/ -type f |xargs rm -rf

删除/var/spool/postfix/maildrop目录内容

为了防止以后再出现这个问题,需要修改

/etc/crontab

MAILTO=root

修改为

MAILTO=""

然后执行

service crond restart

Popularity: 10% [?]

Random Posts

Next Page →