lammps安装GPU成功后运行报错

报错:LAMMPS (23 Jun 2022 - Update 4)
ERROR: GPU library not compiled for this accelerator (../gpu_extra.h:61)
Last command: package gpu 0

解决方法:换驱动

Ubuntu 20.04 Nvidia驱动安装

安装过程

## 清除已安装的nvidia驱动
sudo apt-get purge nvidia*

## 加入gpu ppa
sudo add-apt-repository ppa:graphics-drivers

## 更新软件包
sudo apt-get update

## 查询支持的gpu版本
ubuntu-drivers list

## 从支持列表中安装指定版本
sudo apt install nvidia-driver-530

## 安装完成后,重启电脑
nvidia-smi
### 若打印:gpu相关信息,则表示成功了。
### 若打印:“NVIDIA-SMI has failed because it could not communicate with the NVIDIA driver.” Make sure that the latest NVIDIA driver is installed and running.
###        则表示失败了!跳到章节 “nvidia-smi”

nvidia-smi报错

网上可以看到有很多原因可能导致出现该问题。不过对于本人电脑,是由于“安全引导”导致的(参照原文:Ubuntu 20.04 Nvidia-smi didnt work),解决方法如下:Ubuntu 20.04 Nvidia-smi didnt work网上可以看到有很多原因可能导致出现该问题。不过对于本人电脑,是由于“安全引导”导致的(参照原文:),解决方法如下:

  1. 重启电脑,并进入 BIOS 设置;
  2. 在 BIOS 管理器中,将 Secure Boot 设置为 OFF;
  3. 保存并退出 BIOS;
  4. 重启电脑;
  5. nvidia-smi 正常工作
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
To run LAMMPS with GPU acceleration on Ubuntu using NVIDIA GPUs, you need to follow these steps: 1. Install NVIDIA driver: Ensure that you have the latest NVIDIA driver installed on your system. You can use the instructions provided earlier to install or update the NVIDIA driver on Ubuntu. 2. Install CUDA Toolkit: LAMMPS requires CUDA to run on GPUs. Install the CUDA Toolkit, which includes the necessary libraries and tools for GPU computing. You can download the CUDA Toolkit from the NVIDIA website and follow their installation instructions. 3. Download and compile LAMMPS: Obtain the LAMMPS source code from the official LAMMPS website or GitHub repository. Extract the source code to a directory of your choice. 4. Set up Makefile: Navigate to the LAMMPS source code directory and locate the Makefile. Open the Makefile and modify it to include GPU support. Uncomment or add the appropriate lines for GPU acceleration using CUDA. For example, you may need to set `GPU` to `yes`, specify the CUDA path, and select the appropriate CUDA architecture. 5. Compile LAMMPS: In the terminal, navigate to the LAMMPS source code directory and run `make mpi` or `make serial` depending on your desired configuration. This will compile LAMMPS with GPU support enabled. 6. Run LAMMPS with GPU acceleration: Once the compilation is complete, you can run LAMMPS with GPU acceleration by using the `lmp_mpi` or `lmp_serial` executable generated during the compilation process. Be sure to specify the appropriate input script and any necessary command-line options. For example, to run a LAMMPS input file named "input.lammps" using multiple GPUs, you can use the following command: ``` mpirun -np <number of MPI processes> lmp_mpi -sf gpu -pk gpu <number of GPUs> -in input.lammps ``` Replace `<number of MPI processes>` with the desired number of MPI processes, and `<number of GPUs>` with the number of GPUs you want to use. Please note that the specific steps and commands may vary depending on your LAMMPS version, GPU configuration, and system setup. Refer to the LAMMPS documentation and CUDA Toolkit documentation for more detailed instructions and troubleshooting information.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值