Nvidia 开源 KO 驱动 开发入门
显卡设备
工作站os版本
卸载原有nvidia驱动
准备驱动程序
github开源代码地址:
https://github.com/NVIDIA/open-gpu-kernel-modules
开源驱动,切换到对应版本的tag
git clone https://github.com/NVIDIA/open-gpu-kernel-modules.git git checkout 570.172.08
编译安装ko
make modules -j$(nproc) sudo make modules_install -j$(nproc)
安装对应版本的用户态闭源驱动,不带ko的安装形式
下载网址:
https://www.nvidia.cn/drivers/details/249200/
sudo ./NVIDIA-Linux-x86_64-570.172.08.run --no-kernel-modules sudo apt install nvidia-utils-570
安装过程中
安装完成后确认
配置cuda环境变量
编译测试cuda用例
cuda sample的github链接,拉取到本地
https://github.com/NVIDIA/cuda-samples
编译cuda sample
测试
修改ko源码,查看是否生效
reboot后查看
研究ko相关逻辑
使用gpu的进程