---
# System prepended metadata

title: Nvidia Driver & CUDA 安裝技巧
tags: [Templates, Documentation]

---

---
title: 'Nvidia Driver & CUDA 安裝技巧'
disqus: hackmd
---

Nvidia Driver & CUDA 安裝技巧
===
![downloads](https://img.shields.io/github/downloads/atom/atom/total.svg)
![build](https://img.shields.io/appveyor/ci/:user/:repo.svg)
![chat](https://img.shields.io/discord/:serverId.svg)

## 目錄

[TOC]

刪除 CUDA
---

```gherkin=
$ sudo usr/local/cuda-{10.2}/bin/cuda-uninstaller
```


刪除 Nvidia driver
---

```gherkin=
$ sudo nvidia-uninstall
```

CUDA 與 Nvidia driver 一起裝
---
- CUDA 下載: https://developer.nvidia.com/cuda-toolkit-archive
載完後直接在terminal執行

- 添加環境變數(#重點，不然會讀不到!!!)
```typescript=
$sudo gedit ~/.bashrc
```
- 在檔案最後面添加以下內容
```typescript=
export PATH=/usr/local/cuda-{10.2}/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-{10.2}/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
```
- 若有使用anaconda，須連其CUDA副本一起更改
```typescript=
$source ~/.bashrc
```

Runtime報錯 libcuda.so. cannot open shared object file no such file or directory
---

```gherkin=
$ sudo ldconfig /usr/local/cuda/lib64
```

> Read more about Gherkin here: https://docs.cucumber.io/gherkin/reference/


> Read more about mermaid here: http://mermaid-js.github.io/mermaid/

## Appendix and FAQ

:::info
**Find this document incomplete?** Leave a comment!
:::

###### tags: `Templates` `Documentation`
