Skip to content

Instantly share code, notes, and snippets.

@juniorprincewang
juniorprincewang / test_cudaLaunchKernel.cu
Last active October 10, 2022 13:38
cudaLaunchKernel usage
// Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
//
// This work is made available under the Nvidia Source Code License-NC.
// To view a copy of this license, visit
// https://nvlabs.github.io/stylegan2/license.html
// From https://github.com/NVlabs/stylegan2/blob/master/test_nvcc.cu
#include <cstdio>
void checkCudaError(cudaError_t err)
@juniorprincewang
juniorprincewang / LICENSE
Created May 19, 2020 09:02 — forked from domnikl/LICENSE
C function to dump memory
Copyright 2018 Dominik Liebler
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@juniorprincewang
juniorprincewang / nouveau_object_new.log
Last active June 10, 2020 05:49
create oclass=0xa0c0 (KEPLER_COMPUTE_A) object
nouveau 0000:02:00.0: DRM: func nouveau_abi16_ioctl_grobj_alloc, chan id 2
nouveau: DRM-master:00000000:00000000: ioctl: size 32
nouveau: DRM-master:00000000:00000000: ioctl: vers 0 type 01 object ffff8f3c83489510 owner ff
nouveau: user_test[21217]:00000000:0000a06f: ioctl: sclass size 8
nouveau: user_test[21217]:00000000:0000a06f: ioctl: sclass vers 0 count 0
nouveau: user_test[21217]:00000000:0000a06f: func nvkm_fifo_chan_child_get mask 0x2000404000000
nouveau: user_test[21217]:00000000:0000a06f: func nvkm_fifo_chan_child_get mask 0x2000404000000
nouveau: user_test[21217]:00000000:0000a06f: func nvkm_fifo_chan_child_get mask 0x2000404000000
nouveau: user_test[21217]:00000000:0000a06f: func nvkm_fifo_chan_child_get mask 0x2000404000000
nouveau: user_test[21217]:00000000:0000a06f: func nvkm_fifo_chan_child_get mask 0x2000404000000
[920826.330878] nouveau 0000:02:00.0: mmu: grctx: func nvkm_vmm_map_locked addr 0x0 size 0xad000 page 7 refd 7
[920826.330878]
[920826.330879] nouveau 0000:02:00.0: mmu: grctx: trying 17
[920826.330881] nouveau 0000:02:00.0: mmu: grctx: alignment 0000000000000000 00000000000ad000 0000000000000000 17 12
[920826.330882] nouveau 0000:02:00.0: mmu: grctx: trying 12
[920826.330885] nouveau 0000:02:00.0: mmu: grctx: func gf100_vmm_valid
[920826.330885]
[920826.330886] nouveau 0000:02:00.0: mmu: grctx: func nvkm_vmm_iter name ref + map page->shift 12 addr 0x0 size 0xad000
[920826.330886]
[920826.330889] nouveau 0000:02:00.0: mmu: grctx: 00000:00000: ref + map: 0000000000000000 00000000000ad000 shift 12 173 PTEs lvl max 1
[43271.071796] nouveau 0000:02:00.0: mmu: subdev init running...
[43271.071798] nouveau 0000:02:00.0: mmu: one-time init running...
[43271.071800] nouveau 0000:02:00.0: mmu: one-time init completed in 1us
[43271.071801] nouveau 0000:02:00.0: mmu: init running...
[43271.071803] nouveau 0000:02:00.0: mmu: subdev init completed in 5us
[43271.071807] nouveau 0000:02:00.0: imem: new 00001000 00000000 0: 007fd75000 0000001000
[43271.071811] nouveau 0000:02:00.0: mmu: bar2: func nvkm_vmm_ctor pd_header 0x0 addr 0x0 size 0x2000000 name bar2
[43271.071813] nouveau 0000:02:00.0: mmu: bar2: bits 40 levels 2
@juniorprincewang
juniorprincewang / hosts
Created June 22, 2020 09:03
github 加速访问
# GitHub520 Host Start
185.199.108.154 github.githubassets.com
199.232.68.133 camo.githubusercontent.com
199.232.68.133 github.map.fastly.net
199.232.69.194 github.global.ssl.fastly.net
140.82.114.3 github.com
140.82.112.5 api.github.com
199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 favicons.githubusercontent.com
@juniorprincewang
juniorprincewang / amd-urls.txt
Last active April 25, 2021 03:36 — forked from yurikoles/amd-urls.txt
AMD GPU Open Source development docs
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/AMD_HDA_verbs_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/CIK_3D_registers_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/si_programming_guide_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/SI_3D_registers.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/evergreen_cayman_programming_guide.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/evergreen_3D_registers_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/cayman_3D_registers_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/R6xx_R7xx_3D.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/R6xx_3D_Registers.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/r600isa.pdf
@juniorprincewang
juniorprincewang / gem_ioctl_new.log
Created July 24, 2020 16:31
1. user mmu/mem/vmm are used
nouveau 0000:01:00.0: DRM: func nouveau_gem_ioctl_new size 0x24
nouveau 0000:01:00.0: DRM: func nouveau_bo_new size 0000000000000024 flags 4
nouveau 0000:01:00.0: DRM: page shift 12, pi 1
nouveau: DRM-master:00000000:00000000: ioctl: size 82
nouveau: DRM-master:00000000:00000000: ioctl: vers 0 type 02 object ffff9eb9ff0800f8 owner ff
nouveau: DRM-master:00000000:80009009: ioctl: new size 58
nouveau: DRM-master:00000000:80009009: ioctl: new vers 0 handle 00000000 class 8000900b route 00 token ffff9eba44a8e090 object ffff9eba44a8e090
nouveau: DRM-master:00000000:80009009: func nvkm_ummu_sclass
nouveau: DRM-master:00000000:80009009: func nvkm_umem_new type 5 page 12 size 0x1000
nouveau 0000:01:00.0: mmu: func nvkm_mem_new_type type NVKM_MEM_VRAM
@juniorprincewang
juniorprincewang / Makefile
Created May 11, 2021 02:10 — forked from EXL/1-ReadMe.md
OpenGLES for Linux example
all:
$(CC) *.c -lm `sdl2-config --cflags` `sdl2-config --libs` -lEGL -lGLESv1_CM -o gles_linux
clean:
-rm -f gles_linux
-rm -f *.o
@juniorprincewang
juniorprincewang / mesa-howto.md
Created June 22, 2021 07:12 — forked from Venemo/mesa-howto.md
How to build and use mesa from source

Building and using mesa for development and testing

This explains how to build mesa from source, and how to use the custom built mesa to run some apps and games, without needing to replace the mesa libraries that your operating system runs on.

Let's assume that you are using an x86_64 system.

Install dependencies

This is how to install them on Fedora. You can substitute with other distros' package managers, the packages are named similarly but maybe have a different naming convention (eg. -dev vs. -devel, etc.).