Skip to content

Instantly share code, notes, and snippets.

@fwyzard
fwyzard / optimus.md
Last active July 3, 2021 15:51
Configure Optimus for Ubuntu 18.10

Configure the system to use the Intel driver

Disable GPU Manager

GPU Manager will overwrite the X configuration at each reboot, so the first step is to disable it.

According to various posts it can be disabled adding nogpumanager to the boot options e.g. in GRUB. Edit /etc/default/grub and add nogpumanager to the GRUB_CMDLINE_LINUX option.

For example, if /etc/default/grub had

@fwyzard
fwyzard / test.cu
Last active November 23, 2021 14:04
Test program to check what CUDA operations can be performed on a device different than the current one
#include <cuda_runtime.h>
#include "cudaCheck.h"
int main(void) {
// 3D buffer layout
constexpr size_t pitch = 32;
constexpr size_t width = 20;
static_assert(width <= pitch, "The 3D buffer `width` cannot be larger than the `pitch`.");
constexpr size_t height = 8;
constexpr size_t slices = 4;
@fwyzard
fwyzard / xavier-lxc-centos7.md
Last active June 17, 2023 08:13
Install CentOS 7 in an LXC/LXD container on an NVIDIA Xavier

Install and configure LXD

Install LXD

sudo snap install lxd

Perform the initial configuration

sudo lxd init