Skip to content

Commit

Permalink
Add compile script
Browse files Browse the repository at this point in the history
  • Loading branch information
slacrherbst committed Feb 15, 2024
1 parent 77bb182 commit 33bfc57
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
17 changes: 2 additions & 15 deletions data_gpu/driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,10 @@ https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

See section 5.

The nvidia instructions are a bit off. These are the current steps taken at the time of this readme update:
A script in this directory 'comp_and_load_drivers.sh' is provided to compile and load the nvidia drivers as well as the driver in this directory. Edit this file and update the NVIDIA_PATH value at the top to the install directory for the nvidia drivers.

```bash
$ apt-get install nvidia-kernel-source-535-open
$ apt-get install cuda-drivers-fabricmanager-535
$ cd /usr/src/nvidia-535.154.05
$ make CC=gcc-12
$ insmod nvidia.ko
```

You can then build the data_gpu image.

Update the makefile and edit the following line to point to the correct path to the nvida drivers:

NVIDIA_DRIVERS := /usr/src/nvidia-535.154.05/nvidia

```bash
$ make
$ insmod data_gpu.ko
$ ./comp_and_load_drivers.sh
```
24 changes: 24 additions & 0 deletions data_gpu/driver/comp_and_load_drivers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

NVIDIA_PATH=/usr/src/nvidia-535.154.05/
RET_DIR=$PWD

sudo /usr/sbin/rmmod datagpu
sudo /usr/sbin/rmmod nvidia-drm
sudo /usr/sbin/rmmod nvidia-uvm
sudo /usr/sbin/rmmod nvidia-modeset
sudo /usr/sbin/rmmod nvidia

cd $NVIDIA_PATH

make CC=gcc-12

sudo /usr/sbin/insmod nvidia.ko NVreg_OpenRmEnableUnsupportedGpus=1
sudo /usr/sbin/insmod nvidia-modeset.ko
sudo /usr/sbin/insmod nvidia-uvm.ko
sudo /usr/sbin/insmod nvidia-drm.ko modeset=1

cd $RET_DIR

make NVIDIA_DRIVERS=$NVIDIA_PATH
sudo /usr/sbin/insmod datagpu.ko

0 comments on commit 33bfc57

Please sign in to comment.