When using GPU Accelerator on Linux, the first step is to replace the Nouveau driver (which is often included by default on many Linux distributions) with the NVIDIA driver. NVIDIA provides detailed instructions on how to accomplish this, although the basic idea is to change the runlevel to 3 (so as not to use the X Windows system since a driver can’t be uninstalled if it’s in use), disable and/or uninstall the Nouveau driver, then install the NVIDIA driver.
(On my CentOS system, I had to also blacklist nouveau driver by appending “rdblacklist=nouveau” to the kernel line in /etc/grub.conf because the driver was included in the initramfs image file.)
Using “lsmod | grep -i nouveau” can be used to verify whether the Nouveau (or NVIDIA) driver is being used.
Usually, the NVIDIA driver is loaded when the X Windows system starts (e.g., runlevel 5). However, on a cluster with no X Window system installed, or on a workstation that does not start the X Window system automatically (e.g., runlevel 3), the NVIDIA devices may not be seen by the operating system and Mechanical APDL. In such cases, the NVIDIA CUDA Getting Started Guide provides a script to work around this issue:
#!/bin/bash /sbin/modprobe nvidia if [ "$?" -eq 0 ]; then # Count the number of NVIDIA controllers found. NVDEVS=`lspci | grep -i NVIDIA` N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l` NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l` N=`expr $N3D + $NVGA - 1` for i in `seq 0 $N`; do mknod -m 666 /dev/nvidia$i c 195 $i done mknod -m 666 /dev/nvidiactl c 195 255 else exit 1 fi
Running the above script as root will create the NVIDIA devices in /dev, thus allowing the user to run Mechanical APDL with GPU Accelerator (assuming supported NVIDIA GPU cards are installed) without the X Window system running. This could be addded to a startup script to perform this action at boot (see the chkconfig Linux command for more details).